From 73d8e5e9ef8388630a56572f692f9b4c96628edb Mon Sep 17 00:00:00 2001 From: Michel Jaouen Date: Fri, 21 Apr 2017 08:47:57 +0200 Subject: [PATCH] USBHOST: USBHOST_OTHER fix in endpoint - set_state specific - speed init --- features/unsupported/USBHost/USBHost/USBEndpoint.h | 7 +++++++ features/unsupported/USBHost/USBHost/USBHost.cpp | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/features/unsupported/USBHost/USBHost/USBEndpoint.h b/features/unsupported/USBHost/USBHost/USBEndpoint.h index 5517944adb..5b1287f421 100644 --- a/features/unsupported/USBHost/USBHost/USBEndpoint.h +++ b/features/unsupported/USBHost/USBHost/USBEndpoint.h @@ -33,6 +33,9 @@ public: * Constructor */ USBEndpoint() { +#ifdef USBHOST_OTHER + speed = false; +#endif state = USB_TYPE_FREE; nextEp = NULL; }; @@ -111,7 +114,11 @@ public: // setters +#ifdef USBHOST_OTHER + void setState(USB_TYPE st); +#else inline void setState(USB_TYPE st) { state = st; } +#endif void setState(uint8_t st); void setDeviceAddress(uint8_t addr); inline void setLengthTransferred(int len) { transferred = len; }; diff --git a/features/unsupported/USBHost/USBHost/USBHost.cpp b/features/unsupported/USBHost/USBHost/USBHost.cpp index 1d59d6e708..d29fa9cd53 100644 --- a/features/unsupported/USBHost/USBHost/USBHost.cpp +++ b/features/unsupported/USBHost/USBHost/USBHost.cpp @@ -379,7 +379,7 @@ void USBHost::transferCompleted(volatile uint32_t addr) usb_msg->td_state = state; mail_usb_event.put(usb_msg); } - ep->setState(state); + ep->setState((USB_TYPE)state); ep->ep_queue.put((uint8_t*)1); } }