altoslib: Fetch target device config for Fire Igniter npyro value
[fw/altos] / ao-tools / ao-send-telem / ao-send-telem.c
index c6cc51a160227f7e3c9d7620f432fb388043a6db..3db44542e3095d64fd4afd42867696eb6a6a5275 100644 (file)
@@ -199,7 +199,7 @@ main (int argc, char **argv)
                exit (1);
 
        cc_usb_printf(cc, "m 0\n");
-       cc_usb_printf(cc, "F %d\n", freq);
+       cc_usb_printf(cc, "F %d\n", freq);
        for (i = optind; i < argc; i++) {
                file = fopen(argv[i], "r");
                if (!file) {
@@ -224,8 +224,10 @@ main (int argc, char **argv)
                                        last_tick = telem.generic.tick;
                                        send_telem(cc, &telem);
                                } else {
+                                       enum ao_flight_state state = packet_state(&telem);
                                        add_telem(&telem);
-                                       if (packet_state(&telem) > ao_flight_pad) {
+                                       if (ao_flight_pad < state && state < ao_flight_landed) {
+                                               printf ("started\n");
                                                started = 1;
                                                last_tick = send_queued(cc, realtime);
                                        }