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

Method calling confusion #24

Open
byrek opened this issue Nov 26, 2024 · 0 comments
Open

Method calling confusion #24

byrek opened this issue Nov 26, 2024 · 0 comments

Comments

@byrek
Copy link

byrek commented Nov 26, 2024

https://github.com/PaulStoffregen/DS1307RTC/blame/c2590c00332bb952ee3b6b5d10615df47509935b/DS1307RTC.cpp#L67

Good day Paul,
I've initially started working on DS1307 with Your library, that seems to be well coded, but due to some strange behavior I moved on to Adafruit RTCLib. On contrary RTCLib does not process the "Day of week" from DS1307 chip at all, but drops the register's value.

Having that on mind, I went back to Your code to find out what's wrong with it, here's the code I've run at the beginning on my circuit self-check:
int rtc_test(void) { if (!RTC.chipPresent()) return RTC_ERR_MISSING; if (!RTC.isRunning()) return RTC_ERR_NOT_RUNNING; //battery out? return RTC_OK; }
and I always ended up with RTC_ERR_MISSING.
Looking through Your code I've found, that I can't calll chipPresent() method prior calling RTC.read(); first. In general, to avoid confusions like my own, perhaps You could sort this out so that chipPresent() method would be independent of RTC.read() one and return the right value.
Cheers and thanks for the library
Mike

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant