summaryrefslogtreecommitdiffstats
path: root/tmk_core/common
diff options
context:
space:
mode:
authorJoshua Diamond <josh@windowoffire.com>2021-02-01 19:12:41 -0500
committerGitHub <noreply@github.com>2021-02-02 11:12:41 +1100
commit9a4618b05b9f1093908c2153c719c5eb5d4a79ee (patch)
tree7487e6226c72d2c3d09749d60ce8df18a2c40d59 /tmk_core/common
parent85079d6a2ecfd55d0d33ce32cd1ad137f1c1df55 (diff)
Address wake from sleep instability (#11450)
* resolve race condition between suspend and wake in LUFA * avoid multiple calls to suspend_power_down() / suspend_wakeup_init() * Remove duplicate suspend_power_down_kb() call * pause on wakeup to wait for USB state to settle * need the repeated suspend_power_down() (that's where the sleep is) * more efficient implementation * fine tune the pause after sending wakeup * speculative chibios version of pause-after-wake * make wakeup delay configurable, and adjust value * better location for wakeup delay
Diffstat (limited to 'tmk_core/common')
-rw-r--r--tmk_core/common/avr/suspend.c1
-rw-r--r--tmk_core/common/suspend.h4
2 files changed, 4 insertions, 1 deletions
diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c
index 9db0e0064a..b784a0835d 100644
--- a/tmk_core/common/avr/suspend.c
+++ b/tmk_core/common/avr/suspend.c
@@ -102,7 +102,6 @@ static void power_down(uint8_t wdto) {
# if defined(RGBLIGHT_SLEEP) && defined(RGBLIGHT_ENABLE)
rgblight_suspend();
# endif
- suspend_power_down_kb();
// TODO: more power saving
// See PicoPower application note
diff --git a/tmk_core/common/suspend.h b/tmk_core/common/suspend.h
index 766df95aa1..9d17d984ed 100644
--- a/tmk_core/common/suspend.h
+++ b/tmk_core/common/suspend.h
@@ -12,3 +12,7 @@ void suspend_wakeup_init_user(void);
void suspend_wakeup_init_kb(void);
void suspend_power_down_user(void);
void suspend_power_down_kb(void);
+
+#ifndef USB_SUSPEND_WAKEUP_DELAY
+# define USB_SUSPEND_WAKEUP_DELAY 200
+#endif