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);