X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fkernel%2Fao_tracker.c;h=4abd309a99b1fa931c0f083f1e2e45606a0067c5;hb=bd489b96b060c8276bd7709ac55c306aad02374c;hp=d94340484a8221248d89068bad9320c141e3fbf0;hpb=34d5be68ca23e8beb05db9a480faef63ecc911d0;p=fw%2Faltos diff --git a/src/kernel/ao_tracker.c b/src/kernel/ao_tracker.c index d9434048..4abd309a 100644 --- a/src/kernel/ao_tracker.c +++ b/src/kernel/ao_tracker.c @@ -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 @@ -72,7 +73,7 @@ ao_tracker(void) #if !HAS_USB_CONNECT ao_tracker_force_telem = 1; #endif - ao_log_scan(); + log_started = ao_log_scan(); ao_rdf_set(1); @@ -132,7 +133,7 @@ ao_tracker(void) if (height < 0) height = -height; - if (ao_tracker_force_telem) + if (ao_tracker_force_telem > 1) printf("head %d ring %d ground_distance %d height %d\n", gps_head, ring, ground_distance, height); if (ground_distance > ao_config.tracker_motion || height > (ao_config.tracker_motion << 1)) @@ -141,7 +142,7 @@ ao_tracker(void) break; } } - if (ao_tracker_force_telem) { + if (ao_tracker_force_telem > 1) { printf ("moving %d started %d\n", moving, log_started); flush(); } @@ -181,8 +182,7 @@ void ao_tracker_erase_end(void) { if (erasing_current) { - ao_log_scan(); - log_started = 0; + log_started = ao_log_scan(); ao_mutex_put(&tracker_mutex); } } @@ -192,11 +192,9 @@ static struct ao_task ao_tracker_task; static void ao_tracker_set_telem(void) { - uint8_t telem; ao_cmd_hex(); - telem = ao_cmd_lex_i; if (ao_cmd_status == ao_cmd_success) - ao_tracker_force_telem = telem; + ao_tracker_force_telem = ao_cmd_lex_i; ao_cmd_status = ao_cmd_success; printf ("flight: %d\n", ao_flight_number); printf ("force_telem: %d\n", ao_tracker_force_telem); @@ -212,7 +210,7 @@ ao_tracker_set_telem(void) } static const struct ao_cmds ao_tracker_cmds[] = { - { ao_tracker_set_telem, "t \0Set telem on USB" }, + { ao_tracker_set_telem, "t \0Set telem on USB (0 off, 1 on, 2 dbg)" }, { 0, NULL }, };