diff --git a/cpu/efm32/include/periph_cpu.h b/cpu/efm32/include/periph_cpu.h index f131e67fe7..1fd63fd20c 100644 --- a/cpu/efm32/include/periph_cpu.h +++ b/cpu/efm32/include/periph_cpu.h @@ -371,10 +371,15 @@ typedef struct { IRQn_Type irq; /**< the devices base IRQ channel */ } uart_conf_t; +/** + * @brief CPU provides own pm_off() function + */ +#define PROVIDES_PM_LAYERED_OFF + /** * @brief Number of usable power modes. */ -#define PM_NUM_MODES (3U) +#define PM_NUM_MODES (2U) #ifdef __cplusplus } diff --git a/cpu/efm32/periph/pm.c b/cpu/efm32/periph/pm.c index f88c3ffd97..4a9aaef707 100644 --- a/cpu/efm32/periph/pm.c +++ b/cpu/efm32/periph/pm.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2017 Bas Stottelaar + * Copyright (C) 2017-2018 Bas Stottelaar * * This file is subject to the terms and conditions of the GNU Lesser * General Public License v2.1. See the file LICENSE in the top level @@ -33,9 +33,13 @@ void pm_set(unsigned mode) /* after exiting EM2, clocks are restored */ EMU_EnterEM2(true); break; - case 2: + default: /* wait for next event or interrupt */ EMU_EnterEM1(); - break; } } + +void pm_off(void) +{ + EMU_EnterEM4(); +}