cc2538: pwm: Automatically disable PM1+ if running

The peripheral core clocks of the PWM timers are gated in PM1+, so these
power modes must be disabled if a PWM timer is running. Use
lpm_register_peripheral() to handle this automatically and dynamically.

Signed-off-by: Benoît Thébaudeau <benoit.thebaudeau.dev@gmail.com>
This commit is contained in:
Benoît Thébaudeau 2015-12-13 02:33:31 +01:00
parent 9c6d9a7fe0
commit 4a6e19ed38
4 changed files with 20 additions and 7 deletions

View file

@ -101,7 +101,7 @@ static uint8_t max_pm;
#ifdef LPM_CONF_PERIPH_PERMIT_PM1_FUNCS_MAX
#define LPM_PERIPH_PERMIT_PM1_FUNCS_MAX LPM_CONF_PERIPH_PERMIT_PM1_FUNCS_MAX
#else
#define LPM_PERIPH_PERMIT_PM1_FUNCS_MAX 4
#define LPM_PERIPH_PERMIT_PM1_FUNCS_MAX 5
#endif
static lpm_periph_permit_pm1_func_t