]> git.earman.xyz Git - sensor-watch.git/commitdiff
lol, GCLK3 is 1024 Hz in gossamer
authorjoeycastillo <joeycastillo@utexas.edu>
Sun, 29 Sep 2024 16:27:20 +0000 (12:27 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Sun, 29 Sep 2024 16:27:20 +0000 (12:27 -0400)
watch-library/hardware/watch/watch_tcc.c

index 0ce0df121bac5d8505f893792f37b108081410df..9ae82b9ae90a8a20208d6e15ba2773969af259b1 100644 (file)
@@ -57,10 +57,10 @@ static inline void _tc3_stop() {
 
 static void _tc3_initialize() {
     // setup and initialize TC3 for a 64 Hz interrupt
-    tc_init(3, GENERIC_CLOCK_3, TC_PRESCALER_DIV64);
+    tc_init(3, GENERIC_CLOCK_3, TC_PRESCALER_DIV2);
     tc_set_counter_mode(3, TC_COUNTER_MODE_8BIT);
     tc_set_run_in_standby(3, true);
-    tc_count8_set_period(3, 7); // 32 Khz divided by 64 divided by 8 equals 64 Hz
+    tc_count8_set_period(3, 7); // 1024 Hz divided by 2 divided by 8 equals 64 Hz
     /// FIXME: #SecondMovement, we need a gossamer wrapper for interrupts.
     TC3->COUNT8.INTENSET.bit.OVF = 1;
     NVIC_ClearPendingIRQ(TC3_IRQn);