ST / ST_Events-old

Dependents:   HelloWorld_CCA01M1 HelloWorld_CCA02M1 CI-data-logger-server HelloWorld_CCA02M1 ... more

This is a fork of the events subdirectory of https://github.com/ARMmbed/mbed-os.

Note, you must import this library with import name: events!!!

Files at this revision

API Documentation at this revision

Comitter:
Sam Grove
Date:
Thu Feb 09 10:05:54 2017 -0600
Parent:
9811:1ab4a497e28d
Parent:
9812:a5970ff281a7
Child:
9814:ff35fc856f7c
Child:
9815:1d97cb0e78e4
Commit message:
Merge pull request #3708 from OpenNuvoton/nuvoton_usb

[NUC472/M453] Fix USB EP setting error in USBAudio

Changed in this revision

--- a/features/unsupported/USBDevice/USBAudio/USBAudio.cpp	Thu Feb 09 09:51:32 2017 -0600
+++ b/features/unsupported/USBDevice/USBAudio/USBAudio.cpp	Thu Feb 09 10:05:54 2017 -0600
@@ -85,7 +85,7 @@
     SOF_handler = false;
     writeIN = false;
     if (interruptIN) {
-        USBDevice::writeNB(EP3IN, buf_write, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
+        USBDevice::writeNB(EPISO_IN, buf_write, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
     } else {
         buf_stream_out = buf_write;
     }
@@ -102,7 +102,7 @@
     writeIN = false;
     SOF_handler = false;
     if (interruptIN) {
-        USBDevice::writeNB(EP3IN, buf, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
+        USBDevice::writeNB(EPISO_IN, buf, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
     } else {
         buf_stream_out = buf;
     }
@@ -115,13 +115,13 @@
 
 void USBAudio::writeSync(uint8_t *buf)
 {
-    USBDevice::writeNB(EP3IN, buf, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
+    USBDevice::writeNB(EPISO_IN, buf, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
 }
 
 uint32_t USBAudio::readSync(uint8_t *buf)
 {
     uint32_t size = 0;
-    USBDevice::readEP(EP3OUT, (uint8_t *)buf, &size, PACKET_SIZE_ISO_IN);
+    USBDevice::readEP(EPISO_OUT, (uint8_t *)buf, &size, PACKET_SIZE_ISO_IN);
     return size;
 }
 
@@ -134,7 +134,7 @@
     uint32_t size = 0;
     interruptOUT = true;
     if (buf_stream_in != NULL) {
-        readEP(EP3OUT, (uint8_t *)buf_stream_in, &size, PACKET_SIZE_ISO_IN);
+        readEP(EPISO_OUT, (uint8_t *)buf_stream_in, &size, PACKET_SIZE_ISO_IN);
         available = true;
         buf_stream_in = NULL;
     }
@@ -142,7 +142,7 @@
         if (rxDone)
             rxDone.call();
     }
-    readStart(EP3OUT, PACKET_SIZE_ISO_IN);
+    readStart(EPISO_OUT, PACKET_SIZE_ISO_IN);
     return false;
 }
 
@@ -164,10 +164,10 @@
     if (!interruptOUT) {
         // read the isochronous endpoint
         if (buf_stream_in != NULL) {
-            if (USBDevice::readEP_NB(EP3OUT, (uint8_t *)buf_stream_in, &size, PACKET_SIZE_ISO_IN)) {
+            if (USBDevice::readEP_NB(EPISO_OUT, (uint8_t *)buf_stream_in, &size, PACKET_SIZE_ISO_IN)) {
                 if (size) {
                     available = true;
-                    readStart(EP3OUT, PACKET_SIZE_ISO_IN);
+                    readStart(EPISO_OUT, PACKET_SIZE_ISO_IN);
                     buf_stream_in = NULL;
                 }
             }
@@ -177,7 +177,7 @@
     if (!interruptIN) {
         // write if needed
         if (buf_stream_out != NULL) {
-            USBDevice::writeNB(EP3IN, (uint8_t *)buf_stream_out, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
+            USBDevice::writeNB(EPISO_IN, (uint8_t *)buf_stream_out, PACKET_SIZE_ISO_OUT, PACKET_SIZE_ISO_OUT);
             buf_stream_out = NULL;
         }
     }
@@ -194,11 +194,11 @@
     }
 
     // Configure isochronous endpoint
-    realiseEndpoint(EP3OUT, PACKET_SIZE_ISO_IN, ISOCHRONOUS);
-    realiseEndpoint(EP3IN, PACKET_SIZE_ISO_OUT, ISOCHRONOUS);
+    realiseEndpoint(EPISO_OUT, PACKET_SIZE_ISO_IN, ISOCHRONOUS);
+    realiseEndpoint(EPISO_IN, PACKET_SIZE_ISO_OUT, ISOCHRONOUS);
 
     // activate readings on this endpoint
-    readStart(EP3OUT, PACKET_SIZE_ISO_IN);
+    readStart(EPISO_OUT, PACKET_SIZE_ISO_IN);
     return true;
 }