X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao_tracker.h;h=7d534339808ef5950465acbc053cb0b884ce09c9;hb=188f9efadd480de872f86a8eb741e8738db84c6b;hp=63bdaf2fc6e91886917887a67d9c81c12da0f703;hpb=d165079b9275c69e727a1dac996ad1788c58ed40;p=fw%2Faltos diff --git a/src/kernel/ao_tracker.h b/src/kernel/ao_tracker.h index 63bdaf2f..7d534339 100644 --- a/src/kernel/ao_tracker.h +++ b/src/kernel/ao_tracker.h @@ -3,7 +3,8 @@ * * 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; version 2 of the License. + * 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 @@ -18,33 +19,20 @@ #ifndef _AO_TRACKER_H_ #define _AO_TRACKER_H_ -#define AO_CONFIG_DEFAULT_TRACKER_START_HORIZ 1000 -#define AO_CONFIG_DEFAULT_TRACKER_START_VERT 100 +/* Any motion more than this will result in a log entry */ -/* Speeds for the various modes, 2m/s seems reasonable for 'not moving' */ -#define AO_TRACKER_NOT_MOVING 200 +#define AO_TRACKER_MOTION_DEFAULT 10 +#define AO_TRACKER_INTERVAL_DEFAULT 1 -extern int32_t ao_tracker_start_latitude; -extern int32_t ao_tracker_start_longitude; -extern int16_t ao_tracker_start_altitude; +#define AO_TRACKER_MOTION_COUNT 10 -#define AO_TRACKER_RING 4 - -struct ao_tracker_data { - uint16_t tick; - uint8_t new; - uint8_t state; - struct ao_telemetry_location gps_data; - struct ao_telemetry_satellite gps_tracking_data; -}; - -extern struct ao_tracker_data ao_tracker_data[AO_TRACKER_RING]; -extern uint8_t ao_tracker_head; +void +ao_tracker_init(void); -#define ao_tracker_ring_next(n) (((n) + 1) & (AO_TRACKER_RING-1)) -#define ao_tracker_ring_prev(n) (((n) - 1) & (AO_TRACKER_RING-1)) +void +ao_tracker_erase_start(uint16_t flight); void -ao_tracker_init(void); +ao_tracker_erase_end(void); #endif /* _AO_TRACKER_H_ */