add LPC1549, add FRDM-KL46Z, fix epComplete bit operation.

Dependents:   XBee-ExplorerLite USBLocalFileSystem USB-to-UART-bridge USBLocalFileSystem

Fork of USBDevice by mbed official

Files at this revision

API Documentation at this revision

Comitter:
va009039
Date:
Sun Feb 16 12:10:16 2014 +0000
Parent:
18:1ad500eb1e69
Child:
20:b5a68b899fd1
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
--- a/USBDevice/USBHAL_KL25Z.cpp	Tue Feb 11 01:25:04 2014 +0000
+++ b/USBDevice/USBHAL_KL25Z.cpp	Sun Feb 16 12:10:16 2014 +0000
@@ -30,6 +30,9 @@
 // Convert physical to logical
 #define PHY_TO_LOG(endpoint)    ((endpoint)>>1)
 
+// Convert logical to physical
+#define LOG_TO_PHY(endpoint)    ((endpoint)<<1)
+
 // Get endpoint direction
 #define IN_EP(endpoint)     ((endpoint) & 1U ? true : false)
 #define OUT_EP(endpoint)    ((endpoint) & 1U ? false : true)
@@ -490,9 +493,9 @@
                 if (num == 0)
                     EP0out();
                 else {
-                    epComplete |= (1 << EP(num));
-                    if ((instance->*(epCallback[EP(num) - 2]))()) {
-                        epComplete &= ~(1 << EP(num));
+                    epComplete |= EP(LOG_TO_PHY(num));
+                    if ((instance->*(epCallback[LOG_TO_PHY(num) - 2]))()) {
+                        epComplete &= ~EP(LOG_TO_PHY(num));
                     }
                 }
             }
@@ -507,9 +510,9 @@
                     }
                 }
                 else {
-                    epComplete |= (1 << (EP(num) + 1));
-                    if ((instance->*(epCallback[EP(num) + 1 - 2]))()) {
-                        epComplete &= ~(1 << (EP(num) + 1));
+                    epComplete |= EP(LOG_TO_PHY(num) + 1);
+                    if ((instance->*(epCallback[LOG_TO_PHY(num) + 1 - 2]))()) {
+                        epComplete &= ~EP(LOG_TO_PHY(num) + 1);
                     }
                 }
             }