Skip to content

Commit 15ed97b

Browse files
Added Character Matched Callback for UART
1 parent 9623960 commit 15ed97b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

ext/ChibiOS_21.11.3/os/hal/ports/STM32/LLD/USARTv3/hal_uart_lld.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1217,6 +1217,10 @@ void uart_lld_serve_interrupt(UARTDriver *uartp) {
12171217
isr = u->ISR;
12181218
u->ICR = isr;
12191219

1220+
if (isr & USART_ISR_CMF) {
1221+
_uart_rx_char_match_isr_code(uartp);
1222+
}
1223+
12201224
if (isr & (USART_ISR_LBDF | USART_ISR_ORE | USART_ISR_NE |
12211225
USART_ISR_FE | USART_ISR_PE)) {
12221226
_uart_rx_error_isr_code(uartp, translate_errors(isr));

ext/ChibiOS_21.11.3/os/hal/ports/STM32/LLD/USARTv3/hal_uart_lld.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -894,6 +894,10 @@ typedef struct hal_uart_config {
894894
* flags in CR registers and supported hardware features.
895895
*/
896896
uartcb_t timeout_cb;
897+
/**
898+
* @brief Character Received callback.
899+
*/
900+
uartcb_t rx_cm_cb;
897901
/**
898902
* @brief Receiver timeout value in terms of number of bit duration.
899903
* @details Set it to 0 when you want to handle idle interrupt instead of

0 commit comments

Comments
 (0)