USB device stack

Dependents:   mbed-mX-USB-TEST1 USBMSD_SD_HID_HelloWorld HidTest MIDI_usb_bridge ... more

Issue: Probable bug in USBHAL_KL25Z.cpp

In the official USBDevice library, the file USBHAL_KL25Z.cpp contains the macro definition,

#define EP(endpoint) (1<<(endpoint))

and later code fragments such as this (in the interrupt handler).

                    epComplete |= (1 << (EP(num) + 1));
                    if ((instance->*(epCallback[EP(num) + 1 - 2]))()) {
                        epComplete &= ~(1 << (EP(num) + 1));

This surely can't be right! (I'm studying the code, but have no application that uses multiple endpoints, so I can't test this).