Skip to content

Commit 190b27a

Browse files
author
Jamie Smith
authored
MIMXRT1060_EVK: Disable deep sleep by default (#420)
1 parent ceee63f commit 190b27a

File tree

4 files changed

+18
-5
lines changed

4 files changed

+18
-5
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/CMakeLists.txt

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,6 @@ target_sources(mbed-mimxrt105x
3131
clock_config.c
3232
PeripheralPins.c
3333
pinmap.c
34-
mimxrt_clock_adjustment.c
35-
lpm.c
3634
mbed_overrides.c
3735

3836
device/system_MIMXRT1052.c
@@ -106,6 +104,14 @@ target_sources(mbed-mimxrt105x
106104
${STARTUP_FILE}
107105
)
108106

107+
# Add extra sources used for deep sleep mode
108+
if("DEVICE_LPTICKER=1" IN_LIST MBED_TARGET_DEFINITIONS)
109+
target_sources(mbed-mimxrt105x
110+
INTERFACE
111+
mimxrt_clock_adjustment.c
112+
lpm.c)
113+
endif()
114+
109115
target_link_libraries(mbed-mimxrt105x
110116
INTERFACE
111117
mbed-mcuxpresso-mcus

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/mbed_overrides.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,9 @@ void mbed_sdk_init()
206206
BOARD_Init_PMIC_STBY_REQ();
207207
#endif
208208

209+
#if DEVICE_LPTICKER
209210
LPM_Init();
211+
#endif
210212
}
211213

212214
void spi_setup_clock()

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_MIMXRT105x/sleep.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ void hal_sleep(void)
3333
__ISB();
3434
}
3535

36+
#if DEVICE_LPTICKER
3637
void hal_deepsleep(void)
3738
{
3839
/* Check if any of the UART's is transmitting data */
@@ -48,4 +49,9 @@ void hal_deepsleep(void)
4849

4950
vPortPOST_SLEEP_PROCESSING(kCLOCK_ModeStop);
5051
}
51-
52+
#else
53+
void hal_deepsleep(void)
54+
{
55+
hal_sleep();
56+
}
57+
#endif

targets/targets.json5

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5226,8 +5226,7 @@
52265226
"SPISLAVE",
52275227
"TRNG",
52285228
"WATCHDOG",
5229-
"USBDEVICE",
5230-
"LPTICKER"
5229+
"USBDEVICE"
52315230
],
52325231
"overrides": {
52335232
"deep-sleep-latency": 10

0 commit comments

Comments
 (0)