Skip to content

Commit

Permalink
v6.2.7: Fix century bit interfering with year read - Thanks @davidhbrown
Browse files Browse the repository at this point in the history
 for #17 and #18
  • Loading branch information
Naguissa committed Apr 14, 2020
1 parent 1a5a1ae commit 45f6948
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
1 change: 1 addition & 0 deletions contributors.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ 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
2 changes: 1 addition & 1 deletion library.properties
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name=uRTCLib
version=6.2.6
version=6.2.7
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.
Expand Down
2 changes: 1 addition & 1 deletion src/uRTCLib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.6
* @version 6.2.7
*/

#include <Arduino.h>
Expand Down
17 changes: 13 additions & 4 deletions src/uRTCLib.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,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.6
* @version 6.2.7
*/
/** \file uRTCLib.h
* \brief uRTCLib header file
Expand Down Expand Up @@ -220,16 +220,25 @@
*/
#define uRTCLIB_bcdToDec(val) ((uint8_t) ((val / 16 * 10) + (val % 16)))

// ESP8266 yield function (ESP32 has no need for that)
// ESP yield function (ESP32 has no need for that on dual core, but it has on single core version)
#if ARDUINO_ARCH_ESP8266
/**
* \brief ESP8266, yield to don't block ESP functionality.
*
* When this library is used in other MCUs this is simply removed by the preprocessor
*/
#define uRTCLIB_YIELD yield();
#else
#if ARDUINO_ARCH_ESP32
/**
* \brief Only on ESP8266, yield to don't block ESP functionality.
* \brief ESP32, yield to don't block ESP functionality.
*
* When this library is used in other MCUs this is simply removed by the preprocessor
*/
#define uRTCLIB_YIELD
#define uRTCLIB_YIELD yield();
#else
#define uRTCLIB_YIELD
#endif
#endif

class uRTCLib {
Expand Down

0 comments on commit 45f6948

Please sign in to comment.