Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Nodemcu Firmware
Commits
918f7531
Commit
918f7531
authored
May 20, 2024
by
Jade Mattsson
Committed by
Jade Mattsson
May 21, 2024
Browse files
Actually honour Kconfig line-endings settings.
parent
3b9ef17d
Changes
1
Hide whitespace changes
Inline
Side-by-side
components/base_nodemcu/user_main.c
View file @
918f7531
...
@@ -36,6 +36,24 @@
...
@@ -36,6 +36,24 @@
#define SIG_LUA 0
#define SIG_LUA 0
#define SIG_UARTINPUT 1
#define SIG_UARTINPUT 1
// Line ending config from Kconfig
#if CONFIG_NEWLIB_STDIN_LINE_ENDING_CRLF
# define RX_LINE_ENDINGS_CFG ESP_LINE_ENDINGS_CRLF
#elif CONFIG_NEWLIB_STDIN_LINE_ENDING_CR
# define RX_LINE_ENDINGS_CFG ESP_LINE_ENDINGS_CR
#else
# define RX_LINE_ENDINGS_CFG ESP_LINE_ENDINGS_LF
#endif
#if CONFIG_NEWLIB_STDOUT_LINE_ENDING_CRLF
# define TX_LINE_ENDINGS_CFG ESP_LINE_ENDINGS_CRLF
#elif CONFIG_NEWLIB_STDOUT_LINE_ENDING_CR
# define TX_LINE_ENDINGS_CFG ESP_LINE_ENDINGS_CR
#else
# define TX_LINE_ENDINGS_CFG ESP_LINE_ENDINGS_LF
#endif
// We don't get argument size data from the esp_event dispatch, so it's
// We don't get argument size data from the esp_event dispatch, so it's
// not possible to copy and forward events from the default event queue
// not possible to copy and forward events from the default event queue
// to one running within our task context. To cope with this, we instead
// to one running within our task context. To cope with this, we instead
...
@@ -214,9 +232,9 @@ static void console_init(void)
...
@@ -214,9 +232,9 @@ static void console_init(void)
/* Based on console/advanced example */
/* Based on console/advanced example */
esp_vfs_dev_uart_port_set_rx_line_endings
(
esp_vfs_dev_uart_port_set_rx_line_endings
(
CONFIG_ESP_CONSOLE_UART_NUM
,
ESP
_LINE_ENDINGS_C
R
);
CONFIG_ESP_CONSOLE_UART_NUM
,
RX
_LINE_ENDINGS_C
FG
);
esp_vfs_dev_uart_port_set_tx_line_endings
(
esp_vfs_dev_uart_port_set_tx_line_endings
(
CONFIG_ESP_CONSOLE_UART_NUM
,
ESP
_LINE_ENDINGS_C
RL
F
);
CONFIG_ESP_CONSOLE_UART_NUM
,
TX
_LINE_ENDINGS_CF
G
);
/* Configure UART. Note that REF_TICK is used so that the baud rate remains
/* Configure UART. Note that REF_TICK is used so that the baud rate remains
* correct while APB frequency is changing in light sleep mode.
* correct while APB frequency is changing in light sleep mode.
...
@@ -242,8 +260,8 @@ static void console_init(void)
...
@@ -242,8 +260,8 @@ static void console_init(void)
#elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
#elif CONFIG_ESP_CONSOLE_USB_SERIAL_JTAG
/* Based on @pjsg's work */
/* Based on @pjsg's work */
esp_vfs_dev_usb_serial_jtag_set_rx_line_endings
(
ESP
_LINE_ENDINGS_C
R
);
esp_vfs_dev_usb_serial_jtag_set_rx_line_endings
(
RX
_LINE_ENDINGS_C
FG
);
esp_vfs_dev_usb_serial_jtag_set_tx_line_endings
(
ESP
_LINE_ENDINGS_C
RL
F
);
esp_vfs_dev_usb_serial_jtag_set_tx_line_endings
(
TX
_LINE_ENDINGS_CF
G
);
usb_serial_jtag_driver_config_t
usb_serial_jtag_config
=
usb_serial_jtag_driver_config_t
usb_serial_jtag_config
=
USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT
();
USB_SERIAL_JTAG_DRIVER_CONFIG_DEFAULT
();
...
@@ -254,8 +272,8 @@ static void console_init(void)
...
@@ -254,8 +272,8 @@ static void console_init(void)
#elif CONFIG_ESP_CONSOLE_USB_CDC
#elif CONFIG_ESP_CONSOLE_USB_CDC
/* Based on console/advanced_usb_cdc */
/* Based on console/advanced_usb_cdc */
esp_vfs_dev_cdcacm_set_rx_line_endings
(
ESP
_LINE_ENDINGS_C
R
);
esp_vfs_dev_cdcacm_set_rx_line_endings
(
RX
_LINE_ENDINGS_C
FG
);
esp_vfs_dev_cdcacm_set_tx_line_endings
(
ESP
_LINE_ENDINGS_C
RL
F
);
esp_vfs_dev_cdcacm_set_tx_line_endings
(
TX
_LINE_ENDINGS_CF
G
);
#else
#else
# error "Unsupported console type"
# error "Unsupported console type"
#endif
#endif
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment