diff options
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(); } |