Added a real begin to the DS1307 begin method

This commit is contained in:
Th3maz1ng 2020-04-27 10:17:57 +02:00
parent 4990a7ff25
commit 9ee717a41b

View File

@ -1,6 +1,7 @@
// 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
// Added a real begin verification for the ds1307 27/04/2020 Th3maz1ng
#include <Wire.h>
#include "RTClib.h"
@ -239,7 +240,8 @@ static uint8_t bin2bcd (uint8_t val) { return val + 6 * (val / 10); }
boolean RTC_DS1307::begin(void) {
Wire.begin();
return true;
Wire.beginTransmission(DS1307_ADDRESS);
return Wire.endTransmission() == 0;
}
uint8_t RTC_DS1307::isrunning(void) {