diff options
Diffstat (limited to 'watch-library')
-rw-r--r-- | watch-library/shared/watch/watch_rtc.h | 3 | ||||
-rw-r--r-- | watch-library/simulator/watch/watch_rtc.c | 2 |
2 files changed, 3 insertions, 2 deletions
diff --git a/watch-library/shared/watch/watch_rtc.h b/watch-library/shared/watch/watch_rtc.h index b51d6c48..183e6dd0 100644 --- a/watch-library/shared/watch/watch_rtc.h +++ b/watch-library/shared/watch/watch_rtc.h @@ -138,7 +138,8 @@ void watch_rtc_register_periodic_callback(ext_irq_cb_t callback, uint8_t frequen void watch_rtc_disable_periodic_callback(uint8_t frequency); /** @brief Disables tick callbacks for the given periods (as a bitmask). - * @param mask The frequencies of tick callbacks you wish to disable, in Hz. To disable the 2 and 4 Hz callbacks, pass 0b00000110; + * @param mask The frequencies of tick callbacks you wish to disable, in Hz. + * The 128 Hz callback is 0b1, the 64 Hz callback is 0b10, the 32 Hz callback is 0b100, etc. */ void watch_rtc_disable_matching_periodic_callbacks(uint8_t mask); diff --git a/watch-library/simulator/watch/watch_rtc.c b/watch-library/simulator/watch/watch_rtc.c index 2cae701d..ea8659dc 100644 --- a/watch-library/simulator/watch/watch_rtc.c +++ b/watch-library/simulator/watch/watch_rtc.c @@ -115,7 +115,7 @@ void watch_rtc_disable_periodic_callback(uint8_t frequency) { void watch_rtc_disable_matching_periodic_callbacks(uint8_t mask) { for (int i = 0; i < 8; i++) { - if (tick_callbacks[i] != -1 && (mask & (1 << i)) != 0) { + if (tick_callbacks[i] != -1 && (mask & (1 << (7 - i))) != 0) { emscripten_clear_interval(tick_callbacks[i]); tick_callbacks[i] = -1; } |