mirror of
https://github.com/infiniteCable2/panda.git
synced 2026-02-18 17:23:52 +08:00
uart.h refactor: move uart_send_break to lluart.h (#693)
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user