X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=src%2Flpc%2Fao_usb_lpc.c;h=9e94de12b1db05e8d3c4927eb6700a65103e028c;hb=f32488556ce25e439fbab941f8019db639824f98;hp=5c13eb4b40f9ceda4ea620f62606163842ea5c68;hpb=1085ec5d57e0ed5d132f2bbdac1a0b6a32c0ab4a;p=fw%2Faltos diff --git a/src/lpc/ao_usb_lpc.c b/src/lpc/ao_usb_lpc.c index 5c13eb4b..9e94de12 100644 --- a/src/lpc/ao_usb_lpc.c +++ b/src/lpc/ao_usb_lpc.c @@ -89,8 +89,6 @@ static uint8_t *ao_usb_out_rx_buffer[2]; static uint8_t ao_usb_out_rx_cur; static uint8_t ao_usb_rx_count, ao_usb_rx_pos; -extern struct lpc_usb_endpoint lpc_usb_endpoint; - /* Marks when we don't need to send an IN packet. * This happens only when the last IN packet is not full, * otherwise the host will expect to keep seeing packets. @@ -131,7 +129,7 @@ static inline uint32_t set_toggle(uint32_t current_value, * Set current device address and mark the * interface as active */ -void +static void ao_usb_set_address(uint8_t address) { debug("ao_usb_set_address %02x\n", address); @@ -477,7 +475,7 @@ ao_usb_ep0_in_start(uint16_t max) ao_usb_ep0_flush(); } -static struct ao_usb_line_coding ao_usb_line_coding = {115200, 0, 0, 8}; +struct ao_usb_line_coding ao_usb_line_coding = {115200, 0, 0, 8}; /* Walk through the list of descriptors and find a match */ @@ -813,7 +811,7 @@ _ao_usb_out_recv(void) ao_usb_set_epn_out(AO_USB_OUT_EP, ao_usb_out_rx_buffer[1-ao_usb_out_rx_cur], AO_USB_OUT_SIZE); } -int +static int _ao_usb_pollchar(void) { uint8_t c; @@ -857,7 +855,7 @@ ao_usb_disable(void) ao_arch_block_interrupts(); #if HAS_USB_PULLUP - ao_gpio_set(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0); + ao_gpio_set(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, 0); #endif /* Disable interrupts */ lpc_usb.inten = 0; @@ -975,7 +973,7 @@ ao_usb_enable(void) ao_usb_set_ep0(); #if HAS_USB_PULLUP - ao_gpio_set(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 1); + ao_gpio_set(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, 1); #endif } @@ -1003,7 +1001,7 @@ ao_usb_irq(void) control_count, out_count, in_count, int_count, reset_count); } -__code struct ao_cmds ao_usb_cmds[] = { +const struct ao_cmds ao_usb_cmds[] = { { ao_usb_irq, "I\0Show USB interrupt counts" }, { 0, NULL } }; @@ -1013,7 +1011,11 @@ void ao_usb_init(void) { #if HAS_USB_PULLUP - ao_enable_output(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, AO_USB_PULLUP, 0); + int i; + ao_enable_output(AO_USB_PULLUP_PORT, AO_USB_PULLUP_PIN, 0); + + for (i = 0; i < 40000; i++) + ao_arch_nop(); #endif ao_usb_enable();