Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport RTC getVoltLow from M5Unified #138

Merged
merged 3 commits into from
Jun 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/RTC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ uint8_t RTC::ReadReg(uint8_t reg) {
return Wire1.read();
}

bool RTC::getVoltLow(void) {
return (readReg(0x02) & 0x80) >> 7; // RTCC_VLSEC_MASK
}

void RTC::GetBm8563Time(void) {
Wire1.beginTransmission(0x51);
Wire1.write(0x02);
Expand Down
2 changes: 2 additions & 0 deletions src/RTC.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class RTC {

void clearIRQ();
void disableIRQ();

bool getVoltLow(void);

public:
uint8_t Second;
Expand Down
Loading