summaryrefslogtreecommitdiff
path: root/chip/stm32/usb.c
diff options
context:
space:
mode:
Diffstat (limited to 'chip/stm32/usb.c')
-rw-r--r--chip/stm32/usb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/chip/stm32/usb.c b/chip/stm32/usb.c
index b99d4be5b0..dcf31e1dae 100644
--- a/chip/stm32/usb.c
+++ b/chip/stm32/usb.c
@@ -313,8 +313,11 @@ error:
STM32_TOGGLE_EP(0, EP_TX_MASK, EP_TX_VALID, 0);
}
-static void ep0_reset(void)
+static void ep0_event(enum usb_ep_event evt)
{
+ if (evt != USB_EVENT_RESET)
+ return;
+
STM32_USB_EP(0) = (1 << 9) /* control EP */ |
(2 << 4) /* TX NAK */ |
(3 << 12) /* RX VALID */;
@@ -324,14 +327,14 @@ static void ep0_reset(void)
btable_ep[0].rx_count = 0x8000 | ((USB_MAX_PACKET_SIZE/32-1) << 10);
btable_ep[0].tx_count = 0;
}
-USB_DECLARE_EP(0, ep0_tx, ep0_rx, ep0_reset);
+USB_DECLARE_EP(0, ep0_tx, ep0_rx, ep0_event);
static void usb_reset(void)
{
int ep;
for (ep = 0; ep < USB_EP_COUNT; ep++)
- usb_ep_reset[ep]();
+ usb_ep_event[ep](USB_EVENT_RESET);
/*
* set the default address : 0