examples: don't enable buffering on stdout in console examples
newlib uses significantly more stack space when printing to an unbuffered stream. To reduce the amount of stack space required to use the console, don’t disable buffering. linenoise should support unbuffered stdout instead.
This commit is contained in:
parent
fa57fb3c1c
commit
945bd36884
5 changed files with 5 additions and 10 deletions
|
@ -56,9 +56,8 @@ static void initialize_nvs()
|
||||||
|
|
||||||
static void initialize_console()
|
static void initialize_console()
|
||||||
{
|
{
|
||||||
/* Disable buffering on stdin and stdout */
|
/* Disable buffering on stdin */
|
||||||
setvbuf(stdin, NULL, _IONBF, 0);
|
setvbuf(stdin, NULL, _IONBF, 0);
|
||||||
setvbuf(stdout, NULL, _IONBF, 0);
|
|
||||||
|
|
||||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||||
|
|
|
@ -56,9 +56,8 @@ static void initialize_nvs()
|
||||||
|
|
||||||
static void initialize_console()
|
static void initialize_console()
|
||||||
{
|
{
|
||||||
/* Disable buffering on stdin and stdout */
|
/* Disable buffering on stdin */
|
||||||
setvbuf(stdin, NULL, _IONBF, 0);
|
setvbuf(stdin, NULL, _IONBF, 0);
|
||||||
setvbuf(stdout, NULL, _IONBF, 0);
|
|
||||||
|
|
||||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||||
|
|
|
@ -59,9 +59,8 @@ static void initialize_nvs()
|
||||||
|
|
||||||
static void initialize_console()
|
static void initialize_console()
|
||||||
{
|
{
|
||||||
/* Disable buffering on stdin and stdout */
|
/* Disable buffering on stdin */
|
||||||
setvbuf(stdin, NULL, _IONBF, 0);
|
setvbuf(stdin, NULL, _IONBF, 0);
|
||||||
setvbuf(stdout, NULL, _IONBF, 0);
|
|
||||||
|
|
||||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||||
|
|
|
@ -28,9 +28,8 @@
|
||||||
|
|
||||||
static void initialize_console()
|
static void initialize_console()
|
||||||
{
|
{
|
||||||
/* Disable buffering on stdin and stdout */
|
/* Disable buffering on stdin */
|
||||||
setvbuf(stdin, NULL, _IONBF, 0);
|
setvbuf(stdin, NULL, _IONBF, 0);
|
||||||
setvbuf(stdout, NULL, _IONBF, 0);
|
|
||||||
|
|
||||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||||
|
|
|
@ -75,9 +75,8 @@ static void initialize_wifi()
|
||||||
/* Initialize console component */
|
/* Initialize console component */
|
||||||
static void initialize_console()
|
static void initialize_console()
|
||||||
{
|
{
|
||||||
/* Disable buffering on stdin and stdout */
|
/* Disable buffering on stdin */
|
||||||
setvbuf(stdin, NULL, _IONBF, 0);
|
setvbuf(stdin, NULL, _IONBF, 0);
|
||||||
setvbuf(stdout, NULL, _IONBF, 0);
|
|
||||||
|
|
||||||
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
/* Minicom, screen, idf_monitor send CR when ENTER key is pressed */
|
||||||
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
esp_vfs_dev_uart_set_rx_line_endings(ESP_LINE_ENDINGS_CR);
|
||||||
|
|
Loading…
Reference in a new issue