USB device stack

Fork of USBDevice by mbed official

Files at this revision

API Documentation at this revision

Comitter:
va009039
Date:
Mon Nov 03 02:51:52 2014 +0000
Parent:
34:a4e9ddc2e2af
Commit message:
fix epComplete bit operation.

Changed in this revision

USBDevice/USBHAL_KL25Z.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a4e9ddc2e2af -r e100852c1399 USBDevice/USBHAL_KL25Z.cpp
--- a/USBDevice/USBHAL_KL25Z.cpp	Thu Oct 23 09:45:42 2014 +0100
+++ b/USBDevice/USBHAL_KL25Z.cpp	Mon Nov 03 02:51:52 2014 +0000
@@ -506,9 +506,10 @@
                 if (num == 0)
                     EP0out();
                 else {
-                    epComplete |= (1 << EP(num));
-                    if ((instance->*(epCallback[EP(num) - 2]))()) {
-                        epComplete &= ~(1 << EP(num));
+                    int phy = (num<<1) + 0;
+                    epComplete |= EP(phy);
+                    if ((instance->*(epCallback[phy - 2]))()) {
+                        epComplete &= ~EP(phy);
                     }
                 }
             }
@@ -523,9 +524,10 @@
                     }
                 }
                 else {
-                    epComplete |= (1 << (EP(num) + 1));
-                    if ((instance->*(epCallback[EP(num) + 1 - 2]))()) {
-                        epComplete &= ~(1 << (EP(num) + 1));
+                    int phy = (num<<1) + 1;
+                    epComplete |= EP(phy);
+                    if ((instance->*(epCallback[phy - 2]))()) {
+                        epComplete &= ~EP(phy);
                     }
                 }
             }