]> git.earman.xyz Git - sensor-watch.git/commitdiff
watch_rtc clarification: 128 Hz is 0x80, not 0xF0
authorJoey Castillo <joeycastillo@utexas.edu>
Fri, 16 May 2025 02:12:12 +0000 (22:12 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Fri, 16 May 2025 02:12:12 +0000 (22:12 -0400)
watch-library/hardware/watch/watch_rtc.c

index 66fd4ebe56762665bd3094c50d6e8639ad990e03..820a48f3486ea276c7fa56238e8df6b991156fc7 100644 (file)
@@ -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.