diff options
author | Keith Short <keithshort@chromium.org> | 2021-03-15 17:25:08 -0600 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-03-16 20:30:10 +0000 |
commit | 9e4de28c912d9e4543e14a55d4cce3c414fa73a5 (patch) | |
tree | a2558da6416f01242608e3a53bd46ed8e422a55a /common/uart_printf.c | |
parent | 82a0bda9e9012be92d19f90df75274feecd985e6 (diff) | |
download | chrome-ec-9e4de28c912d9e4543e14a55d4cce3c414fa73a5.tar.gz |
zephyr: Disable duplicate line endings
The Zephyr UART shell already converts '\n' line endings to '\r\n', and
does not provide an API to override this behavior.
Disable the legacy Chromium EC printf output from also converting '\n'
to '\r\n'.
BUG=b:182839302
BRANCH=none
TEST=firmware_FAFTSetup detects that a Chrome EC is present
Signed-off-by: Keith Short <keithshort@chromium.org>
Change-Id: I0347e35c5237d7deb475aee1780978d719d218a1
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2762531
Commit-Queue: Simon Glass <sjg@chromium.org>
Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'common/uart_printf.c')
-rw-r--r-- | common/uart_printf.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/common/uart_printf.c b/common/uart_printf.c index 80a72065b3..ae6f79bf79 100644 --- a/common/uart_printf.c +++ b/common/uart_printf.c @@ -11,8 +11,12 @@ static int __tx_char(void *context, int c) { - /* Translate '\n' to '\r\n' */ - if (c == '\n' && uart_tx_char_raw(context, '\r')) + /* + * Translate '\n' to '\r\n', bypass on Zephyr because printk also + * does this translation. + */ + if (!IS_ENABLED(CONFIG_ZEPHYR) && c == '\n' && + uart_tx_char_raw(context, '\r')) return 1; return uart_tx_char_raw(context, c); } |