diff options
| author | fauxpark <fauxpark@gmail.com> | 2019-07-16 17:56:36 +1000 |
|---|---|---|
| committer | skullydazed <skullydazed@users.noreply.github.com> | 2019-07-16 00:56:36 -0700 |
| commit | a32f7e1a25a8a200d838aa8256ffe39708fbd723 (patch) | |
| tree | b1ede8bd7ce3d6b31c7bfd83d0f23a804c8efc8f /quantum/quantum.c | |
| parent | e2dfb787da2a2ba88e0e074b396a2b988e10eccf (diff) | |
| download | qmk_firmware-a32f7e1a25a8a200d838aa8256ffe39708fbd723.tar.gz qmk_firmware-a32f7e1a25a8a200d838aa8256ffe39708fbd723.zip | |
Store backlight breathing state in EEPROM (#6105)
* Store backlight breathing state in EEPROM
* Reduce backlight_config.level from 6 bits to 4 (max 15 "on" levels)
* Error out if BACKLIGHT_LEVELS is > 15
* Remove mention of default backlight pin in rules.mk template
* Remove pointless comment
Diffstat (limited to 'quantum/quantum.c')
| -rw-r--r-- | quantum/quantum.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/quantum/quantum.c b/quantum/quantum.c index 31dfa60cd..d98c601d9 100644 --- a/quantum/quantum.c +++ b/quantum/quantum.c | |||
| @@ -708,7 +708,7 @@ bool process_record_quantum(keyrecord_t *record) { | |||
| 708 | #if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_BREATHING) | 708 | #if defined(BACKLIGHT_ENABLE) && defined(BACKLIGHT_BREATHING) |
| 709 | case BL_BRTG: { | 709 | case BL_BRTG: { |
| 710 | if (record->event.pressed) { | 710 | if (record->event.pressed) { |
| 711 | breathing_toggle(); | 711 | backlight_toggle_breathing(); |
| 712 | } | 712 | } |
| 713 | return false; | 713 | return false; |
| 714 | } | 714 | } |
| @@ -1196,6 +1196,12 @@ void backlight_init_ports(void) | |||
| 1196 | setPinOutput(backlight_pin); | 1196 | setPinOutput(backlight_pin); |
| 1197 | backlight_on(backlight_pin); | 1197 | backlight_on(backlight_pin); |
| 1198 | ) | 1198 | ) |
| 1199 | |||
| 1200 | #ifdef BACKLIGHT_BREATHING | ||
| 1201 | if (is_backlight_breathing()) { | ||
| 1202 | breathing_enable(); | ||
| 1203 | } | ||
| 1204 | #endif | ||
| 1199 | } | 1205 | } |
| 1200 | 1206 | ||
| 1201 | __attribute__ ((weak)) | 1207 | __attribute__ ((weak)) |
| @@ -1500,7 +1506,9 @@ void backlight_init_ports(void) | |||
| 1500 | 1506 | ||
| 1501 | backlight_init(); | 1507 | backlight_init(); |
| 1502 | #ifdef BACKLIGHT_BREATHING | 1508 | #ifdef BACKLIGHT_BREATHING |
| 1503 | breathing_enable(); | 1509 | if (is_backlight_breathing()) { |
| 1510 | breathing_enable(); | ||
| 1511 | } | ||
| 1504 | #endif | 1512 | #endif |
| 1505 | } | 1513 | } |
| 1506 | 1514 | ||
