uart.h refactor: move uart_send_break to lluart.h (#693)

This commit is contained in:
Igor
2021-07-14 15:45:10 -07:00
committed by GitHub
parent aaad0c2865
commit 7157175bd4
2 changed files with 6 additions and 5 deletions

View File

@@ -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;

View File

@@ -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