Skip to content

Commit 4b23840

Browse files
committed
Add .clearInterrupt() function to RTC library
1 parent b617f99 commit 4b23840

File tree

3 files changed

+7
-0
lines changed

3 files changed

+7
-0
lines changed

libraries/RTC/keywords.txt

+1
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ setAlarm KEYWORD2
1515
setAlarmMode KEYWORD2
1616
attachInterrupt KEYWORD2
1717
detachInterrupt KEYWORD2
18+
clearInterrupt KEYWORD2
1819

1920
# Structures (KEYWORD3)
2021

libraries/RTC/src/RTC.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -201,6 +201,11 @@ void Apollo3RTC::detachInterrupt() {
201201
am_hal_rtc_int_disable(AM_HAL_RTC_INT_ALM);
202202
}
203203

204+
void Apollo3RTC::clearInterrupt() {
205+
// Clear the RTC alarm interrupt
206+
am_hal_rtc_int_clear(AM_HAL_RTC_INT_ALM);
207+
}
208+
204209
// mthToIndex() converts a string indicating a month to an index value.
205210
// The return value is a value 0-12, with 0-11 indicating the month given
206211
// by the string, and 12 indicating that the string is not a month.

libraries/RTC/src/RTC.h

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ class Apollo3RTC {
3434
void setAlarmMode(uint8_t mode); //Set the RTC alarm repeat interval
3535
void attachInterrupt(); //Attach the RTC alarm interrupt
3636
void detachInterrupt(); //Detach the RTC alarm interrupt
37+
void clearInterrupt(); //Clear RTC alarm interrupt
3738

3839
uint32_t weekday; //0 to 6 representing the day of the week
3940
uint32_t century;

0 commit comments

Comments
 (0)