From: Keith Packard Date: Wed, 8 Apr 2020 22:19:06 +0000 (-0700) Subject: easytimer-v1: Turn off HAS_IGNITE. Add custom flight file (stub for now) X-Git-Url: https://git.gag.com/?a=commitdiff_plain;h=6b439a4c90e434e5471c7499e30f164c6958ca40;p=fw%2Faltos easytimer-v1: Turn off HAS_IGNITE. Add custom flight file (stub for now) Signed-off-by: Keith Packard --- diff --git a/src/easytimer-v1/Makefile b/src/easytimer-v1/Makefile index 40efe22e..1427bc75 100644 --- a/src/easytimer-v1/Makefile +++ b/src/easytimer-v1/Makefile @@ -60,6 +60,7 @@ ALTOS_SRC = \ ao_report.c \ ao_sample.c \ ao_kalman.c \ + ao_timer_flight.c \ $(PROFILE) \ $(SAMPLE_PROFILE) \ $(STACK_GUARD) diff --git a/src/easytimer-v1/ao_easytimer.c b/src/easytimer-v1/ao_easytimer.c index a4a6e64e..71191572 100644 --- a/src/easytimer-v1/ao_easytimer.c +++ b/src/easytimer-v1/ao_easytimer.c @@ -54,7 +54,7 @@ main(void) ao_eeprom_init(); - ao_storage_init(); +// ao_storage_init(); // ao_flight_init(); // ao_log_init(); diff --git a/src/easytimer-v1/ao_pins.h b/src/easytimer-v1/ao_pins.h index bdacd0e4..4842e94b 100644 --- a/src/easytimer-v1/ao_pins.h +++ b/src/easytimer-v1/ao_pins.h @@ -115,8 +115,8 @@ * 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 index 00000000..23e2e90d --- /dev/null +++ b/src/easytimer-v1/ao_timer_flight.c @@ -0,0 +1,23 @@ +/* + * Copyright © 2020 Keith Packard + * + * 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 +#include + +enum ao_flight_state ao_flight_state; /* current flight state */ diff --git a/src/kernel/ao_report.c b/src/kernel/ao_report.c index 12c3a1e9..75f0fcb2 100644 --- a/src/kernel/ao_report.c +++ b/src/kernel/ao_report.c @@ -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);