From c13e5bd0eaab52e746c797ea7fd2702abb5d36fd Mon Sep 17 00:00:00 2001 From: Richard Meadows Date: Sun, 24 Apr 2016 19:55:58 +0100 Subject: [PATCH] [ariss] don't use predict, just try ariss 1-in-4 times when there's power --- firmware/Pre-flight.md | 3 +++ firmware/inc/hw_config/low-power-solar.h | 1 - firmware/src/sequencer.c | 11 +++++------ 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/firmware/Pre-flight.md b/firmware/Pre-flight.md index 8f1afbd..fdf7c86 100644 --- a/firmware/Pre-flight.md +++ b/firmware/Pre-flight.md @@ -17,7 +17,10 @@ - `RF_TX_ENABLE` is set - `APRS_ENABLE` is set if APRS is to be used on the flight - `APRS_USE_GEOFENCE` is set + - `TELEMETRY_ENABLE` is set - `TELEMETRY_USE_GEOFENCE` is set + - `ARISS_ENABLE` is set if ARISS is to be used on the flight + - `ARISS_USE_GEOFENCE` is set - `GEOFENCE_USE_PREFIX` is set - Check the `COLD_OUT` parameters. These prevent start-up spikes when the battery may not be viable. - Check the correct barometer is defined, for instance `BAROMETER_TYPE_MS5607` is set. diff --git a/firmware/inc/hw_config/low-power-solar.h b/firmware/inc/hw_config/low-power-solar.h index afb46e9..a768328 100644 --- a/firmware/inc/hw_config/low-power-solar.h +++ b/firmware/inc/hw_config/low-power-solar.h @@ -242,7 +242,6 @@ * Geofence used is only "no aprs" */ #define ARISS_ENABLE 0 -#define ARISS_USE_PREDICT 0 #define ARISS_USE_GEOFENCE 0 #define ARISS_FREQUENCY 145825000 diff --git a/firmware/src/sequencer.c b/firmware/src/sequencer.c index 80a2d77..6462393 100644 --- a/firmware/src/sequencer.c +++ b/firmware/src/sequencer.c @@ -33,6 +33,7 @@ #include "backlog.h" #include "location.h" #include "accumulator.h" +#include "battery.h" void rtty_telemetry(struct tracker_datapoint* dp); @@ -91,11 +92,11 @@ void telemetry_sequence(struct tracker_datapoint* dp, uint32_t n) /* ARISS */ #if ARISS_ENABLE -#if ARISS_USE_PREDICT - if (true) { /* todo */ -#endif + if ((get_battery_use_state() == BATTERY_GOOD) && /* battery good, */ + (get_battery_charge_state() == BATTERY_CHARGING) && /* receiving power and */ + ((n % 4) == 0)) { /* one-in-four times */ #if ARISS_USE_GEOFENCE - if (location_aprs_could_tx()) { /* transmit anywhere it's no disallowed */ + if (location_aprs_could_tx()) { /* transmit anywhere it's not disallowed */ #endif /* ARISS */ @@ -104,9 +105,7 @@ void telemetry_sequence(struct tracker_datapoint* dp, uint32_t n) #if ARISS_USE_GEOFENCE } #endif -#if ARISS_USE_PREDICT } -#endif #endif /* ARISS_ENABLE */