#define HAS_USB_VBUS 0
#define HAS_USB_PULLUP 1
#define AO_USB_PULLUP_PORT 0
-/* #define AO_USB_PULLUP_PIN 20 */
-/* following is for use of fctester proto as development device */
-#define AO_USB_PULLUP_PIN 6
+#define AO_USB_PULLUP_PIN 20
/* USART */
#include <ao_serial.h>
static struct ao_task ao_console_read_task;
+static struct ao_task ao_console_write_task;
static void
ao_console_read(void)
{
- int c;
+ int c;
for (;;) {
ao_arch_block_interrupts();
c = _ao_serial0_pollchar();
}
}
+static void
+ao_console_write(void)
+{
+ char c;
+ for (;;) {
+ c = ao_usb_getchar();
+ ao_serial0_putchar(c);
+ }
+}
+
int
main(void)
{
ao_serial_init();
ao_serial0_set_speed(AO_SERIAL_SPEED_115200);
- ao_cmd_init();
+ /* the command interpreter could interfere with usb -> serial */
+ /* ao_cmd_init(); */
ao_add_task(&ao_console_read_task, ao_console_read, "console_read");
+ ao_add_task(&ao_console_write_task, ao_console_write, "console_write");
ao_start_scheduler();
return 0;