Skip to content

Commit 9a1e749

Browse files
committed
LPC546XX: Fix deepsleep implementation
Add a check to return to 220MHz on LPC54628 Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 7201117 commit 9a1e749

File tree

3 files changed

+8
-6
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS

3 files changed

+8
-6
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC/sleep.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ void hal_sleep(void)
2626

2727
void hal_deepsleep(void)
2828
{
29-
LPC_CLOCK_INTERNAL_IRC();
29+
LPC_CLOCK_INTERNAL_IRC;
3030
/* Enter Deep Sleep mode */
3131
POWER_EnterDeepSleep(APP_EXCLUDE_FROM_DEEPSLEEP);
32-
LPC_CLOCK_RUN();
32+
LPC_CLOCK_RUN;
3333
}

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC546XX/TARGET_FF_LPC546XX/device.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
SYSCON_PDRUNCFG_PDEN_SRAM0_MASK | SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK)
2626

2727
/* Defines used by the sleep code */
28-
#define LPC_CLOCK_INTERNAL_IRC BOARD_BootClockFRO12M
29-
#define LPC_CLOCK_RUN BOARD_BootClockFROHF48M
28+
#define LPC_CLOCK_INTERNAL_IRC BOARD_BootClockFRO12M()
29+
#define LPC_CLOCK_RUN ((SYSCON->DEVICE_ID0 == 0xFFF54628) ? \
30+
BOARD_BootClockPLL220M() : BOARD_BootClockFROHF48M())
3031

3132
#define DEVICE_ID_LENGTH 24
3233

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_LPC546XX/TARGET_LPCXpresso/device.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,9 @@
2525
SYSCON_PDRUNCFG_PDEN_SRAM0_MASK | SYSCON_PDRUNCFG_PDEN_SRAM1_2_3_MASK)
2626

2727
/* Defines used by the sleep code */
28-
#define LPC_CLOCK_INTERNAL_IRC BOARD_BootClockFRO12M
29-
#define LPC_CLOCK_RUN BOARD_BootClockFROHF48M
28+
#define LPC_CLOCK_INTERNAL_IRC BOARD_BootClockFRO12M()
29+
#define LPC_CLOCK_RUN ((SYSCON->DEVICE_ID0 == 0xFFF54628) ? \
30+
BOARD_BootClockPLL220M() : BOARD_BootClockFROHF48M())
3031

3132
#define DEVICE_ID_LENGTH 24
3233

0 commit comments

Comments
 (0)