aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/src
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2017-08-22 07:52:33 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2017-08-22 07:52:33 +0000
commitf1e6a55322f18fe69293ce9cc4e1da31a589ea6f (patch)
tree6daf42852a08e87e0400601a449b686f5e4080d6 /os/hal/src
parent15f4e5c3f36595e9fb03a9143fe6d52183700220 (diff)
downloadChibiOS-f1e6a55322f18fe69293ce9cc4e1da31a589ea6f.tar.gz
ChibiOS-f1e6a55322f18fe69293ce9cc4e1da31a589ea6f.tar.bz2
ChibiOS-f1e6a55322f18fe69293ce9cc4e1da31a589ea6f.zip
Tentative fix for L4 OTG.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10454 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os/hal/src')
-rw-r--r--os/hal/src/hal_usb.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/os/hal/src/hal_usb.c b/os/hal/src/hal_usb.c
index e58055714..451b19aa4 100644
--- a/os/hal/src/hal_usb.c
+++ b/os/hal/src/hal_usb.c
@@ -751,8 +751,17 @@ void _usb_wakeup(USBDriver *usbp) {
void _usb_ep0setup(USBDriver *usbp, usbep_t ep) {
size_t max;
- osalDbgAssert(usbp->ep0state == USB_EP0_STP_WAITING, "not in setup state");
+ /* Is the EP0 state machine in the correct state for handling setup
+ packets?*/
+ if (usbp->ep0state != USB_EP0_STP_WAITING) {
+ /* This is unexpected could require handling with a warning event.*/
+ /* TODO: handling here.*/
+ /* Resetting the EP0 state machine and going ahead.*/
+ usbp->ep0state = USB_EP0_STP_WAITING;
+ }
+
+ /* Reading the setup data into the driver buffer.*/
usbReadSetup(usbp, ep, usbp->setup);
/* First verify if the application has an handler installed for this