aboutsummaryrefslogtreecommitdiff
path: root/quantum/rgb_matrix.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/rgb_matrix.c')
-rw-r--r--quantum/rgb_matrix.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c
index 04af3ae9e..ec17b4d72 100644
--- a/quantum/rgb_matrix.c
+++ b/quantum/rgb_matrix.c
@@ -184,11 +184,12 @@ void rgb_matrix_set_color(int index, uint8_t red, uint8_t green, uint8_t blue) {
184 184
185void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_driver.set_color_all(red, green, blue); } 185void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue) { rgb_matrix_driver.set_color_all(red, green, blue); }
186 186
187bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) { 187void process_rgb_matrix(uint8_t row, uint8_t col, bool pressed) {
188#ifndef RGB_MATRIX_SPLIT
189 if (!is_keyboard_master()) return;
190#endif
188#if RGB_DISABLE_TIMEOUT > 0 191#if RGB_DISABLE_TIMEOUT > 0
189 if (record->event.pressed) { 192 rgb_anykey_timer = 0;
190 rgb_anykey_timer = 0;
191 }
192#endif // RGB_DISABLE_TIMEOUT > 0 193#endif // RGB_DISABLE_TIMEOUT > 0
193 194
194#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED 195#ifdef RGB_MATRIX_KEYREACTIVE_ENABLED
@@ -196,12 +197,12 @@ bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
196 uint8_t led_count = 0; 197 uint8_t led_count = 0;
197 198
198# if defined(RGB_MATRIX_KEYRELEASES) 199# if defined(RGB_MATRIX_KEYRELEASES)
199 if (!record->event.pressed) 200 if (!pressed)
200# elif defined(RGB_MATRIX_KEYPRESSES) 201# elif defined(RGB_MATRIX_KEYPRESSES)
201 if (record->event.pressed) 202 if (pressed)
202# endif // defined(RGB_MATRIX_KEYRELEASES) 203# endif // defined(RGB_MATRIX_KEYRELEASES)
203 { 204 {
204 led_count = rgb_matrix_map_row_column_to_led(record->event.key.row, record->event.key.col, led); 205 led_count = rgb_matrix_map_row_column_to_led(row, col, led);
205 } 206 }
206 207
207 if (last_hit_buffer.count + led_count > LED_HITS_TO_REMEMBER) { 208 if (last_hit_buffer.count + led_count > LED_HITS_TO_REMEMBER) {
@@ -224,11 +225,9 @@ bool process_rgb_matrix(uint16_t keycode, keyrecord_t *record) {
224 225
225#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) 226#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP)
226 if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) { 227 if (rgb_matrix_config.mode == RGB_MATRIX_TYPING_HEATMAP) {
227 process_rgb_matrix_typing_heatmap(record); 228 process_rgb_matrix_typing_heatmap(row, col);
228 } 229 }
229#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP) 230#endif // defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) && !defined(DISABLE_RGB_MATRIX_TYPING_HEATMAP)
230
231 return true;
232} 231}
233 232
234void rgb_matrix_test(void) { 233void rgb_matrix_test(void) {
@@ -266,9 +265,9 @@ static bool rgb_matrix_none(effect_params_t *params) {
266 265
267static void rgb_task_timers(void) { 266static void rgb_task_timers(void) {
268#if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0 267#if defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0
269 uint32_t deltaTime = timer_elapsed32(rgb_timer_buffer); 268 uint32_t deltaTime = sync_timer_elapsed32(rgb_timer_buffer);
270#endif // defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0 269#endif // defined(RGB_MATRIX_KEYREACTIVE_ENABLED) || RGB_DISABLE_TIMEOUT > 0
271 rgb_timer_buffer = timer_read32(); 270 rgb_timer_buffer = sync_timer_read32();
272 271
273 // Update double buffer timers 272 // Update double buffer timers
274#if RGB_DISABLE_TIMEOUT > 0 273#if RGB_DISABLE_TIMEOUT > 0
@@ -296,7 +295,7 @@ static void rgb_task_timers(void) {
296 295
297static void rgb_task_sync(void) { 296static void rgb_task_sync(void) {
298 // next task 297 // next task
299 if (timer_elapsed32(g_rgb_timer) >= RGB_MATRIX_LED_FLUSH_LIMIT) rgb_task_state = STARTING; 298 if (sync_timer_elapsed32(g_rgb_timer) >= RGB_MATRIX_LED_FLUSH_LIMIT) rgb_task_state = STARTING;
300} 299}
301 300
302static void rgb_task_start(void) { 301static void rgb_task_start(void) {