altos: Remove unused ao_adc_get from ao_adc_stm.c
[fw/altos] / ao-tools / ao-view / aoview_monitor.c
index 3d235e44f5d22d3db797b9c3c0b30fe85c6f0600..c7f170453b11910c22a4815ae252fb9e834b2215 100644 (file)
@@ -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
@@ -68,6 +69,7 @@ aoview_monitor_callback(gpointer user_data,
                                if (monitor_pos) {
                                        if (aoview_monitor_parse(monitor_line)) {
                                                aoview_log_set_serial(aostate.data.serial);
+                                               aoview_log_set_flight(aostate.data.flight);
                                                if (aoview_log_get_serial())
                                                        aoview_log_printf ("%s\n", monitor_line);
                                        }
@@ -82,8 +84,11 @@ aoview_monitor_callback(gpointer user_data,
 void
 aoview_monitor_set_channel(int channel)
 {
-       if (monitor_serial)
+       if (monitor_serial) {
+               aoview_serial_printf(monitor_serial, "m 0\n");
                aoview_serial_printf(monitor_serial, "c r %d\n", channel);
+               aoview_serial_printf(monitor_serial, "m 1\n");
+       }
 }
 
 gboolean
@@ -97,9 +102,7 @@ aoview_monitor_connect(char *tty)
        aoview_table_clear();
        aoview_state_reset();
        channel = aoview_channel_current();
-       if (channel >= 0)
-               aoview_monitor_set_channel(channel);
-       aoview_serial_printf(monitor_serial, "m 1\n");
+       aoview_monitor_set_channel(channel);
        aoview_serial_set_callback(monitor_serial,
                                   aoview_monitor_callback);
        return TRUE;