Add new function to disable certain RTC periodic callbacks

This commit is contained in:
Alexsander Akers
2022-01-27 11:23:14 -05:00
parent d3e484dc98
commit a559d089f1
4 changed files with 17 additions and 10 deletions

View File

@@ -155,13 +155,7 @@ void movement_request_tick_frequency(uint8_t freq) {
if (freq == 128) return; // Movement uses the 128 Hz tick internally
// disable all callbacks except the 128 Hz one
#if __EMSCRIPTEN__
for (int i = 1; i < 128; i = i << 1) {
watch_rtc_disable_periodic_callback(i);
}
#else
RTC->MODE2.INTENCLR.reg = 0xFE;
#endif
watch_rtc_disable_matching_periodic_callbacks(0b01111111);
movement_state.subsecond = 0;
movement_state.tick_frequency = freq;