This is an automated email from the ASF dual-hosted git repository.
wes3 pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/mynewt-core.git
The following commit(s) were added to refs/heads/master by this push:
new 34aecc7f3 Be consistent in console write order for '\n' and '\r'
34aecc7f3 is described below
commit 34aecc7f3ecd11cbf7677fdbffb263700641259e
Author: Karthik Bharadwaj <[email protected]>
AuthorDate: Thu May 25 10:08:41 2023 -0700
Be consistent in console write order for '\n' and '\r'
In the current implementation of the UART and CDC consoles, there
can be a discrepency in the order of the Linefeed and Carriage
Return print order. For consistency, we change this to always be
"\r\n" for both variants of the implementation. This is useful
in automated echo tests for verifying payloads.
---
hw/usb/tinyusb/cdc_console/src/cdc_console.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/hw/usb/tinyusb/cdc_console/src/cdc_console.c
b/hw/usb/tinyusb/cdc_console/src/cdc_console.c
index e91a3cea0..00d81a05f 100755
--- a/hw/usb/tinyusb/cdc_console/src/cdc_console.c
+++ b/hw/usb/tinyusb/cdc_console/src/cdc_console.c
@@ -58,11 +58,10 @@ cdc_write(int c)
int
console_out_nolock(int c)
{
- cdc_write(c);
-
if ('\n' == c) {
cdc_write('\r');
}
+ cdc_write(c);
cdc_schedule_tx_flush();