Skip to content

Commit 07dd8f0

Browse files
committed
Add a constructor to improve backwards compatibility.
1 parent 20d8dee commit 07dd8f0

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ You should have received a copy of the GNU General Public License along with thi
1717

1818
The 2.0.0 version of the library has some significant changes and is not completely backwards compatible with earlier versions. These changes provide a more consistent API and reduce the possibility of name collisions. While sketches using this library will likely require changes as a result, these should be mostly straightforward.
1919

20-
- The library no longer defines a `DS3232RTC` object, therefore each sketch needs to define one. Previous versions of the library defined a DS3232RTC object named `RTC`, only for AVR architectures. (Consider using a name other than `RTC` as this can cause a name collision on some architectures.)
21-
- The constructor no longer has the capability to initialize the I2C bus, therefore, the sketch needs to call `DS3232RTC::begin()` in the `setup()` function or elsewhere as appropriate.
20+
- The library no longer defines a `DS3232RTC` object, therefore each sketch needs to define one. (Previous versions of the library defined a DS3232RTC object named `RTC`, although only for AVR architecture. Consider using a name other than `RTC` as this can cause a name collision on some architectures.)
21+
- The constructor no longer has the capability to initialize the I2C bus and no longer accepts an optional parameter. Therefore, the sketch needs to call `DS3232RTC::begin()` in the `setup()` function or elsewhere as appropriate.
2222
- To reduce the possibility of name collisions, the enumerations as well as register addresses, etc. are now defined in the header file within the DS3232RTC class. Therefore, when using any of these names, it will be necessary to include the DS3232RTC scope, e.g. `myRTC.alarm(DS3232RTC::ALARM_1);`
2323
- Also to reduce collisions, register address names and bit names have been prefixed with `DS32_` (see the header file.)
2424
- The example sketches and documentation have been updated to reflect these changes.

src/DS3232RTC.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class DS3232RTC
132132
DS32_DYDT {6}; // Day/Date flag bit in alarm Day/Date registers
133133

134134
DS3232RTC() {};
135+
DS3232RTC(bool initI2C) { (void)initI2C; } // undocumented for backward compatibility
135136
void begin();
136137
static time_t get(); // static needed to work with setSyncProvider() in the Time library
137138
uint8_t set(time_t t);

0 commit comments

Comments
 (0)