Skip to content

Commit 2a66588

Browse files
thinkbergtheotherjimmy
authored andcommitted
mbed kinetis low power modes
mbed kinetis low power modes mbed kinetis low power modes
1 parent 265c046 commit 2a66588

File tree

1 file changed

+6
-9
lines changed
  • targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/TARGET_UBRIDGE

1 file changed

+6
-9
lines changed

targets/TARGET_Freescale/TARGET_MCUXpresso_MCUS/TARGET_K82F/TARGET_UBRIDGE/mbed_overrides.c

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,22 +19,19 @@
1919
#include "fsl_pmc.h"
2020
#include "fsl_clock_config.h"
2121

22-
rcm_reset_source_t wakeupSource;
22+
//!< this contains the wakeup source
23+
rcm_reset_source_t kinetisResetSource;
2324

2425
// called before main
2526
void mbed_sdk_init() {
27+
SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll);
2628

2729
// check the power mode source
28-
SMC_SetPowerModeProtection(SMC, kSMC_AllowPowerModeAll);
29-
wakeupSource = (rcm_reset_source_t) (RCM_GetPreviousResetSources(RCM));
30-
if (wakeupSource & kRCM_SourceWakeup) /* Wakeup from VLLS. */
31-
{
30+
kinetisResetSource = (rcm_reset_source_t) (RCM_GetPreviousResetSources(RCM));
31+
// if waking up from VLLS, do some cleanup
32+
if (kinetisResetSource & kRCM_SourceWakeup) {
3233
PMC_ClearPeriphIOIsolationFlag(PMC);
3334
NVIC_ClearPendingIRQ(LLWU_IRQn);
34-
35-
// /* Wait for PLL lock. */
36-
// while (!(kMCG_Pll0LockFlag & CLOCK_GetStatusFlags())) {}
37-
// CLOCK_SetPeeMode();
3835
}
3936

4037
BOARD_BootClockRUN();

0 commit comments

Comments
 (0)