[PATCH 09/10] pbl: Implement ctrlc() using getc_ll()

Andrey Smirnov andrew.smirnov at gmail.com
Wed May 13 19:54:26 PDT 2015


Signed-off-by: Andrey Smirnov <andrew.smirnov at gmail.com>
---
 pbl/console.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/pbl/console.c b/pbl/console.c
index a9859ad..e34633f 100644
--- a/pbl/console.c
+++ b/pbl/console.c
@@ -30,12 +30,19 @@ int pr_print(int level, const char *fmt, ...)

 	return i;
 }
-
+#ifdef CONFIG_DEBUG_LL_INPUT
 int ctrlc(void)
 {
+	if (tstc_ll() && getc_ll() == 3)
+		return 1;
 	return 0;
 }
-
+#else
+int ctrlc(void)
+{
+	return 0;
+}
+#endif
 void console_putc(unsigned int ch, char c)
 {
 	putc_ll(c);
--
2.1.4



More information about the barebox mailing list