diff options
author | Alexsander Akers <me@a2.io> | 2022-01-27 11:23:14 -0500 |
---|---|---|
committer | Alexsander Akers <me@a2.io> | 2022-01-27 12:06:06 -0500 |
commit | a559d089f1845fb23434739f66b7bb5288191139 (patch) | |
tree | 7c1f628826078f2c604c86d4917ab36153917be3 /watch-library/simulator/watch | |
parent | d3e484dc989a6e3a040b5b1092340973d9b4e22f (diff) | |
download | Sensor-Watch-a559d089f1845fb23434739f66b7bb5288191139.tar.gz Sensor-Watch-a559d089f1845fb23434739f66b7bb5288191139.tar.bz2 Sensor-Watch-a559d089f1845fb23434739f66b7bb5288191139.zip |
Add new function to disable certain RTC periodic callbacks
Diffstat (limited to 'watch-library/simulator/watch')
-rw-r--r-- | watch-library/simulator/watch/watch_rtc.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/watch-library/simulator/watch/watch_rtc.c b/watch-library/simulator/watch/watch_rtc.c index 1fe6a78b..2cae701d 100644 --- a/watch-library/simulator/watch/watch_rtc.c +++ b/watch-library/simulator/watch/watch_rtc.c @@ -113,15 +113,19 @@ void watch_rtc_disable_periodic_callback(uint8_t frequency) { } } -void watch_rtc_disable_all_periodic_callbacks(void) { +void watch_rtc_disable_matching_periodic_callbacks(uint8_t mask) { for (int i = 0; i < 8; i++) { - if (tick_callbacks[i] != -1) { + if (tick_callbacks[i] != -1 && (mask & (1 << i)) != 0) { emscripten_clear_interval(tick_callbacks[i]); tick_callbacks[i] = -1; } } } +void watch_rtc_disable_all_periodic_callbacks(void) { + watch_rtc_disable_matching_periodic_callbacks(0xFF); +} + static void watch_invoke_alarm_interval_callback(void *userData) { if (alarm_callback) alarm_callback(); } |