summaryrefslogtreecommitdiff
path: root/common/uart_buffering.c
diff options
context:
space:
mode:
Diffstat (limited to 'common/uart_buffering.c')
-rw-r--r--common/uart_buffering.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/common/uart_buffering.c b/common/uart_buffering.c
index 6e93804e61..8037320340 100644
--- a/common/uart_buffering.c
+++ b/common/uart_buffering.c
@@ -157,6 +157,10 @@ void uart_process_input(void)
for (i = cur_head; i != rx_buf_head; i = RX_BUF_NEXT(i)) {
int c = rx_buf[i];
+#ifdef CONFIG_UART_INPUT_FILTER /* TODO(crosbug.com/p/36745): */
+#error "Filtering the UART input with DMA enabled is NOT SUPPORTED!"
+#endif
+
if (c == CTRL('S')) {
/* Software flow control - XOFF */
uart_suspended = 1;
@@ -197,6 +201,12 @@ void uart_process_input(void)
int c = uart_read_char();
int rx_buf_next = RX_BUF_NEXT(rx_buf_head);
+#ifdef CONFIG_UART_INPUT_FILTER
+ /* Intercept the input before it goes to the console */
+ if (uart_input_filter(c))
+ continue;
+#endif
+
if (c == CTRL('S')) {
/* Software flow control - XOFF */
uart_suspended = 1;