Skip to content

Commit

Permalink
Fixed RTC data read error
Browse files Browse the repository at this point in the history
  • Loading branch information
EeeeBin committed Jun 28, 2021
1 parent 54b958b commit 192c2a6
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/RTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ uint8_t RTC::ReadReg(uint8_t reg)
{
Wire1.beginTransmission(0x51);
Wire1.write(reg);
Wire1.endTransmission();
Wire1.endTransmission(false);
Wire1.requestFrom(0x51, 1);
return Wire1.read();
}
Expand All @@ -33,7 +33,7 @@ void RTC::GetBm8563Time(void)
{
Wire1.beginTransmission(0x51);
Wire1.write(0x02);
Wire1.endTransmission();
Wire1.endTransmission(false);
Wire1.requestFrom(0x51, 7);
while (Wire1.available())
{
Expand Down Expand Up @@ -126,7 +126,7 @@ void RTC::GetTime(RTC_TimeTypeDef *RTC_TimeStruct)

Wire1.beginTransmission(0x51);
Wire1.write(0x02);
Wire1.endTransmission();
Wire1.endTransmission(false);
Wire1.requestFrom(0x51, 3);

while (Wire1.available())
Expand Down Expand Up @@ -163,7 +163,7 @@ void RTC::GetDate(RTC_DateTypeDef *RTC_DateStruct)

Wire1.beginTransmission(0x51);
Wire1.write(0x05);
Wire1.endTransmission();
Wire1.endTransmission(false);
Wire1.requestFrom(0x51, 4);

while (Wire1.available())
Expand Down

0 comments on commit 192c2a6

Please sign in to comment.