From 7b985a2593f5f5235fb2af70290509e978edf1f9 Mon Sep 17 00:00:00 2001 From: Richard Meadows Date: Tue, 26 Apr 2016 09:16:16 +0100 Subject: [PATCH] [battery] move battery update to the end of the sequence If we don't have enough power to run *and* charge the battery then at least some charging will be done bfore a power reset --- firmware/src/data.c | 6 ------ firmware/src/sequencer.c | 3 +++ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/firmware/src/data.c b/firmware/src/data.c index 49fd6d7..35e71be 100644 --- a/firmware/src/data.c +++ b/firmware/src/data.c @@ -30,7 +30,6 @@ #include "hw_config.h" #include "analogue.h" #include "barometer.h" -#include "battery.h" #include "gps.h" #include "ubx_messages.h" #include "telemetry.h" @@ -110,11 +109,6 @@ struct tracker_datapoint* collect_data(void) datapoint.bmp180_temperature = (float)b->temperature; #endif - /** - * ---- Battery ---- - */ - update_battery(&datapoint); - #ifdef GPS_TYPE_UBX /** * ---- GPS UBX ---- diff --git a/firmware/src/sequencer.c b/firmware/src/sequencer.c index 6462393..55a63a9 100644 --- a/firmware/src/sequencer.c +++ b/firmware/src/sequencer.c @@ -146,4 +146,7 @@ void run_sequencer(uint32_t n, uint32_t cycle_time_s) record_backlog(dp); } } + + /* Battery */ + update_battery(dp); }