mirror of
https://github.com/adafruit/RTClib.git
synced 2026-07-27 19:56:05 +00:00
Merge pull request #245 from edgar-bonet/fix-pr244
Fix register address and line terminators
This commit is contained in:
+1
-1
@@ -131,4 +131,4 @@ uint8_t RTC_DS1307::readnvram(uint8_t address) {
|
||||
/**************************************************************************/
|
||||
void RTC_DS1307::writenvram(uint8_t address, uint8_t data) {
|
||||
writenvram(address, &data, 1);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -30,4 +30,4 @@ DateTime RTC_Micros::now() {
|
||||
lastMicros += elapsedSeconds * microsPerSecond;
|
||||
lastUnix += elapsedSeconds;
|
||||
return lastUnix;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -24,4 +24,4 @@ DateTime RTC_Millis::now() {
|
||||
lastMillis += elapsedSeconds * 1000;
|
||||
lastUnix += elapsedSeconds;
|
||||
return lastUnix;
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -289,4 +289,4 @@ void RTC_PCF8523::deconfigureAllTimers() {
|
||||
/**************************************************************************/
|
||||
void RTC_PCF8523::calibrate(Pcf8523OffsetMode mode, int8_t offset) {
|
||||
write_register(PCF8523_OFFSET, ((uint8_t)offset & 0x7F) | mode);
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -61,7 +61,7 @@ void RTC_PCF8563::adjust(const DateTime &dt) {
|
||||
/**************************************************************************/
|
||||
DateTime RTC_PCF8563::now() {
|
||||
uint8_t buffer[7];
|
||||
buffer[0] = 3;
|
||||
buffer[0] = PCF8563_VL_SECONDS; // start at location 2, VL_SECONDS
|
||||
i2c_dev->write_then_read(buffer, 1, buffer, 7);
|
||||
|
||||
return DateTime(bcd2bin(buffer[6]) + 2000U, bcd2bin(buffer[5] & 0x1F),
|
||||
|
||||
Reference in New Issue
Block a user