Skip to content

Commit 65e6595

Browse files
Sadik.OzerSadik.Ozer
authored andcommitted
Fix rtc read issue
Signed-off-by: Sadik.Ozer <Sadik.Ozer@maximintegrated.com>
1 parent 8a2681b commit 65e6595

File tree

1 file changed

+4
-4
lines changed
  • targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/RTC

1 file changed

+4
-4
lines changed

targets/TARGET_Maxim/TARGET_MAX32670/Libraries/PeriphDrivers/Source/RTC/rtc_reva.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -319,27 +319,27 @@ int MXC_RTC_RevA_GetTime(uint32_t* sec, uint32_t* subsec)
319319
do {
320320
// Check if an update is about to happen.
321321
if (!(MXC_RTC->ctrl & MXC_F_RTC_REVA_CTRL_RDY)) {
322-
continue;
322+
return E_BUSY;
323323
}
324324

325325
// Read the seconds count.
326326
temp_sec = MXC_RTC_RevA_GetSecond();
327327

328328
if (temp_sec == E_BUSY) {
329-
continue;
329+
return E_BUSY;
330330
}
331331

332332
// Check if an update is about to happen.
333333
if (!(MXC_RTC->ctrl & MXC_F_RTC_REVA_CTRL_RDY)) {
334-
continue;
334+
return E_BUSY;
335335
}
336336

337337
// Read the sub-seconds count.
338338
*subsec = MXC_RTC_RevA_GetSubSecond();
339339

340340
// Check if an update is about to happen.
341341
if (!(MXC_RTC->ctrl & MXC_F_RTC_REVA_CTRL_RDY)) {
342-
continue;
342+
return E_BUSY;
343343
}
344344

345345
// Read the seconds count.

0 commit comments

Comments
 (0)