projects
/
fw
/
altos
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
altos: Add debug to tracker to force launch
[fw/altos]
/
src
/
product
/
ao_tracker.c
diff --git
a/src/product/ao_tracker.c
b/src/product/ao_tracker.c
index d4960d258081a0b0e8223baab5df493c2cfe83af..c1c3366cf08b6c25e4efac94d4f353bdff0773f5 100644
(file)
--- a/
src/product/ao_tracker.c
+++ b/
src/product/ao_tracker.c
@@
-26,6
+26,7
@@
enum ao_flight_state ao_flight_state;
#define AO_TRACKER_NOT_MOVING 200
static uint8_t ao_tracker_force_telem;
#define AO_TRACKER_NOT_MOVING 200
static uint8_t ao_tracker_force_telem;
+static uint8_t ao_tracker_force_launch;
#if HAS_USB_CONNECT
static inline uint8_t
#if HAS_USB_CONNECT
static inline uint8_t
@@
-97,16
+98,19
@@
ao_tracker(void)
break;
case ao_flight_pad:
ground_distance = ao_distance(ao_gps_data.latitude,
break;
case ao_flight_pad:
ground_distance = ao_distance(ao_gps_data.latitude,
- start_latitude,
ao_gps_data.longitude,
ao_gps_data.longitude,
+ start_latitude,
start_longitude);
height = ao_gps_data.altitude - start_altitude;
if (height < 0)
height = -height;
start_longitude);
height = ao_gps_data.altitude - start_altitude;
if (height < 0)
height = -height;
+
if (ground_distance >= ao_config.tracker_start_horiz ||
if (ground_distance >= ao_config.tracker_start_horiz ||
- height >= ao_config.tracker_start_vert)
+ height >= ao_config.tracker_start_vert ||
+ ao_tracker_force_launch)
{
ao_flight_state = ao_flight_drogue;
{
ao_flight_state = ao_flight_drogue;
+ ao_wakeup(&ao_flight_state);
ao_log_start();
}
break;
ao_log_start();
}
break;
@@
-155,8
+159,11
@@
static void
ao_tracker_set_telem(void)
{
ao_cmd_hex();
ao_tracker_set_telem(void)
{
ao_cmd_hex();
- if (ao_cmd_status == ao_cmd_success)
- ao_tracker_force_telem = ao_cmd_lex_i;
+ if (ao_cmd_status == ao_cmd_success) {
+ ao_tracker_force_telem = (ao_cmd_lex_i & 1) != 0;
+ ao_tracker_force_launch = (ao_cmd_lex_i & 2) != 0;
+ printf ("force telem %d force launch %d\n", ao_tracker_force_telem, ao_tracker_force_launch);
+ }
}
static const struct ao_cmds ao_tracker_cmds[] = {
}
static const struct ao_cmds ao_tracker_cmds[] = {