altos: Add quadrature debouncing and make ADC optional for LCO boxes
authorKeith Packard <keithp@keithp.com>
Sun, 17 Jun 2018 07:23:05 +0000 (00:23 -0700)
committerKeith Packard <keithp@keithp.com>
Sun, 17 Jun 2018 07:23:05 +0000 (00:23 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
src/drivers/ao_lco.c
src/telelco-v0.2/ao_pins.h
src/telelco-v0.3/ao_pins.h

index f0f518aa9b51ebeb1e203404667bbd1db890f85b..91a0593ff0dace703def84d427941d41b4c0ece3 100644 (file)
@@ -26,9 +26,6 @@
 #if HAS_ADC_SINGLE
 #include <ao_adc_single.h>
 #endif
-#if HAS_ADC
-#include <ao_adc.h>
-#endif
 
 #define DEBUG  1
 
@@ -663,6 +660,7 @@ ao_lco_display_test()
        ao_led_off(LEDS_AVAILABLE);
 }
 
+#if HAS_ADC_SINGLE
 static void
 ao_lco_batt_voltage(void)
 {
@@ -674,6 +672,7 @@ ao_lco_batt_voltage(void)
        ao_lco_set_voltage(decivolt);
        ao_delay(AO_MS_TO_TICKS(1000));
 }
+#endif
 
 static struct ao_task ao_lco_input_task;
 static struct ao_task ao_lco_monitor_task;
@@ -687,7 +686,9 @@ ao_lco_monitor(void)
        uint8_t                 box;
 
        ao_lco_display_test();
+#if HAS_ADC_SINGLE
        ao_lco_batt_voltage();
+#endif
        ao_lco_search();
        ao_add_task(&ao_lco_input_task, ao_lco_input, "lco input");
        ao_add_task(&ao_lco_arm_warn_task, ao_lco_arm_warn, "lco arm warn");
index b90fca8b7bcdd4b38cadfeaf18bd3878bc868fee..f0da4fe448a9625d79d37ed54dfbef585630eea3 100644 (file)
 #define AO_QUADRATURE_1_B      0
 
 #define AO_QUADRATURE_BOX      1
+#define AO_QUADRATURE_DEBOUNCE 10
 
 /*
  * Buttons
index 6fd897a0011c821a6d960cdd60f4099d4d10a981..6023739cb182f7d5e38ad5b5e726cb1e967bd5d9 100644 (file)
 #define AO_QUADRATURE_1_B      0
 
 #define AO_QUADRATURE_BOX      1
+#define AO_QUADRATURE_DEBOUNCE 10
 
 /*
  * Buttons