summaryrefslogtreecommitdiff
path: root/tmk_core
diff options
context:
space:
mode:
authorSean Dwyer <sean.dwyer@gmail.com>2018-11-06 11:54:53 -0800
committerDrashna Jaelre <drashna@live.com>2018-11-06 11:54:53 -0800
commit63e212c0b78be664785433c11cd728f15f50cd6a (patch)
treef20c10f2e0b3201d003e664bcd80f481c9982047 /tmk_core
parent388df5359b913eaf1ce6fb0ef624e430ad010ea5 (diff)
Add localized LED flash effect on keypress to Massdrop ALT (#4340)
Diffstat (limited to 'tmk_core')
-rw-r--r--tmk_core/protocol/arm_atsam/led_matrix.c14
-rw-r--r--tmk_core/protocol/arm_atsam/led_matrix.h3
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 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);