Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 1:1d38d9ca354d, committed 2011-12-16
- Comitter:
- samux
- Date:
- Fri Dec 16 17:06:49 2011 +0000
- Parent:
- 0:539ec61e1fbb
- Child:
- 2:7d8bdeb3753b
- Commit message:
- same interface for the M0 and the M3
Changed in this revision
| USBDevice/USBAudio/USBAudio.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- a/USBDevice/USBAudio/USBAudio.cpp Fri Dec 16 12:31:41 2011 +0000
+++ b/USBDevice/USBAudio/USBAudio.cpp Fri Dec 16 17:06:49 2011 +0000
@@ -67,22 +67,25 @@
bool USBAudio::write(uint8_t * buf) {
readIN = false;
SOF_handler = false;
- USBDevice::writeNB(EP3IN, buf, 16, 16);
- while(!SOF_handler);
- if(interruptIN) {
- while(!readIN);
+ if (interruptIN) {
+ USBDevice::writeNB(EP3IN, buf, 16, 16);
+ } else {
+ buf_stream = buf;
}
+ while (!SOF_handler);
+ if (interruptIN) {
+ while (!readIN);
+ }
+ buf_stream = NULL;
return true;
}
// Called in ISR context on each start of frame
void USBAudio::SOF(int frameNumber) {
- int16_t buf[8];
- for (int i = 0; i < 8; i++) {
- buf[i] = (i % 2) ? -255 : 255;
+ if (buf_stream != NULL) {
+ USBDevice::writeNB(EP3IN, (uint8_t *)buf_stream, 16, 16);
}
- //USBDevice::writeNB(EP3IN, (uint8_t *)buf, 16, 16);
SOF_handler = true;
}