ao-tools: Add lots of compiler warning flags to ao-tools build
[fw/altos] / ao-tools / ao-dbg / ao-dbg-parse.c
index 5db6c01c1e9dc2bbc3bb7fe3649537c52df63dfc..ba69183431c823f508bb318afff89c291ee77abc 100644 (file)
@@ -195,11 +195,14 @@ command_read (void)
        enum command_result result;
        struct command_function *func;
 
-       s51_dbg = ccdbg_open ();
-       if (!s51_dbg) {
-               perror("ccdbg_open");
-               exit(1);
+       if (!s51_tty) {
+               if (!s51_device)
+                       s51_device = getenv("AO_DBG_DEVICE");
+               s51_tty = cc_usbdevs_find_by_arg(s51_device, "TeleDongle");
        }
+       s51_dbg = ccdbg_open (s51_tty);
+       if (!s51_dbg)
+               exit(1);
        ccdbg_debug_mode(s51_dbg);
        ccdbg_halt(s51_dbg);
        s51_printf("Welcome to the non-simulated processor\n");