From 63e212c0b78be664785433c11cd728f15f50cd6a Mon Sep 17 00:00:00 2001 From: Sean Dwyer Date: Tue, 6 Nov 2018 11:54:53 -0800 Subject: Add localized LED flash effect on keypress to Massdrop ALT (#4340) --- tmk_core/protocol/arm_atsam/led_matrix.c | 14 +++++++++++--- tmk_core/protocol/arm_atsam/led_matrix.h | 3 ++- 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'tmk_core/protocol') diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index 7ee1dad224..c328fdc4ce 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.c +++ b/tmk_core/protocol/arm_atsam/led_matrix.c @@ -257,13 +257,15 @@ issi3733_led_t *led_cur; uint8_t led_per_run = 15; float breathe_mult; -void led_matrix_run(led_setup_t *f) +__attribute__ ((weak)) +void led_matrix_run(void) { float ro; float go; float bo; float px; uint8_t led_this_run = 0; + led_setup_t *f = (led_setup_t*)led_setups[led_animation_id]; if (led_cur == 0) //Denotes start of new processing cycle in the case of chunked processing { @@ -459,13 +461,19 @@ uint8_t led_matrix_init(void) //Run led matrix code once for initial LED coloring led_cur = 0; - led_matrix_run((led_setup_t*)led_setups[led_animation_id]); + rgb_matrix_init_user(); + led_matrix_run(); DBGC(DC_LED_MATRIX_INIT_COMPLETE); return 0; } +__attribute__ ((weak)) +void rgb_matrix_init_user(void) { + +} + #define LED_UPDATE_RATE 10 //ms //led data processing can take time, so process data in chunks to free up the processor @@ -502,7 +510,7 @@ void led_matrix_task(void) if (led_cur != lede) { //m15_off; //debug profiling - led_matrix_run((led_setup_t*)led_setups[led_animation_id]); + led_matrix_run(); //m15_on; //debug profiling } } diff --git a/tmk_core/protocol/arm_atsam/led_matrix.h b/tmk_core/protocol/arm_atsam/led_matrix.h index 01b078b711..3f2b9cdb86 100644 --- a/tmk_core/protocol/arm_atsam/led_matrix.h +++ b/tmk_core/protocol/arm_atsam/led_matrix.h @@ -86,6 +86,7 @@ typedef struct led_disp_s { } led_disp_t; uint8_t led_matrix_init(void); +void rgb_matrix_init_user(void); #define LED_MODE_NORMAL 0 //Must be 0 #define LED_MODE_KEYS_ONLY 1 @@ -134,7 +135,7 @@ extern void *led_setups[]; extern issi3733_led_t *led_cur; extern issi3733_led_t *lede; -void led_matrix_run(led_setup_t *f); +void led_matrix_run(void); void led_matrix_task(void); void gcr_compute(void); -- cgit v1.2.1