Skip to content

Commit 192c2a6

Browse files
committed
Fixed RTC data read error
1 parent 54b958b commit 192c2a6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/RTC.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ uint8_t RTC::ReadReg(uint8_t reg)
2424
{
2525
Wire1.beginTransmission(0x51);
2626
Wire1.write(reg);
27-
Wire1.endTransmission();
27+
Wire1.endTransmission(false);
2828
Wire1.requestFrom(0x51, 1);
2929
return Wire1.read();
3030
}
@@ -33,7 +33,7 @@ void RTC::GetBm8563Time(void)
3333
{
3434
Wire1.beginTransmission(0x51);
3535
Wire1.write(0x02);
36-
Wire1.endTransmission();
36+
Wire1.endTransmission(false);
3737
Wire1.requestFrom(0x51, 7);
3838
while (Wire1.available())
3939
{
@@ -126,7 +126,7 @@ void RTC::GetTime(RTC_TimeTypeDef *RTC_TimeStruct)
126126

127127
Wire1.beginTransmission(0x51);
128128
Wire1.write(0x02);
129-
Wire1.endTransmission();
129+
Wire1.endTransmission(false);
130130
Wire1.requestFrom(0x51, 3);
131131

132132
while (Wire1.available())
@@ -163,7 +163,7 @@ void RTC::GetDate(RTC_DateTypeDef *RTC_DateStruct)
163163

164164
Wire1.beginTransmission(0x51);
165165
Wire1.write(0x05);
166-
Wire1.endTransmission();
166+
Wire1.endTransmission(false);
167167
Wire1.requestFrom(0x51, 4);
168168

169169
while (Wire1.available())

0 commit comments

Comments
 (0)