Merge remote branch 'origin/master'
authorKeith Packard <keithp@keithp.com>
Thu, 17 Jun 2010 04:52:23 +0000 (21:52 -0700)
committerKeith Packard <keithp@keithp.com>
Thu, 17 Jun 2010 04:52:23 +0000 (21:52 -0700)
ao-tools/ao-view/aoview_monitor.c
src/ao.h
src/ao_usb.c

index 4d7e7a9ffc5a50c7c33d6857545e1742fdae9617..1f9937b25dea5b520f221b4e5bf52f2ff8c16b88 100644 (file)
@@ -83,8 +83,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 +101,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;
index 97cb75ae59ca016f7f0c953c094827c134690360..a2dfadd00fb72438f302865cc73059eabd53e9d9 100644 (file)
--- a/src/ao.h
+++ b/src/ao.h
@@ -110,6 +110,7 @@ ao_start_scheduler(void);
 #define AO_PANIC_STDIO         7       /* Too many stdio handlers registered */
 #define AO_PANIC_REBOOT                8       /* Reboot failed */
 #define AO_PANIC_FLASH         9       /* Invalid flash part (or wrong blocksize) */
+#define AO_PANIC_USB           10      /* Trying to send USB packet while busy */
 
 /* Stop the operating system, beeping and blinking the reason */
 void
index e4af8e454625c87e1457b44475a33608d4155acb..d071fe6febfa8a7a41fc9d0e658774bb337f92e2 100644 (file)
@@ -85,7 +85,7 @@ ao_usb_ep0_flush(void)
        USBINDEX = 0;
        cs0 = USBCS0;
        if (cs0 & USBCS0_INPKT_RDY)
-               ao_panic(0);
+               ao_panic(AO_PANIC_USB);
 
        this_len = ao_usb_ep0_in_len;
        if (this_len > AO_USB_CONTROL_SIZE)