mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-16 21:28:33 +03:00
wait for UART Tx completion before switching baud rate at PTS
This commit is contained in:
@@ -454,6 +454,7 @@ static int tx_byte_pts(struct card_handle *ch)
|
||||
|
||||
switch (ch->pts.state) {
|
||||
case PTS_S_WAIT_RESP_PCK:
|
||||
card_emu_uart_wait_tx_idle(ch->uart_chan);
|
||||
/* update baud rate generator with Fi/Di */
|
||||
emu_update_fidi(ch);
|
||||
/* Wait for the next TPDU */
|
||||
|
||||
@@ -35,3 +35,4 @@ void card_emu_report_status(struct card_handle *ch);
|
||||
int card_emu_uart_update_fidi(uint8_t uart_chan, unsigned int fidi);
|
||||
int card_emu_uart_tx(uint8_t uart_chan, uint8_t byte);
|
||||
void card_emu_uart_enable(uint8_t uart_chan, uint8_t rxtx);
|
||||
void card_emu_uart_wait_tx_idle(uint8_t uart_chan);
|
||||
|
||||
@@ -97,6 +97,12 @@ static void wait_tx_idle(Usart *usart)
|
||||
}
|
||||
}
|
||||
|
||||
void card_emu_uart_wait_tx_idle(uint8_t uart_chan)
|
||||
{
|
||||
Usart *usart = get_usart_by_chan(uart_chan);
|
||||
wait_tx_idle(usart);
|
||||
}
|
||||
|
||||
/* call-back from card_emu.c to enable/disable transmit and/or receive */
|
||||
void card_emu_uart_enable(uint8_t uart_chan, uint8_t rxtx)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user