aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPali Rohár2022-09-05 11:31:19 +0200
committerTom Rini2022-09-24 11:34:37 -0400
commit78b5243182be8fa222f6d496e7d49675fde4d09e (patch)
tree126ed9de35861d001877adb0414e272427a61b97 /include
parent016e2be96d4247ceacca05932f2e94d31607cc57 (diff)
serial: Implement serial_flush() function for console flush() fallback
Like in all other console functions, implement also serial_flush() function as a fallback int console flush() function. Flush support is available only when config option CONSOLE_FLUSH_SUPPORT is enabled. So when it is disabled then provides just empty static inline function serial_flush(). Signed-off-by: Pali Rohár <pali@kernel.org> Reviewed-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/serial.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/serial.h b/include/serial.h
index 8c2e7adbc32..fe01bcfadb9 100644
--- a/include/serial.h
+++ b/include/serial.h
@@ -362,6 +362,11 @@ void serial_setbrg(void);
void serial_putc(const char ch);
void serial_putc_raw(const char ch);
void serial_puts(const char *str);
+#if defined(CONFIG_CONSOLE_FLUSH_SUPPORT) && CONFIG_IS_ENABLED(DM_SERIAL)
+void serial_flush(void);
+#else
+static inline void serial_flush(void) {}
+#endif
int serial_getc(void);
int serial_tstc(void);