From 74e52fd7f98ff6c5c9285fcb6c689cce4fe8b199 Mon Sep 17 00:00:00 2001 From: NIIBE Yutaka Date: Thu, 25 Apr 2019 18:36:24 +0900 Subject: [PATCH] usart: usart_block_sendrecv: Fix receive when no data to send. --- contrib/usart-stm32f103.c | 4 ++++ contrib/usart-stm32l4.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/contrib/usart-stm32f103.c b/contrib/usart-stm32f103.c index 7b8c464..ef146f4 100644 --- a/contrib/usart-stm32f103.c +++ b/contrib/usart-stm32f103.c @@ -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) diff --git a/contrib/usart-stm32l4.c b/contrib/usart-stm32l4.c index 1a53504..3c9945f 100644 --- a/contrib/usart-stm32l4.c +++ b/contrib/usart-stm32l4.c @@ -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)