From 22d7d685c4a5adaa0e3515a290fdb5c31d594b39 Mon Sep 17 00:00:00 2001 From: zhaohe Date: Thu, 16 Nov 2023 15:25:26 +0800 Subject: [PATCH] update --- hal/zuart.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/hal/zuart.cpp b/hal/zuart.cpp index da13c58..48dff00 100644 --- a/hal/zuart.cpp +++ b/hal/zuart.cpp @@ -144,6 +144,11 @@ bool ZUART::dataIsReady() { if (m_dataIsReady) { return true; } + + if (!(HAL_UART_GetState(m_huart) & (0x01 << 1))) { + HAL_UART_Receive_IT(m_huart, &onebyte, 1); + } + if (!m_dataIsReady && m_rxBufferPos != 0) { if (ifly_has_passedms(m_lastRxTime) > (uint32_t)m_rxovertime_ms) { m_dataIsReady = true;