void
ao_usb_enable(void)
{
- uint16_t tick;
+ int t;
/* Enable SYSCFG */
stm_rcc.apb2enr |= (1 << STM_RCC_APB2ENR_SYSCFGEN);
(0 << STM_USB_CNTR_PDWN) |
(0 << STM_USB_CNTR_FRES));
+ for (t = 0; t < 1000; t++)
+ ao_arch_nop();
/* Enable USB pull-up */
stm_syscfg.pmc |= (1 << STM_SYSCFG_PMC_USB_PU);
}
}
#endif
+#if USB_DEBUG
static void
ao_usb_irq(void)
{
{ ao_usb_irq, "I\0Show USB interrupt counts" },
{ 0, NULL }
};
+#endif
void
ao_usb_init(void)
#if USB_ECHO
ao_add_task(&ao_usb_echo_task, ao_usb_echo, "usb echo");
#endif
+#if USB_DEBUG
ao_cmd_register(&ao_usb_cmds[0]);
+#endif
#if !USB_ECHO
ao_add_stdio(ao_usb_pollchar, ao_usb_putchar, ao_usb_flush);
#endif