common: console: introduce console_record_isempty helper
Add console_record_isempty to check if console record buffer
contains any data.
Signed-off-by: Ion Agorria <ion@agorria.com>
Signed-off-by: Svyatoslav Ryhel <clamor95@gmail.com>
Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/20240105072212.6615-4-clamor95@gmail.com
Signed-off-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
diff --git a/include/console.h b/include/console.h
index e29817e..2617e16 100644
--- a/include/console.h
+++ b/include/console.h
@@ -85,6 +85,13 @@
int console_record_avail(void);
/**
+ * console_record_isempty() - Returns if console output is empty
+ *
+ * Return: true if empty
+ */
+bool console_record_isempty(void);
+
+/**
* console_in_puts() - Write a string to the console input buffer
*
* This writes the given string to the console_in buffer which will then be
@@ -131,6 +138,12 @@
return 0;
}
+static inline bool console_record_isempty(void)
+{
+ /* Always empty */
+ return true;
+}
+
#endif /* !CONFIG_CONSOLE_RECORD */
/**