Public inheritance of base class RTC_I2C for the class definitions of RTC_DS1307; RTC_DS3231; RTC_PCF8523; ... #313
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In RTC_DS3231.cpp, removed the check for INTCN bit in the control register, as setting an alarm is not dependent on the INTCN bit being set. The bits A1F and A2F are set when the alarm is triggered, regardless of the INTCN bit state. This allows setting alarms without needing to enable the interrupt control bit as the user may be using the SQW signal on that pin (e.g. 1 Hz).
imitations: - None -
Tests:
Ran tests on RTC_DS3231 class against several DS3231 & DS3232 modules including a DS3231M. The changes do not impact the functionality and the alarms times were successfully set. Using the RTC_I2C::read_register() method, I was able to read the registers and extract the required information for the Binary Clock project.