Skip to content

Commit cc1405b

Browse files
committed
6.5.0: AlarmClear fixes, thanks to @derbic7
1 parent 23d0a6e commit cc1405b

File tree

3 files changed

+20
-19
lines changed

3 files changed

+20
-19
lines changed

library.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name=uRTCLib
2-
version=6.4.0
2+
version=6.5.0
33
author=Naguissa <naguissa@foroelectro.net>
44
maintainer=Naguissa <naguissa@foroelectro.net>
55
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.

src/uRTCLib.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
* @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>
2525
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
2626
* @see <a href="https://github.com/Naguissa/uEEPROMLib">See uEEPROMLib for EEPROM support.</a>
27-
* @version 6.4.0
27+
* @version 6.5.0
2828
*/
2929

3030
#include <Arduino.h>
@@ -831,10 +831,12 @@ bool uRTCLib::alarmDisable(const uint8_t alarm) {
831831
switch (alarm) {
832832
case URTCLIB_ALARM_1: // Alarm 1
833833
mask = 0b11111110; // A1IE bit
834+
_a1_mode = URTCLIB_ALARM_TYPE_1_NONE;
834835
break;
835836

836837
case URTCLIB_ALARM_2: // Alarm 2
837838
mask = 0b11111101; // A2IE bit
839+
_a2_mode = URTCLIB_ALARM_TYPE_1_NONE;
838840
break;
839841
} // Alarm type switch
840842
if (mask) {
@@ -847,7 +849,7 @@ bool uRTCLib::alarmDisable(const uint8_t alarm) {
847849
uRTCLIB_YIELD
848850
URTCLIB_WIRE.requestFrom(_rtc_address, 1);
849851
status = URTCLIB_WIRE.read();
850-
status &= 0b11111110; // A1IE bit
852+
status &= mask; // A1IE or A2IE bit
851853
URTCLIB_WIRE.beginTransmission(_rtc_address);
852854
uRTCLIB_YIELD
853855
URTCLIB_WIRE.write(0x0E);
@@ -856,7 +858,6 @@ bool uRTCLib::alarmDisable(const uint8_t alarm) {
856858
uRTCLIB_YIELD
857859
URTCLIB_WIRE.endTransmission();
858860
uRTCLIB_YIELD
859-
_a1_mode = URTCLIB_ALARM_TYPE_1_NONE;
860861
return true;
861862
}
862863
break;

src/uRTCLib.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
* @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>
2222
* @see <a href="mailto:naguissa@foroelectro.net">naguissa@foroelectro.net</a>
2323
* @see <a href="https://github.com/Naguissa/uEEPROMLib">See uEEPROMLib for EEPROM support.</a>
24-
* @version 6.4.0
24+
* @version 6.5.0
2525
*/
2626
/** \file uRTCLib.h
2727
* \brief uRTCLib header file
@@ -66,33 +66,33 @@
6666

6767
/************ WEEK DAYS ***********/
6868
/**
69-
* \brief Week day definition, [Sun..Sat] as [1..7]. Sunday
69+
* \brief Week day definition, [Mon..Sun] as [1..7]. Sunday
7070
*/
71-
#define URTCLIB_WEEKDAY_SUNDAY 1
71+
#define URTCLIB_WEEKDAY_SUNDAY 7
7272
/**
73-
* \brief Week day definition, [Sun..Sat] as [1..7]. Monday
73+
* \brief Week day definition, [Mon..Sun] as [1..7]. Monday
7474
*/
75-
#define URTCLIB_WEEKDAY_MONDAY 2
75+
#define URTCLIB_WEEKDAY_MONDAY 1
7676
/**
77-
* \brief Week day definition, [Sun..Sat] as [1..7]. Tuesday
77+
* \brief Week day definition, [Mon..Sun] as [1..7]. Tuesday
7878
*/
79-
#define URTCLIB_WEEKDAY_TUESDAY 3
79+
#define URTCLIB_WEEKDAY_TUESDAY 2
8080
/**
81-
* \brief Week day definition, [Sun..Sat] as [1..7]. Wednesday
81+
* \brief Week day definition, [Mon..Sun] as [1..7]. Wednesday
8282
*/
83-
#define URTCLIB_WEEKDAY_WEDNESDAY 4
83+
#define URTCLIB_WEEKDAY_WEDNESDAY 3
8484
/**
85-
* \brief Week day definition, [Sun..Sat] as [1..7]. Thursday
85+
* \brief Week day definition, [Mon..Sun] as [1..7]. Thursday
8686
*/
87-
#define URTCLIB_WEEKDAY_THURSDAY 5
87+
#define URTCLIB_WEEKDAY_THURSDAY 4
8888
/**
89-
* \brief Week day definition, [Sun..Sat] as [1..7]. Friday
89+
* \brief Week day definition, [Mon..Sun] as [1..7]. Friday
9090
*/
91-
#define URTCLIB_WEEKDAY_FRIDAY 6
91+
#define URTCLIB_WEEKDAY_FRIDAY 5
9292
/**
93-
* \brief Week day definition, [Sun..Sat] as [1..7]. Saturday
93+
* \brief Week day definition, [Mon..Sun] as [1..7]. Saturday
9494
*/
95-
#define URTCLIB_WEEKDAY_SATURDAY 7
95+
#define URTCLIB_WEEKDAY_SATURDAY 6
9696

9797

9898

0 commit comments

Comments
 (0)