Skip to content

Commit 40b571a

Browse files
committed
More UART glitch improvements
1 parent aad1e12 commit 40b571a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

app/pm/pmSleep.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,11 @@ static void null_mode_check_timer_cb(void* arg){
5151
(READ_PERI_REG(UART_STATUS(1)) & (UART_TXFIFO_CNT<<UART_TXFIFO_CNT_S)) == 0){
5252
ets_timer_disarm(&null_mode_check_timer);
5353
suspend_all_timers();
54+
//Ensure UART 0/1 TX FIFO is clear
55+
SET_PERI_REG_MASK(UART_CONF0(0), UART_TXFIFO_RST);//RESET FIFO
56+
CLEAR_PERI_REG_MASK(UART_CONF0(0), UART_TXFIFO_RST);
57+
SET_PERI_REG_MASK(UART_CONF0(1), UART_TXFIFO_RST);//RESET FIFO
58+
CLEAR_PERI_REG_MASK(UART_CONF0(1), UART_TXFIFO_RST);
5459
wifi_fpm_do_sleep(current_config.sleep_duration);
5560
return;
5661
}

0 commit comments

Comments
 (0)