From 65e6595d7b439bbe21b548c0b6e4356423ece536 Mon Sep 17 00:00:00 2001 From: "Sadik.Ozer" Date: Sun, 6 Mar 2022 01:57:51 +0300 Subject: [PATCH] Fix rtc read issue Signed-off-by: Sadik.Ozer --- .../Libraries/PeriphDrivers/Source/RTC/rtc_reva.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/RTC/rtc_reva.c b/targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/RTC/rtc_reva.c index 91269ef1f5..20000413d8 100644 --- a/targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/RTC/rtc_reva.c +++ b/targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/RTC/rtc_reva.c @@ -319,19 +319,19 @@ int MXC_RTC_RevA_GetTime(uint32_t* sec, uint32_t* subsec) do { // Check if an update is about to happen. if (!(MXC_RTC->ctrl & MXC_F_RTC_REVA_CTRL_RDY)) { - continue; + return E_BUSY; } // Read the seconds count. temp_sec = MXC_RTC_RevA_GetSecond(); if (temp_sec == E_BUSY) { - continue; + return E_BUSY; } // Check if an update is about to happen. if (!(MXC_RTC->ctrl & MXC_F_RTC_REVA_CTRL_RDY)) { - continue; + return E_BUSY; } // Read the sub-seconds count. @@ -339,7 +339,7 @@ int MXC_RTC_RevA_GetTime(uint32_t* sec, uint32_t* subsec) // Check if an update is about to happen. if (!(MXC_RTC->ctrl & MXC_F_RTC_REVA_CTRL_RDY)) { - continue; + return E_BUSY; } // Read the seconds count.