summaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorKeith Short <keithshort@chromium.org>2021-11-12 10:45:57 -0700
committerCommit Bot <commit-bot@chromium.org>2021-11-17 17:48:23 +0000
commit82b5f48862b5d40752cd664890bb7a6e69ab2237 (patch)
treef5bb5b24173721dae4d86d1c70ce13c259244480 /common
parenteacad86212f022cebd52bf68710fc6d2c5ca0680 (diff)
downloadchrome-ec-82b5f48862b5d40752cd664890bb7a6e69ab2237.tar.gz
zephyr: use uart_poll_out() instead of printk
For raw character output, use uart_poll_out() instead of printk(). printk() replaces newline characters with carriage-return and newline, corrupting EFS2 packets. BUG=b:206030442 BRANCH=none TEST=Verify cr50 does not report 0xec03 error (bad CRC) if the current EC RW hash contains 0x0A. Signed-off-by: Keith Short <keithshort@chromium.org> Change-Id: Iecfdff63848a40aaeb5fcba82587320790d73d37 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3279841 Reviewed-by: Abe Levkoy <alevkoy@chromium.org>
Diffstat (limited to 'common')
-rw-r--r--common/uart_printf.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/common/uart_printf.c b/common/uart_printf.c
index ae6f79bf79..198d076971 100644
--- a/common/uart_printf.c
+++ b/common/uart_printf.c
@@ -12,11 +12,9 @@
static int __tx_char(void *context, int c)
{
/*
- * Translate '\n' to '\r\n', bypass on Zephyr because printk also
- * does this translation.
+ * Translate '\n' to '\r\n'.
*/
- if (!IS_ENABLED(CONFIG_ZEPHYR) && c == '\n' &&
- uart_tx_char_raw(context, '\r'))
+ if (c == '\n' && uart_tx_char_raw(context, '\r'))
return 1;
return uart_tx_char_raw(context, c);
}