mirror of https://github.com/ARMmbed/mbed-os.git
mbed kinetis low power modes
mbed kinetis low power modes mbed kinetis low power modespull/4315/head
parent
265c04697f
commit
2a665882e9
|
@ -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();
|
||||
|
|
Loading…
Reference in New Issue