easytimer-v1: Turn off HAS_IGNITE. Add custom flight file (stub for now)
authorKeith Packard <keithp@keithp.com>
Wed, 8 Apr 2020 22:19:06 +0000 (15:19 -0700)
committerKeith Packard <keithp@keithp.com>
Wed, 8 Apr 2020 22:20:41 +0000 (15:20 -0700)
Signed-off-by: Keith Packard <keithp@keithp.com>
src/easytimer-v1/Makefile
src/easytimer-v1/ao_easytimer.c
src/easytimer-v1/ao_pins.h
src/easytimer-v1/ao_timer_flight.c [new file with mode: 0644]
src/kernel/ao_report.c

index 40efe22ee7c7ae33509ab876f801fc9972adcaec..1427bc75cfbef4d1730a4cae4c10887c0e8d7576 100644 (file)
@@ -60,6 +60,7 @@ ALTOS_SRC = \
        ao_report.c \
        ao_sample.c \
        ao_kalman.c \
+       ao_timer_flight.c \
        $(PROFILE) \
        $(SAMPLE_PROFILE) \
        $(STACK_GUARD)
index a4a6e64e403cca9fe4eaeee14eae70d9cf9a56b9..71191572d088cf5ba3e5b1e3283f72180e14d89d 100644 (file)
@@ -54,7 +54,7 @@ main(void)
 
        ao_eeprom_init();
 
-       ao_storage_init();
+//     ao_storage_init();
 
        // ao_flight_init();
        // ao_log_init();
index bdacd0e47c905b63a69d48fe62b35da8393bf22b..4842e94b6852f845963c5dcc9b8c0edb144a6277 100644 (file)
  * Igniter
  */
 
-#define HAS_IGNITE             1
-#define HAS_IGNITE_REPORT      1
+#define HAS_IGNITE             0
+#define HAS_IGNITE_REPORT      0
 
 #define AO_SENSE_PYRO(p,n)     ((p)->adc.sense[n])
 #define AO_IGNITER_CLOSED      400
diff --git a/src/easytimer-v1/ao_timer_flight.c b/src/easytimer-v1/ao_timer_flight.c
new file mode 100644 (file)
index 0000000..23e2e90
--- /dev/null
@@ -0,0 +1,23 @@
+/*
+ * Copyright © 2020 Keith Packard <keithp@keithp.com>
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+ */
+
+#include "ao.h"
+#include <ao_flight.h>
+#include <ao_sample.h>
+
+enum ao_flight_state   ao_flight_state;        /* current flight state */
index 12c3a1e90acabb589114ed786edb08caf9a7c0fb..75f0fcb29fbf594cbe31ea0038f3ef494104ccfa 100644 (file)
@@ -40,6 +40,8 @@ static const uint8_t flight_reports[] = {
        MORSE4(1,0,0,1),        /* invalid 'X' */
 };
 
+static enum ao_flight_state ao_report_state;
+
 #if HAS_BEEP
 #define low(time)      ao_beep_for(AO_BEEP_LOW, time)
 #define mid(time)      ao_beep_for(AO_BEEP_MID, time)
@@ -58,8 +60,6 @@ static const uint8_t flight_reports[] = {
 #endif
 #define pause(time)    ao_delay(time)
 
-static enum ao_flight_state ao_report_state;
-
 /*
  * Farnsworth spacing
  *
@@ -115,7 +115,7 @@ static enum ao_flight_state ao_report_state;
  */
 
 static void
-ao_report_beep(void) 
+ao_report_flight_state(void) 
 {
        uint8_t r = flight_reports[ao_flight_state];
        uint8_t l = r & 7;
@@ -206,13 +206,8 @@ ao_report_igniter(void)
 static void
 ao_report_continuity(void) 
 {
-       uint8_t c;
-
-#if !HAS_IGNITE
-       if (!ao_igniter_present)
-               return;
-#endif
-       c = ao_report_igniter();
+#if HAS_IGNITE
+       uint8_t c = ao_report_igniter();
        if (c) {
                while (c--) {
                        high(AO_MS_TO_TICKS(25));
@@ -225,8 +220,11 @@ ao_report_continuity(void)
                        low(AO_MS_TO_TICKS(20));
                }
        }
+#endif
 #if AO_PYRO_NUM
+#if HAS_IGNITE
        pause(AO_MS_TO_TICKS(250));
+#endif
        for(c = 0; c < AO_PYRO_NUM; c++) {
                enum ao_igniter_status  status = ao_pyro_status(c);
                if (status == ao_igniter_ready)
@@ -261,7 +259,7 @@ ao_report(void)
                        ao_report_battery();
                else
 #endif
-                       ao_report_beep();
+                       ao_report_flight_state();
 #if HAS_SENSOR_ERRORS
                if (ao_report_state == ao_flight_invalid && ao_sensor_errors)
                        ao_report_number(ao_sensor_errors);