Skip to content

Commit c25957e

Browse files
committed
Add removeAlarm function
1 parent fa7bcde commit c25957e

File tree

5 files changed

+7
-81
lines changed

5 files changed

+7
-81
lines changed

STM32F1/libraries/RTClock/examples/RTC-Serial-Set-Newlibrary.ino

Lines changed: 0 additions & 80 deletions
This file was deleted.
Binary file not shown.

STM32F1/libraries/RTClock/keywords.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ setTime KEYWORD2
1313
getTime KEYWORD2
1414

1515
createAlarm KEYWORD2
16+
removeAlarm KEYWORD2
1617
setAlarmTime KEYWORD2
1718

1819
attachSecondsInterrupt KEYWORD2

STM32F1/libraries/RTClock/src/RTClock.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,10 @@ time_t RTClock::makeTime(tm_t & tmm)
194194
rtc_attach_interrupt(RTC_ALARM_SPECIFIC_INTERRUPT, function);
195195
}
196196

197+
void RTClock::removeAlarm() {
198+
rtc_detach_interrupt(RTC_ALARM_SPECIFIC_INTERRUPT);
199+
}
200+
197201
void RTClock::attachSecondsInterrupt(voidFuncPtr function) {
198202
rtc_attach_interrupt(RTC_SECONDS_INTERRUPT, function);
199203
}

STM32F1/libraries/RTClock/src/RTClock.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,11 +76,12 @@ class RTClock {
7676

7777
void createAlarm(voidFuncPtr function, time_t alarm_time_t);
7878
void createAlarm(voidFuncPtr function, struct tm_t & alarm_tm);
79+
void removeAlarm();
7980

8081
void attachSecondsInterrupt(voidFuncPtr function);
8182
void detachSecondsInterrupt();
8283

83-
void attachAlarmInterrupt(voidFuncPtr function);
84+
void attachAlarmInterrupt(voidFuncPtr function);
8485
void attachAlarmInterrupt(voidFuncPtr function, time_t alarm_time);
8586
void detachAlarmInterrupt();
8687

0 commit comments

Comments
 (0)