USB device stack; Added getter method for terminal_connected;
Fork of USBDevice by
Example of use:
#include "mbed.h" #include "USBSerial.h" USBSerial pc; DigitalOut blue_led(P0_20); int main() { blue_led = 1; while(!pc.getTerminal_connected()); //Wait for serial terminal to connect... while(1) { blue_led = 0; wait(0.2); blue_led = 1; wait(0.2); } }
Diff: USBMIDI/MIDIMessage.h
- Revision:
- 11:eeb3cbbaa996
- Parent:
- 1:80ab0d068708
- Child:
- 25:7c72828865f3
--- a/USBMIDI/MIDIMessage.h Thu May 30 17:16:57 2013 +0100 +++ b/USBMIDI/MIDIMessage.h Mon Aug 05 14:13:36 2013 +0300 @@ -45,7 +45,8 @@ MIDIMessage() {} MIDIMessage(uint8_t *buf) { - *((uint32_t *)data) = *((uint32_t *)buf); + for (int i = 0; i < 4; i++) + data[i] = buf[i]; } // create messages @@ -245,6 +246,6 @@ } uint8_t data[4]; -}; +}; #endif