Skip to content

Commit 431b2d1

Browse files
committed
Revert "Supplement the lack of "extended RTC" in RZ_A1H/rtc_api.c"
This reverts commit 1bb2ca6.
1 parent 37641d7 commit 431b2d1

File tree

1 file changed

+3
-5
lines changed
  • targets/TARGET_RENESAS/TARGET_RZ_A1H

1 file changed

+3
-5
lines changed

targets/TARGET_RENESAS/TARGET_RZ_A1H/rtc_api.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
#define SHIFT_1BYTE (8u)
4949
#define SHIFT_2BYTE (16u)
5050

51-
#define TIME_ERROR_VAL (0u)
51+
#define TIME_ERROR_VAL (0xFFFFFFFFu)
5252

5353
static int rtc_dec8_to_hex(uint8_t dec_val, uint8_t offset, int *hex_val);
5454
static int rtc_dec16_to_hex(uint16_t dec_val, uint16_t offset, int *hex_val);
@@ -214,9 +214,7 @@ time_t rtc_read(void) {
214214

215215
if (err == 0) {
216216
// Convert to timestamp
217-
if (_rtc_maketime(&timeinfo, &t, RTC_FULL_LEAP_YEAR_SUPPORT) == false) {
218-
return TIME_ERROR_VAL;
219-
}
217+
t = _rtc_mktime(&timeinfo);
220218
} else {
221219
// Error
222220
t = TIME_ERROR_VAL;
@@ -307,7 +305,7 @@ static int rtc_dec16_to_hex(uint16_t dec_val, uint16_t offset, int *hex_val) {
307305
void rtc_write(time_t t) {
308306

309307
struct tm timeinfo;
310-
if (_rtc_localtime(t, &timeinfo, RTC_FULL_LEAP_YEAR_SUPPORT) == false) {
308+
if (_rtc_localtime(t, &timeinfo) == false) {
311309
return;
312310
}
313311
volatile uint16_t dummy_read;

0 commit comments

Comments
 (0)