diff options
| author | hathach <[email protected]> | 2018-06-18 14:31:15 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-06-18 14:31:15 +0700 |
| commit | f8e7695fe932e79dfb590d96762db68cca1daf0c (patch) | |
| tree | 333b5041c01805fbb1202a766bfd7f5393ba09f9 /src/host | |
| parent | 38ac69b3703519a684a03bf5cccb6198cca2ff16 (diff) | |
clean up
Diffstat (limited to 'src/host')
| -rw-r--r-- | src/host/usbh.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/host/usbh.c b/src/host/usbh.c index 506135b49..a67bd8d8c 100644 --- a/src/host/usbh.c +++ b/src/host/usbh.c @@ -242,6 +242,16 @@ static inline tusb_error_t usbh_pipe_control_close(uint8_t dev_addr) // return TUSB_INTERFACE_STATUS_BUSY;
//}
+static inline uint8_t std_class_code_to_index(uint8_t std_class_code)
+{
+ return (std_class_code <= TUSB_CLASS_AUDIO_VIDEO ) ? std_class_code :
+ (std_class_code == TUSB_CLASS_DIAGNOSTIC ) ? TUSB_CLASS_MAPPED_INDEX_START :
+ (std_class_code == TUSB_CLASS_WIRELESS_CONTROLLER ) ? TUSB_CLASS_MAPPED_INDEX_START + 1 :
+ (std_class_code == TUSB_CLASS_MISC ) ? TUSB_CLASS_MAPPED_INDEX_START + 2 :
+ (std_class_code == TUSB_CLASS_APPLICATION_SPECIFIC ) ? TUSB_CLASS_MAPPED_INDEX_START + 3 :
+ (std_class_code == TUSB_CLASS_VENDOR_SPECIFIC ) ? TUSB_CLASS_MAPPED_INDEX_START + 4 : 0;
+}
+
//--------------------------------------------------------------------+
// USBH-HCD ISR/Callback API
//--------------------------------------------------------------------+
|
