summaryrefslogtreecommitdiff
path: root/quantum/backlight
diff options
context:
space:
mode:
authorWilba <Jason.S.Williams@gmail.com>2020-01-21 05:18:25 +1100
committerMechMerlin <30334081+mechmerlin@users.noreply.github.com>2020-01-20 10:18:25 -0800
commit484a9b12bc3961fc0dd9481d3cb734959db42191 (patch)
treeca2e4219b6514c1033be3ab3a975bd24f723f2ba /quantum/backlight
parentce81c4f89b61560ee35436b351b27fd23568c32f (diff)
Add VIA support for QMK backlight, QMK RGBLight (#7911)
* Add VIA support for QMK backlight, QMK RGBLight * clang-format changes
Diffstat (limited to 'quantum/backlight')
-rw-r--r--quantum/backlight/backlight.c20
-rw-r--r--quantum/backlight/backlight.h2
2 files changed, 18 insertions, 4 deletions
diff --git a/quantum/backlight/backlight.c b/quantum/backlight/backlight.c
index e57b31d103..4aa74667d9 100644
--- a/quantum/backlight/backlight.c
+++ b/quantum/backlight/backlight.c
@@ -130,18 +130,30 @@ void backlight_step(void) {
backlight_set(backlight_config.level);
}
-/** \brief Backlight set level
+/** \brief Backlight set level without EEPROM update
*
- * FIXME: needs doc
*/
-void backlight_level(uint8_t level) {
+void backlight_level_noeeprom(uint8_t level) {
if (level > BACKLIGHT_LEVELS) level = BACKLIGHT_LEVELS;
backlight_config.level = level;
backlight_config.enable = !!backlight_config.level;
- eeconfig_update_backlight(backlight_config.raw);
backlight_set(backlight_config.level);
}
+/** \brief Backlight set level
+ *
+ * FIXME: needs doc
+ */
+void backlight_level(uint8_t level) {
+ backlight_level_noeeprom(level);
+ eeconfig_update_backlight(backlight_config.raw);
+}
+
+/** \brief Update current backlight state to EEPROM
+ *
+ */
+void eeconfig_update_backlight_current(void) { eeconfig_update_backlight(backlight_config.raw); }
+
/** \brief Get backlight level
*
* FIXME: needs doc
diff --git a/quantum/backlight/backlight.h b/quantum/backlight/backlight.h
index 9f0a5e81d7..08acf942ff 100644
--- a/quantum/backlight/backlight.h
+++ b/quantum/backlight/backlight.h
@@ -48,8 +48,10 @@ bool is_backlight_enabled(void);
void backlight_step(void);
void backlight_increase(void);
void backlight_decrease(void);
+void backlight_level_noeeprom(uint8_t level);
void backlight_level(uint8_t level);
uint8_t get_backlight_level(void);
+void eeconfig_update_backlight_current(void);
// implementation specific
void backlight_init_ports(void);