USB device stack

Dependents:   F401RE_USBMSD_RAM_copy

Fork of USBDevice by mbed official

test program:

Import programF401RE_USBMSD_RAM

USBMSD example with a file system located in RAM

Files at this revision

API Documentation at this revision

Comitter:
va009039
Date:
Wed Nov 05 06:37:15 2014 +0000
Parent:
34:a4e9ddc2e2af
Commit message:
fix EP_IN callback.

Changed in this revision

USBDevice/USBHAL_STM32F4.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r a4e9ddc2e2af -r 92ff0ef2a95c USBDevice/USBHAL_STM32F4.cpp
--- a/USBDevice/USBHAL_STM32F4.cpp	Thu Oct 23 09:45:42 2014 +0100
+++ b/USBDevice/USBHAL_STM32F4.cpp	Wed Nov 05 06:37:15 2014 +0000
@@ -392,8 +392,14 @@
 
                 // If the transfer is complete
                 if (OTG_FS->INEP_REGS[i].DIEPINT & (1 << 0)) { // Tx Complete
-                    epComplete |= (1 << (1 + (i << 1)));
                     OTG_FS->INEP_REGS[i].DIEPINT = (1 << 0);
+                    if (i >= 1) { // EP1_IN,EP2_IN,EP3_IN
+                        uint32_t mask = 1 << (1 + (i << 1));
+                        epComplete |= mask;
+                        if ((instance->*(epCallback[(i<<1) + 1 - 2]))()) {
+                            epComplete &= ~mask;
+                        }
+                    }
                 }
             }
         }