cpu: efm32: correct power modes

This commit is contained in:
Bas Stottelaar 2018-04-04 21:29:20 +02:00
parent baf1b8f6e9
commit 41347328ce
2 changed files with 13 additions and 4 deletions

View File

@ -371,10 +371,15 @@ typedef struct {
IRQn_Type irq; /**< the devices base IRQ channel */ IRQn_Type irq; /**< the devices base IRQ channel */
} uart_conf_t; } uart_conf_t;
/**
* @brief CPU provides own pm_off() function
*/
#define PROVIDES_PM_LAYERED_OFF
/** /**
* @brief Number of usable power modes. * @brief Number of usable power modes.
*/ */
#define PM_NUM_MODES (3U) #define PM_NUM_MODES (2U)
#ifdef __cplusplus #ifdef __cplusplus
} }

View File

@ -1,5 +1,5 @@
/* /*
* Copyright (C) 2017 Bas Stottelaar <basstottelaar@gmail.com> * Copyright (C) 2017-2018 Bas Stottelaar <basstottelaar@gmail.com>
* *
* This file is subject to the terms and conditions of the GNU Lesser * 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 * 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 */ /* after exiting EM2, clocks are restored */
EMU_EnterEM2(true); EMU_EnterEM2(true);
break; break;
case 2: default:
/* wait for next event or interrupt */ /* wait for next event or interrupt */
EMU_EnterEM1(); EMU_EnterEM1();
break;
} }
} }
void pm_off(void)
{
EMU_EnterEM4();
}