ble_monitor; crashes if outputting uart receives any characters.

Add a routine to discard the data instead.
This commit is contained in:
Marko Kiiskila
2018-09-11 13:16:45 +03:00
parent 04cd24da0d
commit b06f2fbcc7
+7 -1
View File
@@ -71,6 +71,12 @@ inc_and_wrap(int i, int max)
return (i + 1) & (max - 1);
}
static int
monitor_uart_rx_discard(void *arg, uint8_t ch)
{
return 0;
}
static int
monitor_uart_tx_char(void *arg)
{
@@ -295,7 +301,7 @@ ble_monitor_init(void)
.uc_parity = UART_PARITY_NONE,
.uc_flow_ctl = UART_FLOW_CTL_NONE,
.uc_tx_char = monitor_uart_tx_char,
.uc_rx_char = NULL,
.uc_rx_char = monitor_uart_rx_discard,
.uc_cb_arg = NULL,
};