diff options
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/eeconfig.h | 26 | ||||
| -rw-r--r-- | quantum/led_matrix/led_matrix.c | 32 | ||||
| -rw-r--r-- | quantum/rgb_matrix/rgb_matrix.c | 32 |
3 files changed, 46 insertions, 44 deletions
diff --git a/quantum/eeconfig.h b/quantum/eeconfig.h index bd39971b2..22d874273 100644 --- a/quantum/eeconfig.h +++ b/quantum/eeconfig.h | |||
| @@ -111,3 +111,29 @@ void eeconfig_update_haptic(uint32_t val); | |||
| 111 | 111 | ||
| 112 | bool eeconfig_read_handedness(void); | 112 | bool eeconfig_read_handedness(void); |
| 113 | void eeconfig_update_handedness(bool val); | 113 | void eeconfig_update_handedness(bool val); |
| 114 | |||
| 115 | #define EECONFIG_DEBOUNCE_HELPER(name, offset, config) \ | ||
| 116 | static uint8_t dirty_##name = false; \ | ||
| 117 | \ | ||
| 118 | static inline void eeconfig_init_##name(void) { \ | ||
| 119 | eeprom_read_block(&config, offset, sizeof(config)); \ | ||
| 120 | dirty_##name = false; \ | ||
| 121 | } \ | ||
| 122 | static inline void eeconfig_flush_##name(bool force) { \ | ||
| 123 | if (force || dirty_##name) { \ | ||
| 124 | eeprom_update_block(&config, offset, sizeof(config)); \ | ||
| 125 | dirty_##name = false; \ | ||
| 126 | } \ | ||
| 127 | } \ | ||
| 128 | static inline void eeconfig_flush_##name##_task(uint16_t timeout) { \ | ||
| 129 | static uint16_t flush_timer = 0; \ | ||
| 130 | if (timer_elapsed(flush_timer) > timeout) { \ | ||
| 131 | eeconfig_flush_##name(false); \ | ||
| 132 | flush_timer = timer_read(); \ | ||
| 133 | } \ | ||
| 134 | } \ | ||
| 135 | static inline void eeconfig_flag_##name(bool v) { dirty_##name |= v; } \ | ||
| 136 | static inline void eeconfig_write_##name(typeof(config) conf) { \ | ||
| 137 | memcpy(&config, &conf, sizeof(config)); \ | ||
| 138 | eeconfig_flag_##name(true); \ | ||
| 139 | } | ||
diff --git a/quantum/led_matrix/led_matrix.c b/quantum/led_matrix/led_matrix.c index 50510e49a..2f0086d36 100644 --- a/quantum/led_matrix/led_matrix.c +++ b/quantum/led_matrix/led_matrix.c | |||
| @@ -33,14 +33,6 @@ const led_point_t k_led_matrix_center = {112, 32}; | |||
| 33 | const led_point_t k_led_matrix_center = LED_MATRIX_CENTER; | 33 | const led_point_t k_led_matrix_center = LED_MATRIX_CENTER; |
| 34 | #endif | 34 | #endif |
| 35 | 35 | ||
| 36 | // clang-format off | ||
| 37 | #ifndef LED_MATRIX_IMMEDIATE_EEPROM | ||
| 38 | # define led_eeconfig_update(v) led_update_eeprom |= v | ||
| 39 | #else | ||
| 40 | # define led_eeconfig_update(v) if (v) eeconfig_update_led_matrix() | ||
| 41 | #endif | ||
| 42 | // clang-format on | ||
| 43 | |||
| 44 | // Generic effect runners | 36 | // Generic effect runners |
| 45 | #include "led_matrix_runners.inc" | 37 | #include "led_matrix_runners.inc" |
| 46 | 38 | ||
| @@ -107,7 +99,6 @@ last_hit_t g_last_hit_tracker; | |||
| 107 | 99 | ||
| 108 | // internals | 100 | // internals |
| 109 | static bool suspend_state = false; | 101 | static bool suspend_state = false; |
| 110 | static bool led_update_eeprom = false; | ||
| 111 | static uint8_t led_last_enable = UINT8_MAX; | 102 | static uint8_t led_last_enable = UINT8_MAX; |
| 112 | static uint8_t led_last_effect = UINT8_MAX; | 103 | static uint8_t led_last_effect = UINT8_MAX; |
| 113 | static effect_params_t led_effect_params = {0, LED_FLAG_ALL, false}; | 104 | static effect_params_t led_effect_params = {0, LED_FLAG_ALL, false}; |
| @@ -127,9 +118,7 @@ static last_hit_t last_hit_buffer; | |||
| 127 | const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; | 118 | const uint8_t k_led_matrix_split[2] = LED_MATRIX_SPLIT; |
| 128 | #endif | 119 | #endif |
| 129 | 120 | ||
| 130 | void eeconfig_read_led_matrix(void) { eeprom_read_block(&led_matrix_eeconfig, EECONFIG_LED_MATRIX, sizeof(led_matrix_eeconfig)); } | 121 | EECONFIG_DEBOUNCE_HELPER(led_matrix, EECONFIG_LED_MATRIX, led_matrix_eeconfig); |
| 131 | |||
| 132 | void eeconfig_update_led_matrix(void) { eeprom_update_block(&led_matrix_eeconfig, EECONFIG_LED_MATRIX, sizeof(led_matrix_eeconfig)); } | ||
| 133 | 122 | ||
| 134 | void eeconfig_update_led_matrix_default(void) { | 123 | void eeconfig_update_led_matrix_default(void) { |
| 135 | dprintf("eeconfig_update_led_matrix_default\n"); | 124 | dprintf("eeconfig_update_led_matrix_default\n"); |
| @@ -138,7 +127,7 @@ void eeconfig_update_led_matrix_default(void) { | |||
| 138 | led_matrix_eeconfig.val = LED_MATRIX_STARTUP_VAL; | 127 | led_matrix_eeconfig.val = LED_MATRIX_STARTUP_VAL; |
| 139 | led_matrix_eeconfig.speed = LED_MATRIX_STARTUP_SPD; | 128 | led_matrix_eeconfig.speed = LED_MATRIX_STARTUP_SPD; |
| 140 | led_matrix_eeconfig.flags = LED_FLAG_ALL; | 129 | led_matrix_eeconfig.flags = LED_FLAG_ALL; |
| 141 | eeconfig_update_led_matrix(); | 130 | eeconfig_flush_led_matrix(true); |
| 142 | } | 131 | } |
| 143 | 132 | ||
| 144 | void eeconfig_debug_led_matrix(void) { | 133 | void eeconfig_debug_led_matrix(void) { |
| @@ -279,9 +268,8 @@ static void led_task_timers(void) { | |||
| 279 | } | 268 | } |
| 280 | 269 | ||
| 281 | static void led_task_sync(void) { | 270 | static void led_task_sync(void) { |
| 271 | eeconfig_flush_led_matrix(false); | ||
| 282 | // next task | 272 | // next task |
| 283 | if (led_update_eeprom) eeconfig_update_led_matrix(); | ||
| 284 | led_update_eeprom = false; | ||
| 285 | if (sync_timer_elapsed32(g_led_timer) >= LED_MATRIX_LED_FLUSH_LIMIT) led_task_state = STARTING; | 273 | if (sync_timer_elapsed32(g_led_timer) >= LED_MATRIX_LED_FLUSH_LIMIT) led_task_state = STARTING; |
| 286 | } | 274 | } |
| 287 | 275 | ||
| @@ -449,7 +437,7 @@ void led_matrix_init(void) { | |||
| 449 | eeconfig_update_led_matrix_default(); | 437 | eeconfig_update_led_matrix_default(); |
| 450 | } | 438 | } |
| 451 | 439 | ||
| 452 | eeconfig_read_led_matrix(); | 440 | eeconfig_init_led_matrix(); |
| 453 | if (!led_matrix_eeconfig.mode) { | 441 | if (!led_matrix_eeconfig.mode) { |
| 454 | dprintf("led_matrix_init_drivers led_matrix_eeconfig.mode = 0. Write default values to EEPROM.\n"); | 442 | dprintf("led_matrix_init_drivers led_matrix_eeconfig.mode = 0. Write default values to EEPROM.\n"); |
| 455 | eeconfig_update_led_matrix_default(); | 443 | eeconfig_update_led_matrix_default(); |
| @@ -472,7 +460,7 @@ bool led_matrix_get_suspend_state(void) { return suspend_state; } | |||
| 472 | void led_matrix_toggle_eeprom_helper(bool write_to_eeprom) { | 460 | void led_matrix_toggle_eeprom_helper(bool write_to_eeprom) { |
| 473 | led_matrix_eeconfig.enable ^= 1; | 461 | led_matrix_eeconfig.enable ^= 1; |
| 474 | led_task_state = STARTING; | 462 | led_task_state = STARTING; |
| 475 | led_eeconfig_update(write_to_eeprom); | 463 | eeconfig_flag_led_matrix(write_to_eeprom); |
| 476 | dprintf("led matrix toggle [%s]: led_matrix_eeconfig.enable = %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.enable); | 464 | dprintf("led matrix toggle [%s]: led_matrix_eeconfig.enable = %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.enable); |
| 477 | } | 465 | } |
| 478 | void led_matrix_toggle_noeeprom(void) { led_matrix_toggle_eeprom_helper(false); } | 466 | void led_matrix_toggle_noeeprom(void) { led_matrix_toggle_eeprom_helper(false); } |
| @@ -480,7 +468,7 @@ void led_matrix_toggle(void) { led_matrix_toggle_eeprom_helper(true); } | |||
| 480 | 468 | ||
| 481 | void led_matrix_enable(void) { | 469 | void led_matrix_enable(void) { |
| 482 | led_matrix_enable_noeeprom(); | 470 | led_matrix_enable_noeeprom(); |
| 483 | led_eeconfig_update(true); | 471 | eeconfig_flag_led_matrix(true); |
| 484 | } | 472 | } |
| 485 | 473 | ||
| 486 | void led_matrix_enable_noeeprom(void) { | 474 | void led_matrix_enable_noeeprom(void) { |
| @@ -490,7 +478,7 @@ void led_matrix_enable_noeeprom(void) { | |||
| 490 | 478 | ||
| 491 | void led_matrix_disable(void) { | 479 | void led_matrix_disable(void) { |
| 492 | led_matrix_disable_noeeprom(); | 480 | led_matrix_disable_noeeprom(); |
| 493 | led_eeconfig_update(true); | 481 | eeconfig_flag_led_matrix(true); |
| 494 | } | 482 | } |
| 495 | 483 | ||
| 496 | void led_matrix_disable_noeeprom(void) { | 484 | void led_matrix_disable_noeeprom(void) { |
| @@ -512,7 +500,7 @@ void led_matrix_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { | |||
| 512 | led_matrix_eeconfig.mode = mode; | 500 | led_matrix_eeconfig.mode = mode; |
| 513 | } | 501 | } |
| 514 | led_task_state = STARTING; | 502 | led_task_state = STARTING; |
| 515 | led_eeconfig_update(write_to_eeprom); | 503 | eeconfig_flag_led_matrix(write_to_eeprom); |
| 516 | dprintf("led matrix mode [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.mode); | 504 | dprintf("led matrix mode [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.mode); |
| 517 | } | 505 | } |
| 518 | void led_matrix_mode_noeeprom(uint8_t mode) { led_matrix_mode_eeprom_helper(mode, false); } | 506 | void led_matrix_mode_noeeprom(uint8_t mode) { led_matrix_mode_eeprom_helper(mode, false); } |
| @@ -539,7 +527,7 @@ void led_matrix_set_val_eeprom_helper(uint8_t val, bool write_to_eeprom) { | |||
| 539 | return; | 527 | return; |
| 540 | } | 528 | } |
| 541 | led_matrix_eeconfig.val = (val > LED_MATRIX_MAXIMUM_BRIGHTNESS) ? LED_MATRIX_MAXIMUM_BRIGHTNESS : val; | 529 | led_matrix_eeconfig.val = (val > LED_MATRIX_MAXIMUM_BRIGHTNESS) ? LED_MATRIX_MAXIMUM_BRIGHTNESS : val; |
| 542 | led_eeconfig_update(write_to_eeprom); | 530 | eeconfig_flag_led_matrix(write_to_eeprom); |
| 543 | dprintf("led matrix set val [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.val); | 531 | dprintf("led matrix set val [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.val); |
| 544 | } | 532 | } |
| 545 | void led_matrix_set_val_noeeprom(uint8_t val) { led_matrix_set_val_eeprom_helper(val, false); } | 533 | void led_matrix_set_val_noeeprom(uint8_t val) { led_matrix_set_val_eeprom_helper(val, false); } |
| @@ -557,7 +545,7 @@ void led_matrix_decrease_val(void) { led_matrix_decrease_val_helper(true); } | |||
| 557 | 545 | ||
| 558 | void led_matrix_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { | 546 | void led_matrix_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { |
| 559 | led_matrix_eeconfig.speed = speed; | 547 | led_matrix_eeconfig.speed = speed; |
| 560 | led_eeconfig_update(write_to_eeprom); | 548 | eeconfig_flag_led_matrix(write_to_eeprom); |
| 561 | dprintf("led matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.speed); | 549 | dprintf("led matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", led_matrix_eeconfig.speed); |
| 562 | } | 550 | } |
| 563 | void led_matrix_set_speed_noeeprom(uint8_t speed) { led_matrix_set_speed_eeprom_helper(speed, false); } | 551 | void led_matrix_set_speed_noeeprom(uint8_t speed) { led_matrix_set_speed_eeprom_helper(speed, false); } |
diff --git a/quantum/rgb_matrix/rgb_matrix.c b/quantum/rgb_matrix/rgb_matrix.c index 8f00b4087..0c9ef8f7a 100644 --- a/quantum/rgb_matrix/rgb_matrix.c +++ b/quantum/rgb_matrix/rgb_matrix.c | |||
| @@ -31,14 +31,6 @@ const led_point_t k_rgb_matrix_center = {112, 32}; | |||
| 31 | const led_point_t k_rgb_matrix_center = RGB_MATRIX_CENTER; | 31 | const led_point_t k_rgb_matrix_center = RGB_MATRIX_CENTER; |
| 32 | #endif | 32 | #endif |
| 33 | 33 | ||
| 34 | // clang-format off | ||
| 35 | #ifndef RGB_MATRIX_IMMEDIATE_EEPROM | ||
| 36 | # define rgb_eeconfig_update(v) rgb_update_eeprom |= v | ||
| 37 | #else | ||
| 38 | # define rgb_eeconfig_update(v) if (v) eeconfig_update_rgb_matrix() | ||
| 39 | #endif | ||
| 40 | // clang-format on | ||
| 41 | |||
| 42 | __attribute__((weak)) RGB rgb_matrix_hsv_to_rgb(HSV hsv) { return hsv_to_rgb(hsv); } | 34 | __attribute__((weak)) RGB rgb_matrix_hsv_to_rgb(HSV hsv) { return hsv_to_rgb(hsv); } |
| 43 | 35 | ||
| 44 | // Generic effect runners | 36 | // Generic effect runners |
| @@ -128,7 +120,6 @@ last_hit_t g_last_hit_tracker; | |||
| 128 | 120 | ||
| 129 | // internals | 121 | // internals |
| 130 | static bool suspend_state = false; | 122 | static bool suspend_state = false; |
| 131 | static bool rgb_update_eeprom = false; | ||
| 132 | static uint8_t rgb_last_enable = UINT8_MAX; | 123 | static uint8_t rgb_last_enable = UINT8_MAX; |
| 133 | static uint8_t rgb_last_effect = UINT8_MAX; | 124 | static uint8_t rgb_last_effect = UINT8_MAX; |
| 134 | static effect_params_t rgb_effect_params = {0, LED_FLAG_ALL, false}; | 125 | static effect_params_t rgb_effect_params = {0, LED_FLAG_ALL, false}; |
| @@ -148,9 +139,7 @@ static last_hit_t last_hit_buffer; | |||
| 148 | const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; | 139 | const uint8_t k_rgb_matrix_split[2] = RGB_MATRIX_SPLIT; |
| 149 | #endif | 140 | #endif |
| 150 | 141 | ||
| 151 | void eeconfig_read_rgb_matrix(void) { eeprom_read_block(&rgb_matrix_config, EECONFIG_RGB_MATRIX, sizeof(rgb_matrix_config)); } | 142 | EECONFIG_DEBOUNCE_HELPER(rgb_matrix, EECONFIG_RGB_MATRIX, rgb_matrix_config); |
| 152 | |||
| 153 | void eeconfig_update_rgb_matrix(void) { eeprom_update_block(&rgb_matrix_config, EECONFIG_RGB_MATRIX, sizeof(rgb_matrix_config)); } | ||
| 154 | 143 | ||
| 155 | void eeconfig_update_rgb_matrix_default(void) { | 144 | void eeconfig_update_rgb_matrix_default(void) { |
| 156 | dprintf("eeconfig_update_rgb_matrix_default\n"); | 145 | dprintf("eeconfig_update_rgb_matrix_default\n"); |
| @@ -159,7 +148,7 @@ void eeconfig_update_rgb_matrix_default(void) { | |||
| 159 | rgb_matrix_config.hsv = (HSV){RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT, RGB_MATRIX_STARTUP_VAL}; | 148 | rgb_matrix_config.hsv = (HSV){RGB_MATRIX_STARTUP_HUE, RGB_MATRIX_STARTUP_SAT, RGB_MATRIX_STARTUP_VAL}; |
| 160 | rgb_matrix_config.speed = RGB_MATRIX_STARTUP_SPD; | 149 | rgb_matrix_config.speed = RGB_MATRIX_STARTUP_SPD; |
| 161 | rgb_matrix_config.flags = LED_FLAG_ALL; | 150 | rgb_matrix_config.flags = LED_FLAG_ALL; |
| 162 | eeconfig_update_rgb_matrix(); | 151 | eeconfig_flush_rgb_matrix(true); |
| 163 | } | 152 | } |
| 164 | 153 | ||
| 165 | void eeconfig_debug_rgb_matrix(void) { | 154 | void eeconfig_debug_rgb_matrix(void) { |
| @@ -314,9 +303,8 @@ static void rgb_task_timers(void) { | |||
| 314 | } | 303 | } |
| 315 | 304 | ||
| 316 | static void rgb_task_sync(void) { | 305 | static void rgb_task_sync(void) { |
| 306 | eeconfig_flush_rgb_matrix(false); | ||
| 317 | // next task | 307 | // next task |
| 318 | if (rgb_update_eeprom) eeconfig_update_rgb_matrix(); | ||
| 319 | rgb_update_eeprom = false; | ||
| 320 | if (sync_timer_elapsed32(g_rgb_timer) >= RGB_MATRIX_LED_FLUSH_LIMIT) rgb_task_state = STARTING; | 308 | if (sync_timer_elapsed32(g_rgb_timer) >= RGB_MATRIX_LED_FLUSH_LIMIT) rgb_task_state = STARTING; |
| 321 | } | 309 | } |
| 322 | 310 | ||
| @@ -491,7 +479,7 @@ void rgb_matrix_init(void) { | |||
| 491 | eeconfig_update_rgb_matrix_default(); | 479 | eeconfig_update_rgb_matrix_default(); |
| 492 | } | 480 | } |
| 493 | 481 | ||
| 494 | eeconfig_read_rgb_matrix(); | 482 | eeconfig_init_rgb_matrix(); |
| 495 | if (!rgb_matrix_config.mode) { | 483 | if (!rgb_matrix_config.mode) { |
| 496 | dprintf("rgb_matrix_init_drivers rgb_matrix_config.mode = 0. Write default values to EEPROM.\n"); | 484 | dprintf("rgb_matrix_init_drivers rgb_matrix_config.mode = 0. Write default values to EEPROM.\n"); |
| 497 | eeconfig_update_rgb_matrix_default(); | 485 | eeconfig_update_rgb_matrix_default(); |
| @@ -514,7 +502,7 @@ bool rgb_matrix_get_suspend_state(void) { return suspend_state; } | |||
| 514 | void rgb_matrix_toggle_eeprom_helper(bool write_to_eeprom) { | 502 | void rgb_matrix_toggle_eeprom_helper(bool write_to_eeprom) { |
| 515 | rgb_matrix_config.enable ^= 1; | 503 | rgb_matrix_config.enable ^= 1; |
| 516 | rgb_task_state = STARTING; | 504 | rgb_task_state = STARTING; |
| 517 | rgb_eeconfig_update(write_to_eeprom); | 505 | eeconfig_flag_rgb_matrix(write_to_eeprom); |
| 518 | dprintf("rgb matrix toggle [%s]: rgb_matrix_config.enable = %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.enable); | 506 | dprintf("rgb matrix toggle [%s]: rgb_matrix_config.enable = %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.enable); |
| 519 | } | 507 | } |
| 520 | void rgb_matrix_toggle_noeeprom(void) { rgb_matrix_toggle_eeprom_helper(false); } | 508 | void rgb_matrix_toggle_noeeprom(void) { rgb_matrix_toggle_eeprom_helper(false); } |
| @@ -522,7 +510,7 @@ void rgb_matrix_toggle(void) { rgb_matrix_toggle_eeprom_helper(true); } | |||
| 522 | 510 | ||
| 523 | void rgb_matrix_enable(void) { | 511 | void rgb_matrix_enable(void) { |
| 524 | rgb_matrix_enable_noeeprom(); | 512 | rgb_matrix_enable_noeeprom(); |
| 525 | rgb_eeconfig_update(true); | 513 | eeconfig_flag_rgb_matrix(true); |
| 526 | } | 514 | } |
| 527 | 515 | ||
| 528 | void rgb_matrix_enable_noeeprom(void) { | 516 | void rgb_matrix_enable_noeeprom(void) { |
| @@ -532,7 +520,7 @@ void rgb_matrix_enable_noeeprom(void) { | |||
| 532 | 520 | ||
| 533 | void rgb_matrix_disable(void) { | 521 | void rgb_matrix_disable(void) { |
| 534 | rgb_matrix_disable_noeeprom(); | 522 | rgb_matrix_disable_noeeprom(); |
| 535 | rgb_eeconfig_update(true); | 523 | eeconfig_flag_rgb_matrix(true); |
| 536 | } | 524 | } |
| 537 | 525 | ||
| 538 | void rgb_matrix_disable_noeeprom(void) { | 526 | void rgb_matrix_disable_noeeprom(void) { |
| @@ -554,7 +542,7 @@ void rgb_matrix_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { | |||
| 554 | rgb_matrix_config.mode = mode; | 542 | rgb_matrix_config.mode = mode; |
| 555 | } | 543 | } |
| 556 | rgb_task_state = STARTING; | 544 | rgb_task_state = STARTING; |
| 557 | rgb_eeconfig_update(write_to_eeprom); | 545 | eeconfig_flag_rgb_matrix(write_to_eeprom); |
| 558 | dprintf("rgb matrix mode [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.mode); | 546 | dprintf("rgb matrix mode [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.mode); |
| 559 | } | 547 | } |
| 560 | void rgb_matrix_mode_noeeprom(uint8_t mode) { rgb_matrix_mode_eeprom_helper(mode, false); } | 548 | void rgb_matrix_mode_noeeprom(uint8_t mode) { rgb_matrix_mode_eeprom_helper(mode, false); } |
| @@ -583,7 +571,7 @@ void rgb_matrix_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, boo | |||
| 583 | rgb_matrix_config.hsv.h = hue; | 571 | rgb_matrix_config.hsv.h = hue; |
| 584 | rgb_matrix_config.hsv.s = sat; | 572 | rgb_matrix_config.hsv.s = sat; |
| 585 | rgb_matrix_config.hsv.v = (val > RGB_MATRIX_MAXIMUM_BRIGHTNESS) ? RGB_MATRIX_MAXIMUM_BRIGHTNESS : val; | 573 | rgb_matrix_config.hsv.v = (val > RGB_MATRIX_MAXIMUM_BRIGHTNESS) ? RGB_MATRIX_MAXIMUM_BRIGHTNESS : val; |
| 586 | rgb_eeconfig_update(write_to_eeprom); | 574 | eeconfig_flag_rgb_matrix(write_to_eeprom); |
| 587 | dprintf("rgb matrix set hsv [%s]: %u,%u,%u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); | 575 | dprintf("rgb matrix set hsv [%s]: %u,%u,%u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v); |
| 588 | } | 576 | } |
| 589 | void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { rgb_matrix_sethsv_eeprom_helper(hue, sat, val, false); } | 577 | void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { rgb_matrix_sethsv_eeprom_helper(hue, sat, val, false); } |
| @@ -620,7 +608,7 @@ void rgb_matrix_decrease_val(void) { rgb_matrix_decrease_val_helper(true); } | |||
| 620 | 608 | ||
| 621 | void rgb_matrix_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { | 609 | void rgb_matrix_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { |
| 622 | rgb_matrix_config.speed = speed; | 610 | rgb_matrix_config.speed = speed; |
| 623 | rgb_eeconfig_update(write_to_eeprom); | 611 | eeconfig_flag_rgb_matrix(write_to_eeprom); |
| 624 | dprintf("rgb matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.speed); | 612 | dprintf("rgb matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.speed); |
| 625 | } | 613 | } |
| 626 | void rgb_matrix_set_speed_noeeprom(uint8_t speed) { rgb_matrix_set_speed_eeprom_helper(speed, false); } | 614 | void rgb_matrix_set_speed_noeeprom(uint8_t speed) { rgb_matrix_set_speed_eeprom_helper(speed, false); } |
