]> git.earman.xyz Git - sensor-watch.git/commitdiff
use gossamer calls for EVSYS and TC2 event actions
authorjoeycastillo <joeycastillo@utexas.edu>
Mon, 14 Oct 2024 16:37:57 +0000 (12:37 -0400)
committerjoeycastillo <joeycastillo@utexas.edu>
Mon, 14 Oct 2024 16:37:57 +0000 (12:37 -0400)
gossamer
movement.c
tinyusb

index 8372cef1687bd08af99fe47cc81b5523b7bcb645..5487c83df80be238a9e869e281201f4f122a0883 160000 (submodule)
--- a/gossamer
+++ b/gossamer
@@ -1 +1 @@
-Subproject commit 8372cef1687bd08af99fe47cc81b5523b7bcb645
+Subproject commit 5487c83df80be238a9e869e281201f4f122a0883
index 58e2a985f7602b447c6da9e4008215c6fd5a13d4..6c059d1c8e4706b52014e836f6cadb5cc1cf8d82 100644 (file)
@@ -42,6 +42,7 @@
 #include "zones.h"
 #include "lis2dw.h"
 #include "tc.h"
+#include "evsys.h"
 
 #include "movement_config.h"
 
@@ -639,13 +640,9 @@ void app_setup(void) {
             HAL_GPIO_A3_pmuxen(HAL_GPIO_PMUX_EIC);
             eic_configure_pin(HAL_GPIO_A3_pin(), INTERRUPT_TRIGGER_FALLING);
             eic_enable_event(HAL_GPIO_A3_pin());
-            EVSYS->USER[EVSYS_ID_USER_TC2_EVU].reg = EVSYS_USER_CHANNEL(0 + 1);
-            // Set up channel 0:
-            EVSYS->CHANNEL[0].reg = EVSYS_CHANNEL_EVGEN(EVSYS_ID_GEN_EIC_EXTINT_3) | // External interrupt 3 generates events on channel 0
-                                    EVSYS_CHANNEL_RUNSTDBY |                         // The channel should run in standby sleep mode...
-                                    EVSYS_CHANNEL_PATH_ASYNCHRONOUS;                 // on the asynchronous path (event drives action directly)
+            evsys_configure_channel(0, EVSYS_ID_GEN_EIC_EXTINT_3, EVSYS_ID_USER_TC2_EVU, true, true);
             tc_init(2, GENERIC_CLOCK_3, TC_PRESCALER_DIV1);
-            TC2->COUNT16.EVCTRL.reg = TC_EVCTRL_TCEI | TC_EVCTRL_EVACT_COUNT;   // Event 0 should increment the count
+            tc_set_event_action(2, TC_EVENT_ACTION_COUNT);
             tc_set_counter_mode(2, TC_COUNTER_MODE_16BIT);
             tc_enable(2);
 
diff --git a/tinyusb b/tinyusb
index a4fb8354e41b2604f66e7da22afa292b1a44f0a2..933ac29d77f54c68cbb41f09b74e78f868a2b4a7 160000 (submodule)
--- a/tinyusb
+++ b/tinyusb
@@ -1 +1 @@
-Subproject commit a4fb8354e41b2604f66e7da22afa292b1a44f0a2
+Subproject commit 933ac29d77f54c68cbb41f09b74e78f868a2b4a7