From d37becc0a9203c4c7d52aca6190b4b3d9fb69a59 Mon Sep 17 00:00:00 2001 From: PureSpider Date: Tue, 22 Nov 2016 22:12:57 +0100 Subject: Set backlight status to on if it's at maximum brightness already and the brightness increase keybind is used Before it was turned on but the status wasn't set to on, so you had to push the backlight toggle bind twice to turn it off again --- tmk_core/common/backlight.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tmk_core/common') diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c index c9e8fd3fd2..0e0ad2d154 100644 --- a/tmk_core/common/backlight.c +++ b/tmk_core/common/backlight.c @@ -36,9 +36,9 @@ void backlight_increase(void) if(backlight_config.level < BACKLIGHT_LEVELS) { backlight_config.level++; - backlight_config.enable = 1; - eeconfig_update_backlight(backlight_config.raw); } + backlight_config.enable = 1; + eeconfig_update_backlight(backlight_config.raw); dprintf("backlight increase: %u\n", backlight_config.level); backlight_set(backlight_config.level); } -- cgit v1.2.3 From 5893f0fa1fcecfface25ce570f37e51031a14489 Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Wed, 23 Nov 2016 16:22:57 +1100 Subject: Fixed NO_SUSPEND_POWER_DOWN handling --- tmk_core/common/avr/suspend.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'tmk_core/common') diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 8a7272bbc5..939bda15eb 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -47,6 +47,7 @@ void suspend_idle(uint8_t time) sleep_disable(); } +#ifndef NO_SUSPEND_POWER_DOWN /* Power down MCU with watchdog timer * wdto: watchdog timer timeout defined in * WDTO_15MS @@ -61,6 +62,7 @@ void suspend_idle(uint8_t time) * WDTO_8S */ static uint8_t wdt_timeout = 0; + static void power_down(uint8_t wdto) { #ifdef PROTOCOL_LUFA @@ -98,10 +100,13 @@ static void power_down(uint8_t wdto) // Disable watchdog after sleep wdt_disable(); } +#endif void suspend_power_down(void) { +#ifndef NO_SUSPEND_POWER_DOWN power_down(WDTO_15MS); +#endif } __attribute__ ((weak)) void matrix_power_up(void) {} @@ -109,7 +114,9 @@ __attribute__ ((weak)) void matrix_power_down(void) {} bool suspend_wakeup_condition(void) { #ifdef BACKLIGHT_ENABLE +#ifndef NO_SUSPEND_POWER_DOWN backlight_set(0); +#endif #endif matrix_power_up(); matrix_scan(); @@ -126,7 +133,6 @@ void suspend_wakeup_init(void) // clear keyboard state clear_keyboard(); #ifdef BACKLIGHT_ENABLE - backlight_set(0); backlight_init(); #endif led_set(host_keyboard_leds()); -- cgit v1.2.3 From cf3926a8e13edb76193b8af25b497f9ef61161fd Mon Sep 17 00:00:00 2001 From: Wilba6582 Date: Wed, 23 Nov 2016 19:45:50 +1100 Subject: Fixed NO_SUSPEND_POWER_DOWN handling --- tmk_core/common/avr/suspend.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) (limited to 'tmk_core/common') diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index 939bda15eb..0c81e83612 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -113,11 +113,6 @@ __attribute__ ((weak)) void matrix_power_up(void) {} __attribute__ ((weak)) void matrix_power_down(void) {} bool suspend_wakeup_condition(void) { -#ifdef BACKLIGHT_ENABLE -#ifndef NO_SUSPEND_POWER_DOWN - backlight_set(0); -#endif -#endif matrix_power_up(); matrix_scan(); matrix_power_down(); @@ -135,7 +130,7 @@ void suspend_wakeup_init(void) #ifdef BACKLIGHT_ENABLE backlight_init(); #endif -led_set(host_keyboard_leds()); + led_set(host_keyboard_leds()); } #ifndef NO_SUSPEND_POWER_DOWN -- cgit v1.2.3