From: Joey Castillo Date: Fri, 16 May 2025 02:12:12 +0000 (-0400) Subject: watch_rtc clarification: 128 Hz is 0x80, not 0xF0 X-Git-Url: https://git.earman.xyz/?a=commitdiff_plain;h=60914647b1edd721799aa501e81e3bd256e99fe9;p=sensor-watch.git watch_rtc clarification: 128 Hz is 0x80, not 0xF0 --- diff --git a/watch-library/hardware/watch/watch_rtc.c b/watch-library/hardware/watch/watch_rtc.c index 66fd4eb..820a48f 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.