File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
examples/system/console/components/cmd_system Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 10
10
#include <stdio.h>
11
11
#include <string.h>
12
12
#include <ctype.h>
13
+ #include <unistd.h>
13
14
#include "esp_log.h"
14
15
#include "esp_console.h"
15
16
#include "esp_system.h"
@@ -295,13 +296,13 @@ static int light_sleep(int argc, char **argv)
295
296
if (io_count > 0 ) {
296
297
ESP_ERROR_CHECK ( esp_sleep_enable_gpio_wakeup () );
297
298
}
298
- if (CONFIG_ESP_CONSOLE_UART_NUM <= UART_NUM_1 ) {
299
+ if (CONFIG_ESP_CONSOLE_UART_NUM >= 0 && CONFIG_ESP_CONSOLE_UART_NUM <= UART_NUM_1 ) {
299
300
ESP_LOGI (TAG , "Enabling UART wakeup (press ENTER to exit light sleep)" );
300
301
ESP_ERROR_CHECK ( uart_set_wakeup_threshold (CONFIG_ESP_CONSOLE_UART_NUM , 3 ) );
301
302
ESP_ERROR_CHECK ( esp_sleep_enable_uart_wakeup (CONFIG_ESP_CONSOLE_UART_NUM ) );
302
303
}
303
304
fflush (stdout );
304
- uart_wait_tx_idle_polling ( CONFIG_ESP_CONSOLE_UART_NUM );
305
+ fsync ( fileno ( stdout ) );
305
306
esp_light_sleep_start ();
306
307
esp_sleep_wakeup_cause_t cause = esp_sleep_get_wakeup_cause ();
307
308
const char * cause_str ;
You can’t perform that action at this time.
0 commit comments