From 41f7830086aba328634f6c2302c20f72d7d7b41c Mon Sep 17 00:00:00 2001 From: Yohan Boujon Date: Tue, 11 Apr 2023 19:18:27 +0200 Subject: [PATCH] RTC fixed, display hours --- implementation/rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/implementation/rtc.c b/implementation/rtc.c index 59d318b..368f4d4 100644 --- a/implementation/rtc.c +++ b/implementation/rtc.c @@ -25,7 +25,7 @@ void MyRTC_GetTime(MyRTC_Struct_TypeDef * rtc) MyI2C_GetString(I2C2, 0x01, &data); rtc->minutes = ((regCopy >> 4) & 0x07) * 10 + (regCopy & 0x0F); MyI2C_GetString(I2C2, 0x02, &data); - rtc->hours = 0; + rtc->hours = ((regCopy>>4)&0x01)*10 + (regCopy & 0x0F); MyI2C_GetString(I2C2, 0x03, &data); rtc->day = (regCopy & 0x07); MyI2C_GetString(I2C2, 0x04, &data);