kopia lustrzana https://github.com/espressif/esp-idf
Merge branch 'bugfix/console_allow_buffered' into 'master'
console example: use buffered stdout by default See merge request idf/esp-idf!4476pull/3137/head
commit
ce6b73ca5f
|
@ -106,6 +106,7 @@
|
|||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <stdio_ext.h>
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
|
@ -879,6 +880,9 @@ static int linenoiseEdit(char *buf, size_t buflen, const char *prompt)
|
|||
linenoiseEditDeletePrevWord(&l);
|
||||
break;
|
||||
}
|
||||
if (__fbufsize(stdout) > 0) {
|
||||
fflush(stdout);
|
||||
}
|
||||
}
|
||||
return l.len;
|
||||
}
|
||||
|
|
|
@ -56,9 +56,8 @@ static void initialize_nvs()
|
|||
|
||||
static void initialize_console()
|
||||
{
|
||||
/* Disable buffering on stdin and stdout */
|
||||
/* Disable buffering on stdin */
|
||||
setvbuf(stdin, NULL, _IONBF, 0);
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||
|
|
|
@ -56,9 +56,8 @@ static void initialize_nvs()
|
|||
|
||||
static void initialize_console()
|
||||
{
|
||||
/* Disable buffering on stdin and stdout */
|
||||
/* Disable buffering on stdin */
|
||||
setvbuf(stdin, NULL, _IONBF, 0);
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||
|
|
|
@ -59,9 +59,8 @@ static void initialize_nvs()
|
|||
|
||||
static void initialize_console()
|
||||
{
|
||||
/* Disable buffering on stdin and stdout */
|
||||
/* Disable buffering on stdin */
|
||||
setvbuf(stdin, NULL, _IONBF, 0);
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||
|
|
|
@ -28,9 +28,8 @@
|
|||
|
||||
static void initialize_console()
|
||||
{
|
||||
/* Disable buffering on stdin and stdout */
|
||||
/* Disable buffering on stdin */
|
||||
setvbuf(stdin, NULL, _IONBF, 0);
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||
|
|
|
@ -75,9 +75,8 @@ static void initialize_wifi()
|
|||
/* Initialize console component */
|
||||
static void initialize_console()
|
||||
{
|
||||
/* Disable buffering on stdin and stdout */
|
||||
/* Disable buffering on stdin */
|
||||
setvbuf(stdin, NULL, _IONBF, 0);
|
||||
setvbuf(stdout, NULL, _IONBF, 0);
|
||||
|
||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||
|
|
Ładowanie…
Reference in New Issue