summaryrefslogtreecommitdiff
path: root/quantum/rgblight.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-05-18 06:05:35 -0700
committerFlorian Didron <fdidron@users.noreply.github.com>2020-06-12 17:00:27 +0900
commitdaa06948bb5a239869c24f442cdee9b3c35cc069 (patch)
treec83fad1e73873cbfab591e25d9b6809fb8b7d7a0 /quantum/rgblight.c
parentc5ec960a11909ba9c27b3facae95cebfe9b6e256 (diff)
Add query functions for RGB Light and RGB Matrix (#8960)
* Add additional query functions for RGBLIGHT * Add additional query functions for RGB Matrix * Change names of enable check functions * Fix macro for rgb matrix takeover of rgblight functions * Add documentation for rgb_matrix_get_hsv() * Add *_get_hsv function to rgblight
Diffstat (limited to 'quantum/rgblight.c')
-rw-r--r--quantum/rgblight.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/quantum/rgblight.c b/quantum/rgblight.c
index 5e53f47445..bcfedc5e7d 100644
--- a/quantum/rgblight.c
+++ b/quantum/rgblight.c
@@ -368,6 +368,8 @@ void rgblight_disable_noeeprom(void) {
rgblight_set();
}
+bool rgblight_is_enabled(void) { return rgblight_config.enable; }
+
void rgblight_increase_hue_helper(bool write_to_eeprom) {
uint8_t hue = rgblight_config.hue + RGBLIGHT_HUE_STEP;
rgblight_sethsv_eeprom_helper(hue, rgblight_config.sat, rgblight_config.val, write_to_eeprom);
@@ -522,6 +524,10 @@ uint8_t rgblight_get_sat(void) { return rgblight_config.sat; }
uint8_t rgblight_get_val(void) { return rgblight_config.val; }
+HSV rgblight_get_hsv(void) {
+ return (HSV){ rgblight_config.hue, rgblight_config.sat, rgblight_config.val };
+}
+
void rgblight_setrgb(uint8_t r, uint8_t g, uint8_t b) {
if (!rgblight_config.enable) {
return;