aboutsummaryrefslogtreecommitdiffstats
path: root/quantum/rgblight.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2020-05-18 06:05:35 -0700
committerGitHub <noreply@github.com>2020-05-18 06:05:35 -0700
commitd0e0202b272a28d6a1e7f0d059396067bb861272 (patch)
treefb1c7fc315cf53846bda0f55985232e71ee9ce82 /quantum/rgblight.c
parente55d55edc08d5a5ca557e3ff442ca47ccd731067 (diff)
downloadfirmware-d0e0202b272a28d6a1e7f0d059396067bb861272.tar.gz
firmware-d0e0202b272a28d6a1e7f0d059396067bb861272.tar.bz2
firmware-d0e0202b272a28d6a1e7f0d059396067bb861272.zip
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 64123774c..b50be200e 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;