X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=ao-tools%2Fao-view%2Faoview_monitor.c;h=c7f170453b11910c22a4815ae252fb9e834b2215;hb=HEAD;hp=4d7e7a9ffc5a50c7c33d6857545e1742fdae9617;hpb=d6ba07e885bdc62ba64719c9d8cc42fcecbcb09d;p=fw%2Faltos diff --git a/ao-tools/ao-view/aoview_monitor.c b/ao-tools/ao-view/aoview_monitor.c index 4d7e7a9f..c7f17045 100644 --- a/ao-tools/ao-view/aoview_monitor.c +++ b/ao-tools/ao-view/aoview_monitor.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 @@ -83,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 @@ -98,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;