altos: Force telemetry on by default for v0.3 TeleGPS boards
authorKeith Packard <keithp@keithp.com>
Fri, 6 Jun 2014 04:37:38 +0000 (21:37 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 6 Jun 2014 04:37:38 +0000 (21:37 -0700)
These don't have a USB connect indicator, so just turn on telemetry by
default

Signed-off-by: Keith Packard <keithp@keithp.com>
src/product/ao_tracker.c

index 9666528b5a2475426355ff26a4ef7321557bc757..b207c56204d866fae30eb33e53b5c263223f46ab 100644 (file)
@@ -70,7 +70,7 @@ ao_tracker(void)
 {
        uint16_t        telem_rate = AO_SEC_TO_TICKS(1), new_telem_rate;
        uint8_t         gps_rate = 1, new_gps_rate;
 {
        uint16_t        telem_rate = AO_SEC_TO_TICKS(1), new_telem_rate;
        uint8_t         gps_rate = 1, new_gps_rate;
-       uint8_t         telem_enabled = 1, new_telem_enabled;
+       uint8_t         telem_enabled = 0, new_telem_enabled;
        int32_t         start_latitude = 0, start_longitude = 0;
        int16_t         start_altitude = 0;
        uint32_t        ground_distance;
        int32_t         start_latitude = 0, start_longitude = 0;
        int16_t         start_altitude = 0;
        uint32_t        ground_distance;
@@ -84,6 +84,10 @@ ao_tracker(void)
        ao_timer_set_adc_interval(100);
 #endif
 
        ao_timer_set_adc_interval(100);
 #endif
 
+#if !HAS_USB_CONNECT
+       ao_tracker_force_telem = 1;
+#endif
+
        ao_log_scan();
 
        ao_rdf_set(1);
        ao_log_scan();
 
        ao_rdf_set(1);
@@ -187,8 +191,9 @@ ao_tracker_set_telem(void)
        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;
        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);
        }
        }
+       printf ("flight %d force telem %d force launch %d\n",
+               ao_flight_number, ao_tracker_force_telem, ao_tracker_force_launch);
 }
 
 static const struct ao_cmds ao_tracker_cmds[] = {
 }
 
 static const struct ao_cmds ao_tracker_cmds[] = {