mirror of
https://github.com/arduino-libraries/ArduinoLowPower.git
synced 2025-04-19 11:42:14 +03:00
Fix SysTick timer lockup when waking from sleep (#17)
* fix SysTick timer lockup when waking from sleep
This commit is contained in:
parent
4caff779d9
commit
892594adbc
@ -23,9 +23,13 @@ void ArduinoLowPowerClass::sleep() {
|
||||
USBDevice.detach();
|
||||
restoreUSBDevice = true;
|
||||
}
|
||||
// Disable systick interrupt: See https://www.avrfreaks.net/forum/samd21-samd21e16b-sporadically-locks-and-does-not-wake-standby-sleep-mode
|
||||
SysTick->CTRL &= ~SysTick_CTRL_TICKINT_Msk;
|
||||
SCB->SCR |= SCB_SCR_SLEEPDEEP_Msk;
|
||||
__DSB();
|
||||
__WFI();
|
||||
// Enable systick interrupt
|
||||
SysTick->CTRL |= SysTick_CTRL_TICKINT_Msk;
|
||||
if (restoreUSBDevice) {
|
||||
USBDevice.attach();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user