USB Composite support

Dependents:   mbed_cdc_hid_composite

Fork of USBDevice by mbed official

Revision:
55:7c559fcb1d17
Parent:
31:5bf05f9b3c7b
--- a/USBDevice/USBHAL.h	Fri May 22 08:45:47 2015 +0100
+++ b/USBDevice/USBHAL.h	Sun May 31 15:36:50 2015 +0000
@@ -108,14 +108,24 @@
     static void _usbisr(void);
     static USBHAL * instance;
 
+
 #if defined(TARGET_LPC11UXX) || defined(TARGET_LPC11U6X) || defined(TARGET_LPC1347) || defined(TARGET_LPC1549)
         bool (USBHAL::*epCallback[10 - 2])(void);
 #elif defined(TARGET_STM32F4)
         bool (USBHAL::*epCallback[8 - 2])(void);
 #else
-        bool (USBHAL::*epCallback[32 - 2])(void);
+        void *epCallbackObj[32 - 2];
+        bool (*epCallback[32 - 2])(void *);
 #endif
 
+public:
+    void set_ep_callback(uint8_t ep, void * obj, bool (*ptr)(void *)) {
+        if ((obj != NULL) && (ptr != NULL)) {
+            epCallback[ep] = ptr;
+            epCallbackObj[ep] = obj;
+        }
+    }
+
 
 };
 #endif