diff options
| author | Sean Dwyer <sean.dwyer@gmail.com> | 2018-11-06 11:54:53 -0800 |
|---|---|---|
| committer | Drashna Jaelre <drashna@live.com> | 2018-11-06 11:54:53 -0800 |
| commit | 63e212c0b78be664785433c11cd728f15f50cd6a (patch) | |
| tree | f20c10f2e0b3201d003e664bcd80f481c9982047 /tmk_core/protocol | |
| parent | 388df5359b913eaf1ce6fb0ef624e430ad010ea5 (diff) | |
| download | qmk_firmware-63e212c0b78be664785433c11cd728f15f50cd6a.tar.gz qmk_firmware-63e212c0b78be664785433c11cd728f15f50cd6a.zip | |
Add localized LED flash effect on keypress to Massdrop ALT (#4340)
Diffstat (limited to 'tmk_core/protocol')
| -rw-r--r-- | tmk_core/protocol/arm_atsam/led_matrix.c | 14 | ||||
| -rw-r--r-- | tmk_core/protocol/arm_atsam/led_matrix.h | 3 |
2 files changed, 13 insertions, 4 deletions
diff --git a/tmk_core/protocol/arm_atsam/led_matrix.c b/tmk_core/protocol/arm_atsam/led_matrix.c index 7ee1dad22..c328fdc4c 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; | |||
| 257 | uint8_t led_per_run = 15; | 257 | uint8_t led_per_run = 15; |
| 258 | float breathe_mult; | 258 | float breathe_mult; |
| 259 | 259 | ||
| 260 | void led_matrix_run(led_setup_t *f) | 260 | __attribute__ ((weak)) |
| 261 | void led_matrix_run(void) | ||
| 261 | { | 262 | { |
| 262 | float ro; | 263 | float ro; |
| 263 | float go; | 264 | float go; |
| 264 | float bo; | 265 | float bo; |
| 265 | float px; | 266 | float px; |
| 266 | uint8_t led_this_run = 0; | 267 | uint8_t led_this_run = 0; |
| 268 | led_setup_t *f = (led_setup_t*)led_setups[led_animation_id]; | ||
| 267 | 269 | ||
| 268 | if (led_cur == 0) //Denotes start of new processing cycle in the case of chunked processing | 270 | if (led_cur == 0) //Denotes start of new processing cycle in the case of chunked processing |
| 269 | { | 271 | { |
| @@ -459,13 +461,19 @@ uint8_t led_matrix_init(void) | |||
| 459 | 461 | ||
| 460 | //Run led matrix code once for initial LED coloring | 462 | //Run led matrix code once for initial LED coloring |
| 461 | led_cur = 0; | 463 | led_cur = 0; |
| 462 | led_matrix_run((led_setup_t*)led_setups[led_animation_id]); | 464 | rgb_matrix_init_user(); |
| 465 | led_matrix_run(); | ||
| 463 | 466 | ||
| 464 | DBGC(DC_LED_MATRIX_INIT_COMPLETE); | 467 | DBGC(DC_LED_MATRIX_INIT_COMPLETE); |
| 465 | 468 | ||
| 466 | return 0; | 469 | return 0; |
| 467 | } | 470 | } |
| 468 | 471 | ||
| 472 | __attribute__ ((weak)) | ||
| 473 | void rgb_matrix_init_user(void) { | ||
| 474 | |||
| 475 | } | ||
| 476 | |||
| 469 | #define LED_UPDATE_RATE 10 //ms | 477 | #define LED_UPDATE_RATE 10 //ms |
| 470 | 478 | ||
| 471 | //led data processing can take time, so process data in chunks to free up the processor | 479 | //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) | |||
| 502 | if (led_cur != lede) | 510 | if (led_cur != lede) |
| 503 | { | 511 | { |
| 504 | //m15_off; //debug profiling | 512 | //m15_off; //debug profiling |
| 505 | led_matrix_run((led_setup_t*)led_setups[led_animation_id]); | 513 | led_matrix_run(); |
| 506 | //m15_on; //debug profiling | 514 | //m15_on; //debug profiling |
| 507 | } | 515 | } |
| 508 | } | 516 | } |
diff --git a/tmk_core/protocol/arm_atsam/led_matrix.h b/tmk_core/protocol/arm_atsam/led_matrix.h index 01b078b71..3f2b9cdb8 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 { | |||
| 86 | } led_disp_t; | 86 | } led_disp_t; |
| 87 | 87 | ||
| 88 | uint8_t led_matrix_init(void); | 88 | uint8_t led_matrix_init(void); |
| 89 | void rgb_matrix_init_user(void); | ||
| 89 | 90 | ||
| 90 | #define LED_MODE_NORMAL 0 //Must be 0 | 91 | #define LED_MODE_NORMAL 0 //Must be 0 |
| 91 | #define LED_MODE_KEYS_ONLY 1 | 92 | #define LED_MODE_KEYS_ONLY 1 |
| @@ -134,7 +135,7 @@ extern void *led_setups[]; | |||
| 134 | extern issi3733_led_t *led_cur; | 135 | extern issi3733_led_t *led_cur; |
| 135 | extern issi3733_led_t *lede; | 136 | extern issi3733_led_t *lede; |
| 136 | 137 | ||
| 137 | void led_matrix_run(led_setup_t *f); | 138 | void led_matrix_run(void); |
| 138 | void led_matrix_task(void); | 139 | void led_matrix_task(void); |
| 139 | 140 | ||
| 140 | void gcr_compute(void); | 141 | void gcr_compute(void); |
