diff options
| author | Tynan Beatty <38031130+tynanbe@users.noreply.github.com> | 2020-08-07 16:43:57 -0500 |
|---|---|---|
| committer | James Young <18669334+noroadsleft@users.noreply.github.com> | 2020-08-29 14:30:02 -0700 |
| commit | e34eca361fdd9ff61b8827fec545202da179648c (patch) | |
| tree | c8581b9d1b379f6d9703dd4e6a4597f8b3cf0c8d /quantum | |
| parent | c990dc1e6cdcabbfe280d60e981f9e7cc733d5db (diff) | |
| download | qmk_firmware-e34eca361fdd9ff61b8827fec545202da179648c.tar.gz qmk_firmware-e34eca361fdd9ff61b8827fec545202da179648c.zip | |
Noeeprom functions for rgb_matrix (#9487)
* Add eeprom_helpers for toggle, mode, sethsv, speed; add set_speed; add noeeprom versions of toggle, step, hue, sat, val, and speed
* qmk cformat rgb_matrix
* Add rgb_matrix_set_speed and *_noeeprom functions
* Do not expose rgb_matrix_*_eeprom_helper functions
Diffstat (limited to 'quantum')
| -rw-r--r-- | quantum/rgb_matrix.c | 155 | ||||
| -rw-r--r-- | quantum/rgb_matrix.h | 64 |
2 files changed, 133 insertions, 86 deletions
diff --git a/quantum/rgb_matrix.c b/quantum/rgb_matrix.c index 615b4b0a7..802c5afce 100644 --- a/quantum/rgb_matrix.c +++ b/quantum/rgb_matrix.c | |||
| @@ -155,7 +155,7 @@ void eeconfig_update_rgb_matrix_default(void) { | |||
| 155 | } | 155 | } |
| 156 | 156 | ||
| 157 | void eeconfig_debug_rgb_matrix(void) { | 157 | void eeconfig_debug_rgb_matrix(void) { |
| 158 | dprintf("rgb_matrix_config eprom\n"); | 158 | dprintf("rgb_matrix_config EEPROM\n"); |
| 159 | dprintf("rgb_matrix_config.enable = %d\n", rgb_matrix_config.enable); | 159 | dprintf("rgb_matrix_config.enable = %d\n", rgb_matrix_config.enable); |
| 160 | dprintf("rgb_matrix_config.mode = %d\n", rgb_matrix_config.mode); | 160 | dprintf("rgb_matrix_config.mode = %d\n", rgb_matrix_config.mode); |
| 161 | dprintf("rgb_matrix_config.hsv.h = %d\n", rgb_matrix_config.hsv.h); | 161 | dprintf("rgb_matrix_config.hsv.h = %d\n", rgb_matrix_config.hsv.h); |
| @@ -462,11 +462,16 @@ void rgb_matrix_set_suspend_state(bool state) { | |||
| 462 | 462 | ||
| 463 | bool rgb_matrix_get_suspend_state(void) { return g_suspend_state; } | 463 | bool rgb_matrix_get_suspend_state(void) { return g_suspend_state; } |
| 464 | 464 | ||
| 465 | void rgb_matrix_toggle(void) { | 465 | void rgb_matrix_toggle_eeprom_helper(bool write_to_eeprom) { |
| 466 | rgb_matrix_config.enable ^= 1; | 466 | rgb_matrix_config.enable ^= 1; |
| 467 | rgb_task_state = STARTING; | 467 | rgb_task_state = STARTING; |
| 468 | eeconfig_update_rgb_matrix(); | 468 | if (write_to_eeprom) { |
| 469 | eeconfig_update_rgb_matrix(); | ||
| 470 | } | ||
| 471 | dprintf("rgb matrix toggle [%s]: rgb_matrix_config.enable = %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.enable); | ||
| 469 | } | 472 | } |
| 473 | void rgb_matrix_toggle_noeeprom(void) { rgb_matrix_toggle_eeprom_helper(false); } | ||
| 474 | void rgb_matrix_toggle(void) { rgb_matrix_toggle_eeprom_helper(true); } | ||
| 470 | 475 | ||
| 471 | void rgb_matrix_enable(void) { | 476 | void rgb_matrix_enable(void) { |
| 472 | rgb_matrix_enable_noeeprom(); | 477 | rgb_matrix_enable_noeeprom(); |
| @@ -490,90 +495,106 @@ void rgb_matrix_disable_noeeprom(void) { | |||
| 490 | 495 | ||
| 491 | uint8_t rgb_matrix_is_enabled(void) { return rgb_matrix_config.enable; } | 496 | uint8_t rgb_matrix_is_enabled(void) { return rgb_matrix_config.enable; } |
| 492 | 497 | ||
| 493 | void rgb_matrix_step(void) { | 498 | void rgb_matrix_mode_eeprom_helper(uint8_t mode, bool write_to_eeprom) { |
| 494 | rgb_matrix_config.mode++; | 499 | if (!rgb_matrix_config.enable) { |
| 495 | if (rgb_matrix_config.mode >= RGB_MATRIX_EFFECT_MAX) rgb_matrix_config.mode = 1; | 500 | return; |
| 501 | } | ||
| 502 | if (mode < 1) { | ||
| 503 | rgb_matrix_config.mode = 1; | ||
| 504 | } else if (mode >= RGB_MATRIX_EFFECT_MAX) { | ||
| 505 | rgb_matrix_config.mode = RGB_MATRIX_EFFECT_MAX - 1; | ||
| 506 | } else { | ||
| 507 | rgb_matrix_config.mode = mode; | ||
| 508 | } | ||
| 496 | rgb_task_state = STARTING; | 509 | rgb_task_state = STARTING; |
| 497 | eeconfig_update_rgb_matrix(); | 510 | if (write_to_eeprom) { |
| 511 | eeconfig_update_rgb_matrix(); | ||
| 512 | } | ||
| 513 | dprintf("rgb matrix mode [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.mode); | ||
| 498 | } | 514 | } |
| 515 | void rgb_matrix_mode_noeeprom(uint8_t mode) { rgb_matrix_mode_eeprom_helper(mode, false); } | ||
| 516 | void rgb_matrix_mode(uint8_t mode) { rgb_matrix_mode_eeprom_helper(mode, true); } | ||
| 499 | 517 | ||
| 500 | void rgb_matrix_step_reverse(void) { | 518 | uint8_t rgb_matrix_get_mode(void) { return rgb_matrix_config.mode; } |
| 501 | rgb_matrix_config.mode--; | ||
| 502 | if (rgb_matrix_config.mode < 1) rgb_matrix_config.mode = RGB_MATRIX_EFFECT_MAX - 1; | ||
| 503 | rgb_task_state = STARTING; | ||
| 504 | eeconfig_update_rgb_matrix(); | ||
| 505 | } | ||
| 506 | 519 | ||
| 507 | void rgb_matrix_increase_hue(void) { | 520 | void rgb_matrix_step_helper(bool write_to_eeprom) { |
| 508 | rgb_matrix_config.hsv.h += RGB_MATRIX_HUE_STEP; | 521 | uint8_t mode = rgb_matrix_config.mode + 1; |
| 509 | eeconfig_update_rgb_matrix(); | 522 | rgb_matrix_mode_eeprom_helper((mode < RGB_MATRIX_EFFECT_MAX) ? mode : 1, write_to_eeprom); |
| 510 | } | 523 | } |
| 524 | void rgb_matrix_step_noeeprom(void) { rgb_matrix_step_helper(false); } | ||
| 525 | void rgb_matrix_step(void) { rgb_matrix_step_helper(true); } | ||
| 511 | 526 | ||
| 512 | void rgb_matrix_decrease_hue(void) { | 527 | void rgb_matrix_step_reverse_helper(bool write_to_eeprom) { |
| 513 | rgb_matrix_config.hsv.h -= RGB_MATRIX_HUE_STEP; | 528 | uint8_t mode = rgb_matrix_config.mode - 1; |
| 514 | eeconfig_update_rgb_matrix(); | 529 | rgb_matrix_mode_eeprom_helper((mode < 1) ? RGB_MATRIX_EFFECT_MAX - 1 : mode, write_to_eeprom); |
| 515 | } | 530 | } |
| 531 | void rgb_matrix_step_reverse_noeeprom(void) { rgb_matrix_step_reverse_helper(false); } | ||
| 532 | void rgb_matrix_step_reverse(void) { rgb_matrix_step_reverse_helper(true); } | ||
| 516 | 533 | ||
| 517 | void rgb_matrix_increase_sat(void) { | 534 | void rgb_matrix_sethsv_eeprom_helper(uint16_t hue, uint8_t sat, uint8_t val, bool write_to_eeprom) { |
| 518 | rgb_matrix_config.hsv.s = qadd8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP); | 535 | if (!rgb_matrix_config.enable) { |
| 519 | eeconfig_update_rgb_matrix(); | 536 | return; |
| 520 | } | 537 | } |
| 521 | 538 | rgb_matrix_config.hsv.h = hue; | |
| 522 | void rgb_matrix_decrease_sat(void) { | 539 | rgb_matrix_config.hsv.s = sat; |
| 523 | rgb_matrix_config.hsv.s = qsub8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP); | 540 | rgb_matrix_config.hsv.v = (val > RGB_MATRIX_MAXIMUM_BRIGHTNESS) ? RGB_MATRIX_MAXIMUM_BRIGHTNESS : val; |
| 524 | eeconfig_update_rgb_matrix(); | 541 | if (write_to_eeprom) { |
| 542 | eeconfig_update_rgb_matrix(); | ||
| 543 | } | ||
| 544 | 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); | ||
| 525 | } | 545 | } |
| 546 | void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { rgb_matrix_sethsv_eeprom_helper(hue, sat, val, false); } | ||
| 547 | void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { rgb_matrix_sethsv_eeprom_helper(hue, sat, val, true); } | ||
| 526 | 548 | ||
| 527 | void rgb_matrix_increase_val(void) { | 549 | HSV rgb_matrix_get_hsv(void) { return rgb_matrix_config.hsv; } |
| 528 | rgb_matrix_config.hsv.v = qadd8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP); | 550 | uint8_t rgb_matrix_get_hue(void) { return rgb_matrix_config.hsv.h; } |
| 529 | if (rgb_matrix_config.hsv.v > RGB_MATRIX_MAXIMUM_BRIGHTNESS) rgb_matrix_config.hsv.v = RGB_MATRIX_MAXIMUM_BRIGHTNESS; | 551 | uint8_t rgb_matrix_get_sat(void) { return rgb_matrix_config.hsv.s; } |
| 530 | eeconfig_update_rgb_matrix(); | 552 | uint8_t rgb_matrix_get_val(void) { return rgb_matrix_config.hsv.v; } |
| 531 | } | ||
| 532 | 553 | ||
| 533 | void rgb_matrix_decrease_val(void) { | 554 | void rgb_matrix_increase_hue_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h + RGB_MATRIX_HUE_STEP, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, write_to_eeprom); } |
| 534 | rgb_matrix_config.hsv.v = qsub8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP); | 555 | void rgb_matrix_increase_hue_noeeprom(void) { rgb_matrix_increase_hue_helper(false); } |
| 535 | eeconfig_update_rgb_matrix(); | 556 | void rgb_matrix_increase_hue(void) { rgb_matrix_increase_hue_helper(true); } |
| 536 | } | ||
| 537 | 557 | ||
| 538 | void rgb_matrix_increase_speed(void) { | 558 | void rgb_matrix_decrease_hue_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h - RGB_MATRIX_HUE_STEP, rgb_matrix_config.hsv.s, rgb_matrix_config.hsv.v, write_to_eeprom); } |
| 539 | rgb_matrix_config.speed = qadd8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP); | 559 | void rgb_matrix_decrease_hue_noeeprom(void) { rgb_matrix_decrease_hue_helper(false); } |
| 540 | eeconfig_update_rgb_matrix(); | 560 | void rgb_matrix_decrease_hue(void) { rgb_matrix_decrease_hue_helper(true); } |
| 541 | } | ||
| 542 | 561 | ||
| 543 | void rgb_matrix_decrease_speed(void) { | 562 | void rgb_matrix_increase_sat_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, qadd8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP), rgb_matrix_config.hsv.v, write_to_eeprom); } |
| 544 | rgb_matrix_config.speed = qsub8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP); | 563 | void rgb_matrix_increase_sat_noeeprom(void) { rgb_matrix_increase_sat_helper(false); } |
| 545 | eeconfig_update_rgb_matrix(); | 564 | void rgb_matrix_increase_sat(void) { rgb_matrix_increase_sat_helper(true); } |
| 546 | } | ||
| 547 | 565 | ||
| 548 | uint8_t rgb_matrix_get_speed(void) { return rgb_matrix_config.speed; } | 566 | void rgb_matrix_decrease_sat_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, qsub8(rgb_matrix_config.hsv.s, RGB_MATRIX_SAT_STEP), rgb_matrix_config.hsv.v, write_to_eeprom); } |
| 567 | void rgb_matrix_decrease_sat_noeeprom(void) { rgb_matrix_decrease_sat_helper(false); } | ||
| 568 | void rgb_matrix_decrease_sat(void) { rgb_matrix_decrease_sat_helper(true); } | ||
| 549 | 569 | ||
| 550 | led_flags_t rgb_matrix_get_flags(void) { return rgb_effect_params.flags; } | 570 | void rgb_matrix_increase_val_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, qadd8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP), write_to_eeprom); } |
| 571 | void rgb_matrix_increase_val_noeeprom(void) { rgb_matrix_increase_val_helper(false); } | ||
| 572 | void rgb_matrix_increase_val(void) { rgb_matrix_increase_val_helper(true); } | ||
| 551 | 573 | ||
| 552 | void rgb_matrix_set_flags(led_flags_t flags) { rgb_effect_params.flags = flags; } | 574 | void rgb_matrix_decrease_val_helper(bool write_to_eeprom) { rgb_matrix_sethsv_eeprom_helper(rgb_matrix_config.hsv.h, rgb_matrix_config.hsv.s, qsub8(rgb_matrix_config.hsv.v, RGB_MATRIX_VAL_STEP), write_to_eeprom); } |
| 575 | void rgb_matrix_decrease_val_noeeprom(void) { rgb_matrix_decrease_val_helper(false); } | ||
| 576 | void rgb_matrix_decrease_val(void) { rgb_matrix_decrease_val_helper(true); } | ||
| 553 | 577 | ||
| 554 | void rgb_matrix_mode(uint8_t mode) { | 578 | void rgb_matrix_set_speed_eeprom_helper(uint8_t speed, bool write_to_eeprom) { |
| 555 | rgb_matrix_config.mode = mode; | 579 | rgb_matrix_config.speed = speed; |
| 556 | rgb_task_state = STARTING; | 580 | if (write_to_eeprom) { |
| 557 | eeconfig_update_rgb_matrix(); | 581 | eeconfig_update_rgb_matrix(); |
| 582 | } | ||
| 583 | dprintf("rgb matrix set speed [%s]: %u\n", (write_to_eeprom) ? "EEPROM" : "NOEEPROM", rgb_matrix_config.speed); | ||
| 558 | } | 584 | } |
| 585 | void rgb_matrix_set_speed_noeeprom(uint8_t speed) { rgb_matrix_set_speed_eeprom_helper(speed, false); } | ||
| 586 | void rgb_matrix_set_speed(uint8_t speed) { rgb_matrix_set_speed_eeprom_helper(speed, true); } | ||
| 559 | 587 | ||
| 560 | void rgb_matrix_mode_noeeprom(uint8_t mode) { rgb_matrix_config.mode = mode; } | 588 | uint8_t rgb_matrix_get_speed(void) { return rgb_matrix_config.speed; } |
| 561 | 589 | ||
| 562 | uint8_t rgb_matrix_get_mode(void) { return rgb_matrix_config.mode; } | 590 | void rgb_matrix_increase_speed_helper(bool write_to_eeprom) { rgb_matrix_set_speed_eeprom_helper(qadd8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP), write_to_eeprom); } |
| 591 | void rgb_matrix_increase_speed_noeeprom(void) { rgb_matrix_increase_speed_helper(false); } | ||
| 592 | void rgb_matrix_increase_speed(void) { rgb_matrix_increase_speed_helper(true); } | ||
| 563 | 593 | ||
| 564 | void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val) { | 594 | void rgb_matrix_decrease_speed_helper(bool write_to_eeprom) { rgb_matrix_set_speed_eeprom_helper(qsub8(rgb_matrix_config.speed, RGB_MATRIX_SPD_STEP), write_to_eeprom); } |
| 565 | rgb_matrix_sethsv_noeeprom(hue, sat, val); | 595 | void rgb_matrix_decrease_speed_noeeprom(void) { rgb_matrix_decrease_speed_helper(false); } |
| 566 | eeconfig_update_rgb_matrix(); | 596 | void rgb_matrix_decrease_speed(void) { rgb_matrix_decrease_speed_helper(true); } |
| 567 | } | ||
| 568 | 597 | ||
| 569 | void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val) { | 598 | led_flags_t rgb_matrix_get_flags(void) { return rgb_effect_params.flags; } |
| 570 | rgb_matrix_config.hsv.h = hue; | ||
| 571 | rgb_matrix_config.hsv.s = sat; | ||
| 572 | rgb_matrix_config.hsv.v = val; | ||
| 573 | if (rgb_matrix_config.hsv.v > RGB_MATRIX_MAXIMUM_BRIGHTNESS) rgb_matrix_config.hsv.v = RGB_MATRIX_MAXIMUM_BRIGHTNESS; | ||
| 574 | } | ||
| 575 | 599 | ||
| 576 | HSV rgb_matrix_get_hsv(void) { return rgb_matrix_config.hsv; } | 600 | void rgb_matrix_set_flags(led_flags_t flags) { rgb_effect_params.flags = flags; } |
| 577 | uint8_t rgb_matrix_get_hue(void) { return rgb_matrix_config.hsv.h; } | ||
| 578 | uint8_t rgb_matrix_get_sat(void) { return rgb_matrix_config.hsv.s; } | ||
| 579 | uint8_t rgb_matrix_get_val(void) { return rgb_matrix_config.hsv.v; } | ||
diff --git a/quantum/rgb_matrix.h b/quantum/rgb_matrix.h index 03e9e8572..733333349 100644 --- a/quantum/rgb_matrix.h +++ b/quantum/rgb_matrix.h | |||
| @@ -108,61 +108,87 @@ void rgb_matrix_init(void); | |||
| 108 | void rgb_matrix_set_suspend_state(bool state); | 108 | void rgb_matrix_set_suspend_state(bool state); |
| 109 | bool rgb_matrix_get_suspend_state(void); | 109 | bool rgb_matrix_get_suspend_state(void); |
| 110 | void rgb_matrix_toggle(void); | 110 | void rgb_matrix_toggle(void); |
| 111 | void rgb_matrix_toggle_noeeprom(void); | ||
| 111 | void rgb_matrix_enable(void); | 112 | void rgb_matrix_enable(void); |
| 112 | void rgb_matrix_enable_noeeprom(void); | 113 | void rgb_matrix_enable_noeeprom(void); |
| 113 | void rgb_matrix_disable(void); | 114 | void rgb_matrix_disable(void); |
| 114 | void rgb_matrix_disable_noeeprom(void); | 115 | void rgb_matrix_disable_noeeprom(void); |
| 115 | uint8_t rgb_matrix_is_enabled(void); | 116 | uint8_t rgb_matrix_is_enabled(void); |
| 117 | void rgb_matrix_mode(uint8_t mode); | ||
| 118 | void rgb_matrix_mode_noeeprom(uint8_t mode); | ||
| 119 | uint8_t rgb_matrix_get_mode(void); | ||
| 116 | void rgb_matrix_step(void); | 120 | void rgb_matrix_step(void); |
| 121 | void rgb_matrix_step_noeeprom(void); | ||
| 117 | void rgb_matrix_step_reverse(void); | 122 | void rgb_matrix_step_reverse(void); |
| 123 | void rgb_matrix_step_reverse_noeeprom(void); | ||
| 124 | void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val); | ||
| 125 | void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); | ||
| 126 | HSV rgb_matrix_get_hsv(void); | ||
| 127 | uint8_t rgb_matrix_get_hue(void); | ||
| 128 | uint8_t rgb_matrix_get_sat(void); | ||
| 129 | uint8_t rgb_matrix_get_val(void); | ||
| 118 | void rgb_matrix_increase_hue(void); | 130 | void rgb_matrix_increase_hue(void); |
| 131 | void rgb_matrix_increase_hue_noeeprom(void); | ||
| 119 | void rgb_matrix_decrease_hue(void); | 132 | void rgb_matrix_decrease_hue(void); |
| 133 | void rgb_matrix_decrease_hue_noeeprom(void); | ||
| 120 | void rgb_matrix_increase_sat(void); | 134 | void rgb_matrix_increase_sat(void); |
| 135 | void rgb_matrix_increase_sat_noeeprom(void); | ||
| 121 | void rgb_matrix_decrease_sat(void); | 136 | void rgb_matrix_decrease_sat(void); |
| 137 | void rgb_matrix_decrease_sat_noeeprom(void); | ||
| 122 | void rgb_matrix_increase_val(void); | 138 | void rgb_matrix_increase_val(void); |
| 139 | void rgb_matrix_increase_val_noeeprom(void); | ||
| 123 | void rgb_matrix_decrease_val(void); | 140 | void rgb_matrix_decrease_val(void); |
| 141 | void rgb_matrix_decrease_val_noeeprom(void); | ||
| 142 | void rgb_matrix_set_speed(uint8_t speed); | ||
| 143 | void rgb_matrix_set_speed_noeeprom(uint8_t speed); | ||
| 144 | uint8_t rgb_matrix_get_speed(void); | ||
| 124 | void rgb_matrix_increase_speed(void); | 145 | void rgb_matrix_increase_speed(void); |
| 146 | void rgb_matrix_increase_speed_noeeprom(void); | ||
| 125 | void rgb_matrix_decrease_speed(void); | 147 | void rgb_matrix_decrease_speed(void); |
| 126 | uint8_t rgb_matrix_get_speed(void); | 148 | void rgb_matrix_decrease_speed_noeeprom(void); |
| 127 | led_flags_t rgb_matrix_get_flags(void); | 149 | led_flags_t rgb_matrix_get_flags(void); |
| 128 | void rgb_matrix_set_flags(led_flags_t flags); | 150 | void rgb_matrix_set_flags(led_flags_t flags); |
| 129 | void rgb_matrix_mode(uint8_t mode); | ||
| 130 | void rgb_matrix_mode_noeeprom(uint8_t mode); | ||
| 131 | uint8_t rgb_matrix_get_mode(void); | ||
| 132 | void rgb_matrix_sethsv(uint16_t hue, uint8_t sat, uint8_t val); | ||
| 133 | void rgb_matrix_sethsv_noeeprom(uint16_t hue, uint8_t sat, uint8_t val); | ||
| 134 | HSV rgb_matrix_get_hsv(void); | ||
| 135 | uint8_t rgb_matrix_get_hue(void); | ||
| 136 | uint8_t rgb_matrix_get_sat(void); | ||
| 137 | uint8_t rgb_matrix_get_val(void); | ||
| 138 | 151 | ||
| 139 | #ifndef RGBLIGHT_ENABLE | 152 | #ifndef RGBLIGHT_ENABLE |
| 140 | # define rgblight_toggle rgb_matrix_toggle | 153 | # define rgblight_toggle rgb_matrix_toggle |
| 154 | # define rgblight_toggle_noeeprom rgb_matrix_toggle_noeeprom | ||
| 141 | # define rgblight_enable rgb_matrix_enable | 155 | # define rgblight_enable rgb_matrix_enable |
| 142 | # define rgblight_enable_noeeprom rgb_matrix_enable_noeeprom | 156 | # define rgblight_enable_noeeprom rgb_matrix_enable_noeeprom |
| 143 | # define rgblight_disable rgb_matrix_disable | 157 | # define rgblight_disable rgb_matrix_disable |
| 144 | # define rgblight_disable_noeeprom rgb_matrix_disable_noeeprom | 158 | # define rgblight_disable_noeeprom rgb_matrix_disable_noeeprom |
| 145 | # define rgblight_is_enabled rgb_matrix_is_enabled | 159 | # define rgblight_is_enabled rgb_matrix_is_enabled |
| 160 | # define rgblight_mode rgb_matrix_mode | ||
| 161 | # define rgblight_mode_noeeprom rgb_matrix_mode_noeeprom | ||
| 162 | # define rgblight_get_mode rgb_matrix_get_mode | ||
| 163 | # define rgblight_get_hue rgb_matrix_get_hue | ||
| 164 | # define rgblight_get_sat rgb_matrix_get_sat | ||
| 165 | # define rgblight_get_val rgb_matrix_get_val | ||
| 166 | # define rgblight_get_hsv rgb_matrix_get_hsv | ||
| 146 | # define rgblight_step rgb_matrix_step | 167 | # define rgblight_step rgb_matrix_step |
| 168 | # define rgblight_step_noeeprom rgb_matrix_step_noeeprom | ||
| 169 | # define rgblight_step_reverse rgb_matrix_step_reverse | ||
| 170 | # define rgblight_step_reverse_noeeprom rgb_matrix_step_reverse_noeeprom | ||
| 147 | # define rgblight_sethsv rgb_matrix_sethsv | 171 | # define rgblight_sethsv rgb_matrix_sethsv |
| 148 | # define rgblight_sethsv_noeeprom rgb_matrix_sethsv_noeeprom | 172 | # define rgblight_sethsv_noeeprom rgb_matrix_sethsv_noeeprom |
| 149 | # define rgblight_step_reverse rgb_matrix_step_reverse | ||
| 150 | # define rgblight_increase_hue rgb_matrix_increase_hue | 173 | # define rgblight_increase_hue rgb_matrix_increase_hue |
| 174 | # define rgblight_increase_hue_noeeprom rgb_matrix_increase_hue_noeeprom | ||
| 151 | # define rgblight_decrease_hue rgb_matrix_decrease_hue | 175 | # define rgblight_decrease_hue rgb_matrix_decrease_hue |
| 176 | # define rgblight_decrease_hue_noeeprom rgb_matrix_decrease_hue_noeeprom | ||
| 152 | # define rgblight_increase_sat rgb_matrix_increase_sat | 177 | # define rgblight_increase_sat rgb_matrix_increase_sat |
| 178 | # define rgblight_increase_sat_noeeprom rgb_matrix_increase_sat_noeeprom | ||
| 153 | # define rgblight_decrease_sat rgb_matrix_decrease_sat | 179 | # define rgblight_decrease_sat rgb_matrix_decrease_sat |
| 180 | # define rgblight_decrease_sat_noeeprom rgb_matrix_decrease_sat_noeeprom | ||
| 154 | # define rgblight_increase_val rgb_matrix_increase_val | 181 | # define rgblight_increase_val rgb_matrix_increase_val |
| 182 | # define rgblight_increase_val_noeeprom rgb_matrix_increase_val_noeeprom | ||
| 155 | # define rgblight_decrease_val rgb_matrix_decrease_val | 183 | # define rgblight_decrease_val rgb_matrix_decrease_val |
| 184 | # define rgblight_decrease_val_noeeprom rgb_matrix_decrease_val_noeeprom | ||
| 185 | # define rgblight_set_speed rgb_matrix_set_speed | ||
| 186 | # define rgblight_set_speed_noeeprom rgb_matrix_set_speed_noeeprom | ||
| 187 | # define rgblight_get_speed rgb_matrix_get_speed | ||
| 156 | # define rgblight_increase_speed rgb_matrix_increase_speed | 188 | # define rgblight_increase_speed rgb_matrix_increase_speed |
| 189 | # define rgblight_increase_speed_noeeprom rgb_matrix_increase_speed_noeeprom | ||
| 157 | # define rgblight_decrease_speed rgb_matrix_decrease_speed | 190 | # define rgblight_decrease_speed rgb_matrix_decrease_speed |
| 158 | # define rgblight_get_speed rgb_matrix_get_speed | 191 | # define rgblight_decrease_speed_noeeprom rgb_matrix_decrease_speed_noeeprom |
| 159 | # define rgblight_mode rgb_matrix_mode | ||
| 160 | # define rgblight_mode_noeeprom rgb_matrix_mode_noeeprom | ||
| 161 | # define rgblight_get_mode rgb_matrix_get_mode | ||
| 162 | # define rgblight_get_hue rgb_matrix_get_hue | ||
| 163 | # define rgblight_get_sat rgb_matrix_get_sat | ||
| 164 | # define rgblight_get_val rgb_matrix_get_val | ||
| 165 | # define rgblight_get_hsv rgb_matrix_get_hsv | ||
| 166 | #endif | 192 | #endif |
| 167 | 193 | ||
| 168 | typedef struct { | 194 | typedef struct { |
