1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

cpu/saml21/pm: specify power mode names

This commit is contained in:
Jue 2022-10-28 18:19:39 +02:00
parent d704a1a805
commit d0c11e568a
2 changed files with 7 additions and 4 deletions

View File

@ -35,7 +35,10 @@ extern "C" {
* @name Power mode configuration
* @{
*/
#define PM_NUM_MODES (3)
#define PM_NUM_MODES (3)
#define SAML21_PM_MODE_BACKUP (0) /**< Wakeup by some IRQs possible, but no RAM retention */
#define SAML21_PM_MODE_STANDBY (1) /**< Just peripherals clocked by 32K OSC are active */
#define SAML21_PM_MODE_IDLE (2) /**< CPU sleeping, peripherals are active */
/** @} */
/**

View File

@ -30,18 +30,18 @@ void pm_set(unsigned mode)
uint32_t _mode;
switch (mode) {
case 0:
case SAML21_PM_MODE_BACKUP:
DEBUG_PUTS("pm_set(): setting BACKUP mode.");
_mode = PM_SLEEPCFG_SLEEPMODE_BACKUP;
deep = 1;
break;
case 1:
case SAML21_PM_MODE_STANDBY:
DEBUG_PUTS("pm_set(): setting STANDBY mode.");
_mode = PM_SLEEPCFG_SLEEPMODE_STANDBY;
deep = 1;
break;
default: /* Falls through */
case 2:
case SAML21_PM_MODE_IDLE:
DEBUG_PUTS("pm_set(): setting IDLE mode.");
#if !defined(PM_SLEEPCFG_SLEEPMODE_IDLE2)
_mode = PM_SLEEPCFG_SLEEPMODE_IDLE;