diff --git a/src/RTC_DS3231.cpp b/src/RTC_DS3231.cpp index c24a65a2..84618646 100644 --- a/src/RTC_DS3231.cpp +++ b/src/RTC_DS3231.cpp @@ -127,9 +127,6 @@ float RTC_DS3231::getTemperature() { /**************************************************************************/ bool RTC_DS3231::setAlarm1(const DateTime &dt, Ds3231Alarm1Mode alarm_mode) { uint8_t ctrl = read_register(DS3231_CONTROL); - if (!(ctrl & 0x04)) { - return false; - } uint8_t A1M1 = (alarm_mode & 0x01) << 7; // Seconds bit 7. uint8_t A1M2 = (alarm_mode & 0x02) << 6; // Minutes bit 7. @@ -160,9 +157,6 @@ bool RTC_DS3231::setAlarm1(const DateTime &dt, Ds3231Alarm1Mode alarm_mode) { /**************************************************************************/ bool RTC_DS3231::setAlarm2(const DateTime &dt, Ds3231Alarm2Mode alarm_mode) { uint8_t ctrl = read_register(DS3231_CONTROL); - if (!(ctrl & 0x04)) { - return false; - } uint8_t A2M2 = (alarm_mode & 0x01) << 7; // Minutes bit 7. uint8_t A2M3 = (alarm_mode & 0x02) << 6; // Hour bit 7. diff --git a/src/RTClib.h b/src/RTClib.h index 879bb3fa..08e4a35a 100644 --- a/src/RTClib.h +++ b/src/RTClib.h @@ -348,7 +348,7 @@ class RTC_I2C { @brief RTC based on the DS1307 chip connected via I2C and the Wire library */ /**************************************************************************/ -class RTC_DS1307 : RTC_I2C { +class RTC_DS1307 : public RTC_I2C { public: bool begin(TwoWire *wireInstance = &Wire); void adjust(const DateTime &dt); @@ -367,7 +367,7 @@ class RTC_DS1307 : RTC_I2C { @brief RTC based on the DS3231 chip connected via I2C and the Wire library */ /**************************************************************************/ -class RTC_DS3231 : RTC_I2C { +class RTC_DS3231 : public RTC_I2C { public: bool begin(TwoWire *wireInstance = &Wire); void adjust(const DateTime &dt); @@ -403,7 +403,7 @@ class RTC_DS3231 : RTC_I2C { @brief RTC based on the PCF8523 chip connected via I2C and the Wire library */ /**************************************************************************/ -class RTC_PCF8523 : RTC_I2C { +class RTC_PCF8523 : public RTC_I2C { public: bool begin(TwoWire *wireInstance = &Wire); void adjust(const DateTime &dt); @@ -430,7 +430,7 @@ class RTC_PCF8523 : RTC_I2C { @brief RTC based on the PCF8563 chip connected via I2C and the Wire library */ /**************************************************************************/ -class RTC_PCF8563 : RTC_I2C { +class RTC_PCF8563 : public RTC_I2C { public: bool begin(TwoWire *wireInstance = &Wire); bool lostPower(void);