Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: FATFileSystem mbed-rtos mbed
Fork of USBHost by
Diff: USBHost/USBEndpoint.cpp
- Revision:
- 37:f1e388e7b752
- Parent:
- 34:028508fd50fa
diff -r 655a8c5fa238 -r f1e388e7b752 USBHost/USBEndpoint.cpp
--- a/USBHost/USBEndpoint.cpp Sun Apr 30 04:17:16 2017 +0000
+++ b/USBHost/USBEndpoint.cpp Thu Jul 20 10:13:56 2017 +0100
@@ -17,7 +17,7 @@
#include "dbg.h"
#include "USBEndpoint.h"
-
+#if !defined(USBHOST_OTHER)
void USBEndpoint::init(HCED * hced_, ENDPOINT_TYPE type_, ENDPOINT_DIRECTION dir_, uint32_t size, uint8_t ep_number, HCTD* td_list_[2])
{
hced = hced_;
@@ -76,6 +76,7 @@
hced->control &= ~(1 << 13);
hced->control |= (speed << 13);
}
+#endif
//Only for control Eps
void USBEndpoint::setNextToken(uint32_t token)
@@ -95,7 +96,6 @@
break;
}
}
-
struct {
USB_TYPE type;
const char * str;
@@ -120,19 +120,18 @@
{USB_TYPE_PROCESSING, "USB_TYPE_PROCESSING"},
{USB_TYPE_ERROR, "USB_TYPE_ERROR"}
};
+const char * USBEndpoint::getStateString() {
+ return type_string[state].str;
+}
+#if !defined(USBHOST_OTHER)
void USBEndpoint::setState(uint8_t st) {
if (st > 18)
return;
state = type_string[st].type;
}
-
-const char * USBEndpoint::getStateString() {
- return type_string[state].str;
-}
-
-void USBEndpoint::queueTransfer()
+USB_TYPE USBEndpoint::queueTransfer()
{
transfer_len = (uint32_t)td_current->bufEnd - (uint32_t)td_current->currBufPtr + 1;
transferred = transfer_len;
@@ -142,6 +141,7 @@
state = USB_TYPE_PROCESSING;
td_current->nextTD = (hcTd*)td_next;
hced->tailTD = td_next;
+ return USB_TYPE_PROCESSING;
}
void USBEndpoint::unqueueTransfer(volatile HCTD * td)
@@ -160,3 +160,4 @@
nextEp = ed;
hced->nextED = (ed == NULL) ? 0 : (hcEd*)(ed->getHCED());
}
+#endif
