-
Notifications
You must be signed in to change notification settings - Fork 19
Remove verification check #20
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
Conversation
adafruit_ds3231.py
Outdated
|
||
if (buf[1] & 0b00011000) != 0b00011000: | ||
# Try and verify this is the RTC we expect by checking change in secs | ||
check = self.datetime_register.tm_sec |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could it be stopped?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's an interesting question. It's possible, if the EOSC bit at 0x0E is set to 0 and the clock is on battery power only, then the clock would be stopped. I think maybe go back to the idea of a parameter being given to the constructor...verify_running=true? If true (default), the constructor verifies that the time is changing and so we have a running clock. If false, then the user clearly wants to be ok just having an item on 0x68.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good point. could be. hmmm. can be checked with OSF in status reg? but makes me question this general approach?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
delete it all, use just the addr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so no "is it a DS3231" check? just "yep. something's at 0x68"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done. address check covered by I2CDevice init.
Updating https://github.com/adafruit/Adafruit_CircuitPython_DS3231 to 2.2.1 from 2.2.0: > Merge pull request adafruit/Adafruit_CircuitPython_DS3231#20 from caternuson/iss15 > Merge pull request adafruit/Adafruit_CircuitPython_DS3231#19 from adafruit/dherrada-patch-1 Updating https://github.com/adafruit/Adafruit_CircuitPython_TCS34725 to 3.2.3 from 3.2.2: > Merge pull request adafruit/Adafruit_CircuitPython_TCS34725#24 from caternuson/iss20 > Merge pull request adafruit/Adafruit_CircuitPython_TCS34725#23 from adafruit/dherrada-patch-1
Possible fix for #15
Uses approach proposed by @gritnix in issue thread which checks for elapsed time. This slows down the constructor, but avoids relying on a register value that may not be as expected due to regular use.