Kazuki Yamamoto / USBCDCMSC

Dependents:   USBMSD_CDC_11U35test

Files at this revision

API Documentation at this revision

Comitter:
k4zuki
Date:
Tue Apr 21 16:42:12 2015 +0000
Parent:
0:db88c3af3803
Child:
2:8f01347859d0
Commit message:
[ FIX ] End Point was wrong in both macro and function definition

Changed in this revision

USBCDCMSC.cpp Show annotated file Show diff for this revision Revisions of this file
USBCDCMSC.h Show annotated file Show diff for this revision Revisions of this file
--- a/USBCDCMSC.cpp	Tue Apr 21 09:12:22 2015 +0000
+++ b/USBCDCMSC.cpp	Tue Apr 21 16:42:12 2015 +0000
@@ -20,14 +20,10 @@
 #include "USBCDCMSC.h"
 #include "USBEndpoints.h"
 
-//#define EP2OUT      (4)  /* Int/Bulk/Iso  64/64/1023  Yes           */
-//#define EP2IN       (5)  /* Int/Bulk/Iso  64/64/1023  Yes           */
 /* Bulk endpoint */
-#define MSDBULK_OUT  (EP2OUT)
-#define MSDBULK_IN   (EP2IN)
-//#define MSDBULK_OUT_callback   EP2_OUT_callback
-//#define MSDBULK_IN_callback    EP2_IN_callback
-#define MAX_PACKET_SIZE_MSDBULK  (MAX_PACKET_SIZE_EP2)
+#define MSDBULK_OUT  (EP3OUT)
+#define MSDBULK_IN   (EP3IN)
+#define MAX_PACKET_SIZE_MSDBULK  (MAX_PACKET_SIZE_EP3)
 
 static uint8_t cdc_line_coding[7]= {0x80, 0x25, 0x00, 0x00, 0x00, 0x00, 0x08};
 
@@ -438,7 +434,7 @@
 
 
 // Called in ISR context called when a data is received
-bool USBCDCMSC::EP5_OUT_callback() {
+bool USBCDCMSC::EP3_OUT_callback() {
     uint32_t size = 0;
     uint8_t buf[MAX_PACKET_SIZE_EPBULK];
     USBDevice::readEP(MSDBULK_OUT, buf, &size, MAX_PACKET_SIZE_EPBULK);
@@ -475,7 +471,7 @@
 }
 
 // Called in ISR context when a data has been transferred
-bool USBCDCMSC::EP5_IN_callback() {
+bool USBCDCMSC::EP3_IN_callback() {
     switch (stage) {
 
             // the device has to send data to the host
--- a/USBCDCMSC.h	Tue Apr 21 09:12:22 2015 +0000
+++ b/USBCDCMSC.h	Tue Apr 21 16:42:12 2015 +0000
@@ -180,12 +180,12 @@
     /*
     * Callback called when a packet is received
     */
-    virtual bool EP5_OUT_callback();
+    virtual bool EP3_OUT_callback();
 
     /*
     * Callback called when a packet has been sent
     */
-    virtual bool EP5_IN_callback();
+    virtual bool EP3_IN_callback();
 
 private: