Modified the begin method so that it performs a real check on the RTC connection
This commit is contained in:
parent
42fb3f52bc
commit
8fb329e717
@ -1,5 +1,6 @@
|
||||
// Code by JeeLabs http://news.jeelabs.org/code/
|
||||
// Released to the public domain! Enjoy!
|
||||
// Added a real begin verification for the ds3231 01/05/2019 Th3maz1ng
|
||||
|
||||
#include <Wire.h>
|
||||
#include "RTClib.h"
|
||||
@ -433,7 +434,8 @@ void RTC_PCF8523::writeSqwPinMode(Pcf8523SqwPinMode mode) {
|
||||
|
||||
boolean RTC_DS3231::begin(void) const {
|
||||
Wire.begin();
|
||||
return true;
|
||||
Wire.beginTransmission(DS3231_ADDRESS);
|
||||
return Wire.endTransmission() == 0;
|
||||
}
|
||||
|
||||
bool RTC_DS3231::lostPower(void) const {
|
||||
|
@ -1,5 +1,6 @@
|
||||
// Code by JeeLabs http://news.jeelabs.org/code/
|
||||
// Released to the public domain! Enjoy!
|
||||
// Added a real begin verification for the ds3231 01/05/2019 Th3maz1ng
|
||||
|
||||
#ifndef _RTCLIB_H_
|
||||
#define _RTCLIB_H_
|
||||
|
Loading…
Reference in New Issue
Block a user