From 2dc0eeac0dc58a342c8d91337cbf8bf095b93c66 Mon Sep 17 00:00:00 2001 From: TomohikoWatanabe Date: Fri, 3 Jul 2020 11:17:57 +0900 Subject: [PATCH] [GR-MANGO] fix RTC read counter --- targets/TARGET_RENESAS/TARGET_RZ_A2XX/rtc_api.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/targets/TARGET_RENESAS/TARGET_RZ_A2XX/rtc_api.c b/targets/TARGET_RENESAS/TARGET_RZ_A2XX/rtc_api.c index ec025a05fb4..290a3ddd4a8 100644 --- a/targets/TARGET_RENESAS/TARGET_RZ_A2XX/rtc_api.c +++ b/targets/TARGET_RENESAS/TARGET_RZ_A2XX/rtc_api.c @@ -145,10 +145,10 @@ time_t rtc_read(void) RTC_BCNT1.RSR.BIT.CF = 0; // Read RTC register - t = (RTC_BCNT1.BCNT0.BYTE << 0) - | (RTC_BCNT1.BCNT1.BYTE << 8) - | (RTC_BCNT1.BCNT2.BYTE << 16) - | (RTC_BCNT1.BCNT3.BYTE << 24); + t = ((time_t)RTC_BCNT1.BCNT0.BYTE << 0) + | ((time_t)RTC_BCNT1.BCNT1.BYTE << 8) + | ((time_t)RTC_BCNT1.BCNT2.BYTE << 16) + | ((time_t)RTC_BCNT1.BCNT3.BYTE << 24); } while (RTC_BCNT1.RSR.BIT.CF != 0); } else { // Error