mbed kinetis low power modes

mbed kinetis low power modes

mbed kinetis low power modes
pull/4315/head
Matthias L. Jugel 2017-04-01 12:08:24 +02:00 committed by Jimmy Brisson
parent 265c04697f
commit 2a665882e9
1 changed files with 6 additions and 9 deletions

View File

@ -19,22 +19,19 @@
#include "fsl_pmc.h"
#include "fsl_clock_config.h"
rcm_reset_source_t wakeupSource;
//!< this contains the wakeup source
rcm_reset_source_t kinetisResetSource;
// called before main
void mbed_sdk_init() {
SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll);
// check the power mode source
SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll);
wakeupSource = (rcm_reset_source_t) (RCM_GetPreviousResetSources(RCM));
if (wakeupSource & kRCM_SourceWakeup) /* Wakeup from VLLS. */
{
kinetisResetSource = (rcm_reset_source_t) (RCM_GetPreviousResetSources(RCM));
// if waking up from VLLS, do some cleanup
if (kinetisResetSource & kRCM_SourceWakeup) {
PMC_ClearPeriphIOIsolationFlag(PMC);
NVIC_ClearPendingIRQ(LLWU_IRQn);
// /* Wait for PLL lock. */
// while (!(kMCG_Pll0LockFlag & CLOCK_GetStatusFlags())) {}
// CLOCK_SetPeeMode();
}
BOARD_BootClockRUN();