Makuna / Rtc

Arduino Library for RTCs, Ds1302, Ds1307, Ds3231, Ds3232, Ds3234 and Pcf8563/BM8563 with deep support. Please refer to the Wiki for more details. Please use the Github Discussions to ask questions as the GitHub Issues feature is used for bug tracking.
GNU Lesser General Public License v3.0
368 stars 126 forks source link

DS3231 - interrupt on alarm is not cleared #109

Closed Tost69 closed 4 years ago

Tost69 commented 4 years ago

Hi,

I use your lib to set alarms on a DS3231 clock module and it works well so far. But there is an issue with the clearing of the interrupt:

I use an ESP32, set it to sleep, the alarm wakes the ESP and any further try to set the ESP to sleep again will fail because of the not cleared interrupt.

Is there something which has to be written to the DS3231 to reset the interupt?

Thanks and kind regards, Tom

Makuna commented 4 years ago

First, when you created this issue, did you read the options? This is a question, and those should be directed to the gitter channel.

Once you handle the alarm, you need to call the LatchAlarmsTriggeredFlags(). If you look at the example for the DS3231 alarms you will see how this is done.

Tost69 commented 4 years ago

First: thanks for clarification and second: yes you are right, I missed to use LatchAlarmsTriggeredFlags() after the ESP wakeup (I already used LatchAlarmsTriggeredFlags() within the alarms handler but I forgot to call it in the setup after wakeup). So thanks for your quick help and kind regards, Tom