From 7157175bd41b69d2767c0ef0bfef114638bbca8a Mon Sep 17 00:00:00 2001 From: Igor Date: Wed, 14 Jul 2021 15:45:10 -0700 Subject: [PATCH] uart.h refactor: move uart_send_break to lluart.h (#693) --- board/drivers/uart.h | 6 +----- board/stm32fx/lluart.h | 5 +++++ 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/board/drivers/uart.h b/board/drivers/uart.h index af7f9995..ecb3241a 100644 --- a/board/drivers/uart.h +++ b/board/drivers/uart.h @@ -38,6 +38,7 @@ typedef struct uart_ring { // ***************************** Function prototypes ***************************** void debug_ring_callback(uart_ring *ring); void uart_tx_ring(uart_ring *q); +void uart_send_break(uart_ring *u); // ******************************** UART buffers ******************************** @@ -138,11 +139,6 @@ void uart_flush_sync(uart_ring *q) { } } -void uart_send_break(uart_ring *u) { - while ((u->uart->CR1 & USART_CR1_SBK) != 0); - u->uart->CR1 |= USART_CR1_SBK; -} - void clear_uart_buff(uart_ring *q) { ENTER_CRITICAL(); q->w_ptr_tx = 0; diff --git a/board/stm32fx/lluart.h b/board/stm32fx/lluart.h index 0fe4ac2d..69959a76 100644 --- a/board/stm32fx/lluart.h +++ b/board/stm32fx/lluart.h @@ -42,6 +42,11 @@ void uart_rx_ring(uart_ring *q){ } } +void uart_send_break(uart_ring *u) { + while ((u->uart->CR1 & USART_CR1_SBK) != 0); + u->uart->CR1 |= USART_CR1_SBK; +} + // This function should be called on: // * Half-transfer DMA interrupt // * Full-transfer DMA interrupt