Skip to content

Commit

Permalink
Release 6.2.8: Power lost support for DS1307, thanks to @QoBo68
Browse files Browse the repository at this point in the history
  • Loading branch information
Naguissa committed May 19, 2020
1 parent aa8b71d commit 214dc16
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 11 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ Supported features:
* RAM for DS1307 and DS3232
* temperature sensor for DS3231 and DS3232
* Alarms (1 and 2) for DS3231 and DS3232
* Power lost flag reading and clearing

EEPROM support has been moved to https://github.com/Naguissa/uEEPROMLib

Expand Down
3 changes: 2 additions & 1 deletion contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,5 @@ Brian Park - https://github.com/bxparks - Temperature as fixed point to remove f
Grepis - https://github.com/grepis - Find & fix some alarm bugs
prosper00 - https://github.com/prosper00 - Find & fix a bug on a example when compiling for STM32 ST cube.
meltingSnowdrift - https://github.com/meltingSnowdrift - Find unhandled centiry bit.
David Brown - https://github.com/davidhbrown - Fix century bit on year read
David Brown - https://github.com/davidhbrown - Fix century bit on year read.
WoBo68 - https://github.com/WoBo68 - Power lost support for DS1307.
4 changes: 2 additions & 2 deletions library.properties
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
name=uRTCLib
version=6.2.7
version=6.2.8
author=Naguissa <[email protected]>
maintainer=Naguissa <[email protected]>
sentence=Really tiny library to basic RTC functionality on Arduino. DS1307, DS3231 and DS3232 RTCs are supported. See https://github.com/Naguissa/uEEPROMLib for EEPROM support. Temperature, Alarms, SQWG and RAM support.
sentence=Really tiny library to basic RTC functionality on Arduino. DS1307, DS3231 and DS3232 RTCs are supported. See https://github.com/Naguissa/uEEPROMLib for EEPROM support. Temperature, Alarms, SQWG, Power lost and RAM support.
paragraph=Supports Arduino AVR, STM32, ESP8266, ESP32 and other microcontrollers
category=Device Control
url=https://github.com/Naguissa/uRTCLib
Expand Down
17 changes: 11 additions & 6 deletions src/uRTCLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* * RAM for DS1307 and DS3232
* * temperature sensor for DS3231 and DS3232
* * Alarms (1 and 2) for DS3231 and DS3232
* * Power failure check for DS3231 and DS3232
* * Power failure check and clear
*
* See uEEPROMLib for EEPROM support, https://github.com/Naguissa/uEEPROMLib
*
Expand All @@ -21,7 +21,7 @@
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html">https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html</a>
* @see <a href="mailto:[email protected]">[email protected]</a>
* @see <a href="https://github.com/Naguissa/uEEPROMLib">See uEEPROMLib for EEPROM support.</a>
* @version 6.2.7
* @version 6.2.8
*/

#include <Arduino.h>
Expand Down Expand Up @@ -238,9 +238,13 @@ void uRTCLib::refresh() {
/**
* \brief Returns lost power VBAT staus
*
* DS1307 has a 'CH' Clock Halt Bit in Register 00h -> On first application of power to the device the time and date registers are typically reset to 01/01/00 01 00:00:00 (MM/DD/YY DOW HH:MM:SS).
* The CH bit in the seconds register will be set to a 1.
* others have a 'OSF' Oscillator Stop Flag in Register 0Fh
* DS1307 has a 'CH' Clock Halt Bit in Register 00h.
*
* On first application of power to the device the time and date registers are typically reset to 01/01/00 01 00:00:00 (MM/DD/YY DOW HH:MM:SS).
*
* The CH bit in the seconds register will be set to a 1.
*
* Others have a 'OSF' Oscillator Stop Flag in Register 0Fh
*
* @return True if power was lost (both power sources, VCC and VBAT)
*/
Expand Down Expand Up @@ -280,7 +284,8 @@ bool uRTCLib::lostPower() {
* \brief Clears lost power VBAT staus
*
* DS1307 has a 'CH' Clock Halt Bit in Register 00h -> When cleared to 0, the oscillator is enabled and time starts incermenting
* others have a 'OSF' Oscillator Stop Flag in Register 0Fh
*
* Others have a 'OSF' Oscillator Stop Flag in Register 0Fh
*/
void uRTCLib::lostPowerClear() {

Expand Down
4 changes: 2 additions & 2 deletions src/uRTCLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
* * RAM for DS1307 and DS3232
* * temperature sensor for DS3231 and DS3232
* * Alarms (1 and 2) for DS3231 and DS3232
* * Power failure check for DS3231 and DS3232
* * Power failure check and clear
*
* See uEEPROMLib for EEPROM support, https://github.com/Naguissa/uEEPROMLib
*
* @see <a href="https://github.com/Naguissa/uRTCLib">https://github.com/Naguissa/uRTCLib</a>
* @see <a href="https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html">https://www.foroelectro.net/librerias-arduino-ide-f29/rtclib-arduino-libreria-simple-y-eficaz-para-rtc-y-t95.html</a>
* @see <a href="mailto:[email protected]">[email protected]</a>
* @see <a href="https://github.com/Naguissa/uEEPROMLib">See uEEPROMLib for EEPROM support.</a>
* @version 6.2.7
* @version 6.2.8
*/
/** \file uRTCLib.h
* \brief uRTCLib header file
Expand Down

0 comments on commit 214dc16

Please sign in to comment.