From 0aaf72a2b9bef2fb035f03dfa14fdbd6ef01fbfb Mon Sep 17 00:00:00 2001 From: Joshua Diamond Date: Mon, 1 Feb 2021 19:12:41 -0500 Subject: 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 --- tmk_core/common/suspend.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tmk_core/common/suspend.h') 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 -- cgit v1.2.3