1
0
Fork 0

[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.
This commit is contained in:
Nick Brassel 2021-02-26 17:07:05 +11:00 committed by GitHub
parent 4dc8a2dd6f
commit abe189377c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 13 additions and 9 deletions

View file

@ -79,4 +79,4 @@ void rgb_matrix_indicators_kb(void)
} }
#endif // USB_LED_INDICATOR_ENABLE #endif // USB_LED_INDICATOR_ENABLE
#endif #endif // RGB_MATRIX_ENABLE

View file

@ -621,6 +621,9 @@ void matrix_init_quantum() {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
audio_init(); audio_init();
#endif #endif
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_init();
#endif
#if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE) #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)
unicode_input_mode_init(); unicode_input_mode_init();
#endif #endif

View file

@ -307,9 +307,6 @@ void keyboard_init(void) {
#ifdef RGBLIGHT_ENABLE #ifdef RGBLIGHT_ENABLE
rgblight_init(); rgblight_init();
#endif #endif
#ifdef RGB_MATRIX_ENABLE
rgb_matrix_init();
#endif
#ifdef ENCODER_ENABLE #ifdef ENCODER_ENABLE
encoder_init(); encoder_init();
#endif #endif

View file

@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef RGB_MATRIX_ENABLE
#include "arm_atsam_protocol.h" #include "arm_atsam_protocol.h"
#include "led.h" #include "led.h"
#include "rgb_matrix.h" #include "rgb_matrix.h"
@ -196,7 +197,7 @@ void md_rgb_matrix_prepare(void) {
} }
} }
void led_set_one(int i, uint8_t r, uint8_t g, uint8_t b) { static void led_set_one(int i, uint8_t r, uint8_t g, uint8_t b) {
if (i < ISSI3733_LED_COUNT) { if (i < ISSI3733_LED_COUNT) {
#ifdef USE_MASSDROP_CONFIGURATOR #ifdef USE_MASSDROP_CONFIGURATOR
md_rgb_matrix_config_override(i); 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) {
} }
} }
void led_set_all(uint8_t r, uint8_t g, uint8_t b) { static void led_set_all(uint8_t r, uint8_t g, uint8_t b) {
for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) { for (uint8_t i = 0; i < ISSI3733_LED_COUNT; i++) {
led_set_one(i, r, g, b); led_set_one(i, r, g, b);
} }
} }
void init(void) { static void init(void) {
DBGC(DC_LED_MATRIX_INIT_BEGIN); DBGC(DC_LED_MATRIX_INIT_BEGIN);
issi3733_prepare_arrays(); issi3733_prepare_arrays();
@ -227,7 +228,7 @@ void init(void) {
DBGC(DC_LED_MATRIX_INIT_COMPLETE); DBGC(DC_LED_MATRIX_INIT_COMPLETE);
} }
void flush(void) { static void flush(void) {
#ifdef USE_MASSDROP_CONFIGURATOR #ifdef USE_MASSDROP_CONFIGURATOR
if (!led_enabled) { if (!led_enabled) {
return; return;
@ -470,3 +471,4 @@ static void md_rgb_matrix_config_override(int i) {
} }
#endif // USE_MASSDROP_CONFIGURATOR #endif // USE_MASSDROP_CONFIGURATOR
#endif // RGB_MATRIX_ENABLE

View file

@ -15,6 +15,7 @@ You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#ifdef RGB_MATRIX_ENABLE
#ifdef USE_MASSDROP_CONFIGURATOR #ifdef USE_MASSDROP_CONFIGURATOR
# include "md_rgb_matrix.h" # include "md_rgb_matrix.h"
@ -96,4 +97,5 @@ void *led_setups[] = {leds_rainbow_s, leds_rainbow_ns, leds_teal_salmon, leds_ye
const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]); const uint8_t led_setups_count = sizeof(led_setups) / sizeof(led_setups[0]);
#endif #endif // USE_MASSDROP_CONFIGURATOR
#endif // RGB_MATRIX_ENABLE