aboutsummaryrefslogtreecommitdiff
path: root/tmk_core/protocol
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2021-02-26 17:07:05 +1100
committerGitHub <noreply@github.com>2021-02-26 17:07:05 +1100
commitabe189377cd7af09041b54a7b3b19775f9ce8647 (patch)
treedaa587989f1d2970311bd7f71ca18d55c05da3a7 /tmk_core/protocol
parent4dc8a2dd6f3c04b7103de578310f9dddc149baa3 (diff)
downloadqmk_firmware-abe189377cd7af09041b54a7b3b19775f9ce8647.tar.gz
qmk_firmware-abe189377cd7af09041b54a7b3b19775f9ce8647.zip
[BUG] Massdrop develop rgb fix (#12022)
* Allow for disabling RGB_MATRIX on Massdrop boards. * Fixup init sequence. * Make some functions static as they've got very generic names.
Diffstat (limited to 'tmk_core/protocol')
-rw-r--r--tmk_core/protocol/arm_atsam/md_rgb_matrix.c10
-rw-r--r--tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c4
2 files changed, 9 insertions, 5 deletions
diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
index 0ea7e3839..eb71443b8 100644
--- a/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
+++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix.c
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifdef RGB_MATRIX_ENABLE
18#include "arm_atsam_protocol.h" 19#include "arm_atsam_protocol.h"
19#include "led.h" 20#include "led.h"
20#include "rgb_matrix.h" 21#include "rgb_matrix.h"
@@ -196,7 +197,7 @@ void md_rgb_matrix_prepare(void) {
196 } 197 }
197} 198}
198 199
199void led_set_one(int i, uint8_t r, uint8_t g, uint8_t b) { 200static void led_set_one(int i, uint8_t r, uint8_t g, uint8_t b) {
200 if (i < ISSI3733_LED_COUNT) { 201 if (i < ISSI3733_LED_COUNT) {
201#ifdef USE_MASSDROP_CONFIGURATOR 202#ifdef USE_MASSDROP_CONFIGURATOR
202 md_rgb_matrix_config_override(i); 203 md_rgb_matrix_config_override(i);
@@ -208,13 +209,13 @@ void led_set_one(int i, uint8_t r, uint8_t g, uint8_t b) {
208 } 209 }
209} 210}
210 211
211void led_set_all(uint8_t r, uint8_t g, uint8_t b) { 212static void led_set_all(uint8_t r, uint8_t g, uint8_t b) {
212 for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) { 213 for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) {
213 led_set_one(i, r, g, b); 214 led_set_one(i, r, g, b);
214 } 215 }
215} 216}
216 217
217void init(void) { 218static void init(void) {
218 DBGC(DC_LED_MATRIX_INIT_BEGIN); 219 DBGC(DC_LED_MATRIX_INIT_BEGIN);
219 220
220 issi3733_prepare_arrays(); 221 issi3733_prepare_arrays();
@@ -227,7 +228,7 @@ void init(void) {
227 DBGC(DC_LED_MATRIX_INIT_COMPLETE); 228 DBGC(DC_LED_MATRIX_INIT_COMPLETE);
228} 229}
229 230
230void flush(void) { 231static void flush(void) {
231#ifdef USE_MASSDROP_CONFIGURATOR 232#ifdef USE_MASSDROP_CONFIGURATOR
232 if (!led_enabled) { 233 if (!led_enabled) {
233 return; 234 return;
@@ -470,3 +471,4 @@ static void md_rgb_matrix_config_override(int i) {
470} 471}
471 472
472#endif // USE_MASSDROP_CONFIGURATOR 473#endif // USE_MASSDROP_CONFIGURATOR
474#endif // RGB_MATRIX_ENABLE \ No newline at end of file
diff --git a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c
index b43008cc5..1149cea7a 100644
--- a/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c
+++ b/tmk_core/protocol/arm_atsam/md_rgb_matrix_programs.c
@@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
15along with this program. If not, see <http://www.gnu.org/licenses/>. 15along with this program. If not, see <http://www.gnu.org/licenses/>.
16*/ 16*/
17 17
18#ifdef RGB_MATRIX_ENABLE
18#ifdef USE_MASSDROP_CONFIGURATOR 19#ifdef USE_MASSDROP_CONFIGURATOR
19 20
20# include "md_rgb_matrix.h" 21# include "md_rgb_matrix.h"
@@ -96,4 +97,5 @@ void *led_setups[] = {leds_rainbow_s, leds_rainbow_ns, leds_teal_salmon, leds_ye
96 97
97const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); 98const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]);
98 99
99#endif 100#endif // USE_MASSDROP_CONFIGURATOR
101#endif // RGB_MATRIX_ENABLE \ No newline at end of file