mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-17 21:58:33 +03:00
UART: make IRQ/ISR enabling simpler
Change-Id: Id3742850eb5bac91559e0c2b4144bd7b1ae5b07b
This commit is contained in:
@@ -150,16 +150,12 @@ extern void UART_PutChar( uint8_t c )
|
||||
}
|
||||
|
||||
/* Only store input if buffer is not full, else drop it */
|
||||
bool trigger_isr = false;
|
||||
if (rbuf_is_empty(&uart_tx_buffer)) {
|
||||
trigger_isr = true;
|
||||
}
|
||||
if (!rbuf_is_full(&uart_tx_buffer)) {
|
||||
rbuf_write(&uart_tx_buffer, c);
|
||||
}
|
||||
if (trigger_isr) {
|
||||
pUart->UART_IER = UART_IER_TXRDY;
|
||||
CONSOLE_ISR();
|
||||
if (!(pUart->UART_IMR & UART_IMR_TXRDY)) {
|
||||
pUart->UART_IER = UART_IER_TXRDY;
|
||||
CONSOLE_ISR();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user