Skip to content

Commit 7171031

Browse files
mmahadevan108adbridge
authored andcommitted
MCUXpresso: Change the MXRT deep sleep implementation
The code checks if any of the UART's is still transmitting. If so then prevent from entering deepsleep Signed-off-by: Mahesh Mahadevan <[email protected]>
1 parent 0206f48 commit 7171031

File tree

1 file changed

+6
-5
lines changed
  • targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX

1 file changed

+6
-5
lines changed

targets/TARGET_NXP/TARGET_MCUXpresso_MCUS/TARGET_IMX/sleep.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@
1919

2020
extern void vPortPRE_SLEEP_PROCESSING(clock_mode_t powermode);
2121
extern void vPortPOST_SLEEP_PROCESSING(clock_mode_t powermode);
22-
extern void serial_wait_tx_complete(uint32_t uart_index);
23-
22+
extern bool serial_check_tx_ongoing();
2423

2524
void hal_sleep(void)
2625
{
@@ -35,10 +34,12 @@ void hal_sleep(void)
3534

3635
void hal_deepsleep(void)
3736
{
38-
vPortPRE_SLEEP_PROCESSING(kCLOCK_ModeStop);
37+
/* Check if any of the UART's is transmitting data */
38+
if (serial_check_tx_ongoing()) {
39+
return;
40+
}
3941

40-
/* Wait till debug UART is done transmitting */
41-
serial_wait_tx_complete(STDIO_UART);
42+
vPortPRE_SLEEP_PROCESSING(kCLOCK_ModeStop);
4243

4344
__DSB();
4445
__WFI();

0 commit comments

Comments
 (0)