mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
mode_cardemu: Disable UART TXRDY generation if we don't have data to TX
When the ISO7816 state machine requires us to transmit something, but we don't have data ready to transmit, we should switch off TXRDY interrupt generation. What's missing is of course the other part that re-enabls TXRDY generation once new data is available
This commit is contained in:
@@ -102,8 +102,10 @@ void usart_irq_rx(uint8_t uart)
|
||||
#endif
|
||||
csr = usart->US_CSR;
|
||||
|
||||
if (csr & US_CSR_TXRDY)
|
||||
card_emu_tx_byte(ch);
|
||||
if (csr & US_CSR_TXRDY) {
|
||||
if (card_emu_tx_byte(ch) == 0)
|
||||
USART_DisableIt(usart, US_IER_TXRDY);
|
||||
}
|
||||
|
||||
if (csr & US_CSR_RXRDY) {
|
||||
byte = (usart->US_RHR) & 0xFF;
|
||||
|
||||
Reference in New Issue
Block a user