summaryrefslogtreecommitdiff
path: root/zephyr/shim/src/console.c
diff options
context:
space:
mode:
Diffstat (limited to 'zephyr/shim/src/console.c')
-rw-r--r--zephyr/shim/src/console.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/zephyr/shim/src/console.c b/zephyr/shim/src/console.c
index ae3ae51deb..39176a45e0 100644
--- a/zephyr/shim/src/console.c
+++ b/zephyr/shim/src/console.c
@@ -274,7 +274,15 @@ static void zephyr_print(const char *buff, size_t size)
if (k_is_in_isr() || shell_zephyr->ctx->state != SHELL_STATE_ACTIVE)
printk("%s", buff);
else {
- shell_fprintf(shell_zephyr, SHELL_NORMAL, "%s", buff);
+ /*
+ * On some platforms, shell_* functions are not as fast
+ * as printk and they need the added speed to avoid
+ * timeouts.
+ */
+ if (IS_ENABLED(CONFIG_PLATFORM_EC_CONSOLE_USES_PRINTK))
+ printk("%s", buff);
+ else
+ shell_fprintf(shell_zephyr, SHELL_NORMAL, "%s", buff);
if (IS_ENABLED(CONFIG_PLATFORM_EC_HOSTCMD_CONSOLE))
console_buf_notify_chars(buff, size);
}