usart: usart_block_sendrecv: Fix receive when no data to send.

This commit is contained in:
NIIBE Yutaka
2019-04-25 18:36:24 +09:00
parent fe1ca5f055
commit 74e52fd7f9
2 changed files with 8 additions and 0 deletions

View File

@@ -533,6 +533,10 @@ usart_block_sendrecv (uint8_t dev_no, const char *s_buf, uint16_t s_buflen,
if (r_buf == NULL)
return 0;
if (!p)
if (smartcard_mode)
usart_config_recv_enable (USARTx, 1);
/* Receiving part */
r = chopstx_poll (timeout_block_p, 1, ph);
if (r == 0)

View File

@@ -530,6 +530,10 @@ usart_block_sendrecv (uint8_t dev_no, const char *s_buf, uint16_t s_buflen,
if (r_buf == NULL)
return 0;
if (!p)
if (smartcard_mode)
usart_config_recv_enable (USARTx, 1);
/* Receiving part */
r = chopstx_poll (timeout_block_p, 1, ph);
if (r == 0)