From 60914647b1edd721799aa501e81e3bd256e99fe9 Mon Sep 17 00:00:00 2001 From: Joey Castillo Date: Thu, 15 May 2025 22:12:12 -0400 Subject: [PATCH] watch_rtc clarification: 128 Hz is 0x80, not 0xF0 --- watch-library/hardware/watch/watch_rtc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/watch-library/hardware/watch/watch_rtc.c b/watch-library/hardware/watch/watch_rtc.c index 66fd4ebe..820a48f3 100644 --- a/watch-library/hardware/watch/watch_rtc.c +++ b/watch-library/hardware/watch/watch_rtc.c @@ -71,7 +71,7 @@ void watch_rtc_register_periodic_callback(watch_cb_t callback, uint8_t frequency // this left-justifies the period in a 32-bit integer. uint32_t tmp = (frequency & 0xFF) << 24; // now we can count the leading zeroes to get the value we need. - // 0x01 (1 Hz) will have 7 leading zeros for PER7. 0xF0 (128 Hz) will have no leading zeroes for PER0. + // 0x01 (1 Hz) will have 7 leading zeros for PER7. 0x80 (128 Hz) will have no leading zeroes for PER0. uint8_t per_n = __builtin_clz(tmp); // this also maps nicely to an index for our list of tick callbacks.