summaryrefslogtreecommitdiff
path: root/include/uart.h
diff options
context:
space:
mode:
authorMyles Watson <mylesgw@chromium.org>2015-02-13 11:45:21 -0800
committerChromeOS Commit Bot <chromeos-commit-bot@chromium.org>2015-02-21 00:49:36 +0000
commitdb19a8e2c9a3c97be2ef1894cf113130592edba5 (patch)
tree6755d4c10e8542053dcbaff43596880542ded281 /include/uart.h
parenteb775b49b83e039a92fd67a9b8d6049d0f0cc70d (diff)
downloadchrome-ec-db19a8e2c9a3c97be2ef1894cf113130592edba5.tar.gz
common: Add the possibility to filter UART input
Add CONFIG_UART_INPUT_FILTER, which is undefined by default. BUG=chrome-os-partner:36745 TEST=buildall for the case where it is not defined. Added a filter function to the btle code on hadoken. Tested reset, transmit test, receive test, test end, and test mode end. BRANCH=None Signed-off-by: Myles Watson <mylesgw@chromium.org> Change-Id: I3a9c067ffcb114449b61f468271a48491a8c7ec5 Reviewed-on: https://chromium-review.googlesource.com/250580 Tested-by: Myles Watson <mylesgw@chromium.org> Reviewed-by: Randall Spangler <rspangler@chromium.org> Commit-Queue: Myles Watson <mylesgw@chromium.org>
Diffstat (limited to 'include/uart.h')
-rw-r--r--include/uart.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/uart.h b/include/uart.h
index 2f0bc8bd8c..6128962726 100644
--- a/include/uart.h
+++ b/include/uart.h
@@ -227,6 +227,17 @@ void uart_deepsleep_interrupt(enum gpio_signal signal);
#define uart_deepsleep_interrupt NULL
#endif
+#ifdef CONFIG_UART_INPUT_FILTER
+/**
+ * Application-specific input filter, which takes the next input character as
+ * a parameter.
+ *
+ * Return 0 to allow the character to be handled by the console, non-zero if
+ * the character was handled by the filter.
+ */
+int uart_input_filter(int c);
+#endif
+
/*
* COMx functions
*/