diff --git a/cpu/saml21/periph/pm.c b/cpu/saml21/periph/pm.c index 4d390a8d23..107c520f1a 100644 --- a/cpu/saml21/periph/pm.c +++ b/cpu/saml21/periph/pm.c @@ -26,16 +26,19 @@ void pm_set(unsigned mode) { + int deep = 0; uint32_t _mode; switch (mode) { case 0: DEBUG_PUTS("pm_set(): setting BACKUP mode."); _mode = PM_SLEEPCFG_SLEEPMODE_BACKUP; + deep = 1; break; case 1: DEBUG_PUTS("pm_set(): setting STANDBY mode."); _mode = PM_SLEEPCFG_SLEEPMODE_STANDBY; + deep = 1; break; default: /* Falls through */ case 2: @@ -53,5 +56,5 @@ void pm_set(unsigned mode) /* make sure value has been set */ while (PM->SLEEPCFG.bit.SLEEPMODE != _mode) {} - sam0_cortexm_sleep(0); + sam0_cortexm_sleep(deep); }