altos: Add bit-bang i2c driver
[fw/altos] / src / kernel / ao_tracker.c
index 46278530843cf36d527297acc0b93e1be1004bdd..0f2491031e8e2d0de8774e2ba1ab96f4d70e9b47 100644 (file)
@@ -30,7 +30,7 @@ static uint8_t                ao_tracker_force_telem;
 static inline uint8_t
 ao_usb_connected(void)
 {
-       return ao_gpio_get(AO_USB_CONNECT_PORT, AO_USB_CONNECT_PIN, AO_USB_CONNECT) != 0;
+       return ao_gpio_get(AO_USB_CONNECT_PORT, AO_USB_CONNECT_PIN) != 0;
 }
 #else
 #define ao_usb_connected()     1
@@ -134,7 +134,7 @@ ao_tracker(void)
                                                height = -height;
 
                                        if (ao_tracker_force_telem > 1)
-                                               printf("head %d ring %d ground_distance %d height %d\n", gps_head, ring, ground_distance, height);
+                                               printf("head %d ring %d ground_distance %ld height %d\n", gps_head, ring, (long) ground_distance, height);
                                        if (ground_distance > ao_config.tracker_motion ||
                                            height > (ao_config.tracker_motion << 1))
                                        {
@@ -211,9 +211,9 @@ static struct ao_task ao_tracker_task;
 static void
 ao_tracker_set_telem(void)
 {
-       ao_cmd_hex();
+       uint16_t r = ao_cmd_hex();
        if (ao_cmd_status == ao_cmd_success)
-               ao_tracker_force_telem = ao_cmd_lex_i;
+               ao_tracker_force_telem = r;
        ao_cmd_status = ao_cmd_success;
        printf ("flight: %d\n", ao_flight_number);
        printf ("force_telem: %d\n", ao_tracker_force_telem);