diff options
Diffstat (limited to 'quantum/backlight/backlight.c')
-rw-r--r-- | quantum/backlight/backlight.c | 54 |
1 files changed, 38 insertions, 16 deletions
diff --git a/quantum/backlight/backlight.c b/quantum/backlight/backlight.c index dfb98419e6..52ec086bb0 100644 --- a/quantum/backlight/backlight.c +++ b/quantum/backlight/backlight.c @@ -95,10 +95,10 @@ void backlight_toggle(void) { * FIXME: needs doc */ void backlight_enable(void) { - if (backlight_config.enable) return; // do nothing if backlight is already on + if (backlight_config.enable) return; // do nothing if backlight is already on backlight_config.enable = true; - if (backlight_config.raw == 1) // enabled but level == 0 + if (backlight_config.raw == 1) // enabled but level == 0 backlight_config.level = 1; eeconfig_update_backlight(backlight_config.raw); dprintf("backlight enable\n"); @@ -110,7 +110,7 @@ void backlight_enable(void) { * FIXME: needs doc */ void backlight_disable(void) { - if (!backlight_config.enable) return; // do nothing if backlight is already off + if (!backlight_config.enable) return; // do nothing if backlight is already off backlight_config.enable = false; eeconfig_update_backlight(backlight_config.raw); @@ -122,7 +122,9 @@ void backlight_disable(void) { * * FIXME: needs doc */ -bool is_backlight_enabled(void) { return backlight_config.enable; } +bool is_backlight_enabled(void) { + return backlight_config.enable; +} /** \brief Backlight step through levels * @@ -158,11 +160,17 @@ void backlight_level(uint8_t level) { eeconfig_update_backlight(backlight_config.raw); } -uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); } +uint8_t eeconfig_read_backlight(void) { + return eeprom_read_byte(EECONFIG_BACKLIGHT); +} -void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); } +void eeconfig_update_backlight(uint8_t val) { + eeprom_update_byte(EECONFIG_BACKLIGHT, val); +} -void eeconfig_update_backlight_current(void) { eeconfig_update_backlight(backlight_config.raw); } +void eeconfig_update_backlight_current(void) { + eeconfig_update_backlight(backlight_config.raw); +} void eeconfig_update_backlight_default(void) { backlight_config.enable = 1; @@ -179,7 +187,9 @@ void eeconfig_update_backlight_default(void) { * * FIXME: needs doc */ -uint8_t get_backlight_level(void) { return backlight_config.level; } +uint8_t get_backlight_level(void) { + return backlight_config.level; +} #ifdef BACKLIGHT_BREATHING /** \brief Backlight breathing toggle @@ -200,7 +210,7 @@ void backlight_toggle_breathing(void) { * FIXME: needs doc */ void backlight_enable_breathing(void) { - if (backlight_config.breathing) return; // do nothing if breathing is already on + if (backlight_config.breathing) return; // do nothing if breathing is already on backlight_config.breathing = true; eeconfig_update_backlight(backlight_config.raw); @@ -213,7 +223,7 @@ void backlight_enable_breathing(void) { * FIXME: needs doc */ void backlight_disable_breathing(void) { - if (!backlight_config.breathing) return; // do nothing if breathing is already off + if (!backlight_config.breathing) return; // do nothing if breathing is already off backlight_config.breathing = false; eeconfig_update_backlight(backlight_config.raw); @@ -225,18 +235,30 @@ void backlight_disable_breathing(void) { * * FIXME: needs doc */ -bool is_backlight_breathing(void) { return backlight_config.breathing; } +bool is_backlight_breathing(void) { + return backlight_config.breathing; +} // following are marked as weak purely for backwards compatibility -__attribute__((weak)) void breathing_period_set(uint8_t value) { breathing_period = value ? value : 1; } +__attribute__((weak)) void breathing_period_set(uint8_t value) { + breathing_period = value ? value : 1; +} -__attribute__((weak)) uint8_t get_breathing_period(void) { return breathing_period; } +__attribute__((weak)) uint8_t get_breathing_period(void) { + return breathing_period; +} -__attribute__((weak)) void breathing_period_default(void) { breathing_period_set(BREATHING_PERIOD); } +__attribute__((weak)) void breathing_period_default(void) { + breathing_period_set(BREATHING_PERIOD); +} -__attribute__((weak)) void breathing_period_inc(void) { breathing_period_set(breathing_period + 1); } +__attribute__((weak)) void breathing_period_inc(void) { + breathing_period_set(breathing_period + 1); +} -__attribute__((weak)) void breathing_period_dec(void) { breathing_period_set(breathing_period - 1); } +__attribute__((weak)) void breathing_period_dec(void) { + breathing_period_set(breathing_period - 1); +} __attribute__((weak)) void breathing_toggle(void) { if (is_breathing()) |