altos: Allow any stdio to be used with packet forwarding
authorKeith Packard <keithp@keithp.com>
Fri, 1 Apr 2011 21:08:37 +0000 (14:08 -0700)
committerKeith Packard <keithp@keithp.com>
Fri, 1 Apr 2011 21:08:37 +0000 (14:08 -0700)
There's no reason to restrict packet forwarding to work only from
USB.

Signed-off-by: Keith Packard <keithp@keithp.com>
src/ao_packet_master.c

index 069bc5df4044f9fadb2c1e6e1f6e0a1a2894b0aa..e721ffba39c948a0d17a5fc35cf45ccfec664eea 100644 (file)
@@ -26,7 +26,7 @@ ao_packet_getchar(void) __critical
                        break;
                if (ao_packet_master_sleeping)
                        ao_wakeup(&ao_packet_master_sleeping);
-               ao_usb_flush();
+               flush();
                ao_sleep(&ao_stdin_ready);
        }
        return c;
@@ -39,7 +39,7 @@ ao_packet_echo(void) __reentrant
        while (ao_packet_enable) {
                c = ao_packet_getchar();
                if (c != AO_READ_AGAIN)
-                       ao_usb_putchar(c);
+                       putchar(c);
        }
        ao_exit();
 }
@@ -112,7 +112,7 @@ ao_packet_forward(void) __reentrant
        ao_set_monitor(0);
        ao_add_task(&ao_packet_task, ao_packet_master, "master");
        ao_add_task(&ao_packet_echo_task, ao_packet_echo, "echo");
-       while ((c = ao_usb_getchar()) != '~') {
+       while ((c = getchar()) != '~') {
                if (c == '\r') c = '\n';
                ao_packet_putchar(c);
        }