]> git.earman.xyz Git - sensor-watch.git/commitdiff
enable filtering on button inputs
authorJoey Castillo <joeycastillo@utexas.edu>
Tue, 13 May 2025 02:25:27 +0000 (22:25 -0400)
committerJoey Castillo <joeycastillo@utexas.edu>
Tue, 13 May 2025 02:25:27 +0000 (22:25 -0400)
gossamer
movement.c
watch-library/hardware/watch/watch_extint.c

index a82c20e78049a477236f795506c73f7c9d210394..16e66f04b31d49f1f5fc67aeff5d61e9bdbbe5ca 160000 (submodule)
--- a/gossamer
+++ b/gossamer
@@ -1 +1 @@
-Subproject commit a82c20e78049a477236f795506c73f7c9d210394
+Subproject commit 16e66f04b31d49f1f5fc67aeff5d61e9bdbbe5ca
index 6f366b906fb0fa5a06e459a700e1ccf6ff7917a1..15f74eddadf690dd7ca4606b9ff8815eca092b80 100644 (file)
@@ -719,7 +719,7 @@ void app_setup(void) {
             lis2dw_configure_int1(LIS2DW_CTRL4_INT1_6D);
             HAL_GPIO_A3_in();
             HAL_GPIO_A3_pmuxen(HAL_GPIO_PMUX_EIC);
-            eic_configure_pin(HAL_GPIO_A3_pin(), INTERRUPT_TRIGGER_RISING);
+            eic_configure_pin(HAL_GPIO_A3_pin(), INTERRUPT_TRIGGER_RISING, false);
             // but rather than hooking it up to an interrupt callback, we'll have it trigger an event.
             eic_enable_event(HAL_GPIO_A3_pin());
 
index 9c07baabe0384e28ba48b382ea4f8dc31716d30b..d5b6ffc75fdca3ac6d0b005e17e5eacf34b6763b 100644 (file)
@@ -43,14 +43,16 @@ void watch_disable_external_interrupts(void) {
 
 void watch_register_interrupt_callback(const uint8_t pin, watch_cb_t callback, eic_interrupt_trigger_t trigger) {
     watch_enable_digital_input(pin);
+    bool filten = false;
 
     // check if this is a button pin
     if (pin == HAL_GPIO_BTN_LIGHT_pin() || pin == HAL_GPIO_BTN_MODE_pin() || pin == HAL_GPIO_BTN_ALARM_pin()) {
         // if so, enable the pull-down resistor
         watch_enable_pull_down(pin);
+        filten = true;
     }
 
-    int8_t channel = eic_configure_pin(pin, trigger);
+    int8_t channel = eic_configure_pin(pin, trigger, filten);
     if (channel >= 0 && channel < 16) {
         printf("Configured port %d pin %d on channel %d\n", pin >> 5, pin & 0x1F, channel);
         eic_enable_interrupt(pin);