*
* 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
USBCS0 = cs0;
}
-__xdata static struct ao_usb_line_coding ao_usb_line_coding = {115200, 0, 0, 8};
+__xdata struct ao_usb_line_coding ao_usb_line_coding = {115200, 0, 0, 8};
/* Walk through the list of descriptors and find a match
*/
ao_usb_ep0_in_len = ao_usb_setup.length;
ao_usb_ep0_flush();
} else if (ao_usb_ep0_out_len) {
-
+
/* Receiving data from the host
*/
ao_usb_ep0_state = AO_USB_EP0_DATA_OUT;
USBCIF = 0;
USBOIF = 0;
USBIIF = 0;
+#if HAS_USB_PULLUP
+ ao_gpio_set(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0);
+#endif
}
void
USBCIE = 0;
IEN2 &= ~IEN2_USBIE;
+#if HAS_USB_PULLUP
+ ao_gpio_set(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0);
+#endif
+
/* Clear any pending interrupts */
USBCIF = 0;
USBOIF = 0;
void
ao_usb_init(void)
{
+#if HAS_USB_PULLUP
+ ao_enable_output(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0);
+#endif
ao_usb_enable();
ao_add_task(&ao_usb_task, ao_usb_ep0, "usb");