USB device stack; Added getter method for terminal_connected;

Fork of USBDevice by mbed official

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);
    }
}
Revision:
29:b7a0ea455a0c
Parent:
18:78bdbce94509
Child:
47:a0cd9646ecd1
--- a/USBMSD/USBMSD.cpp	Tue Aug 05 20:15:19 2014 +0100
+++ b/USBMSD/USBMSD.cpp	Mon Aug 18 13:45:19 2014 +0100
@@ -232,7 +232,7 @@
     // if the array is filled, write it in memory
     if (!((addr + size)%BlockSize)) {
         if (!(disk_status() & WRITE_PROTECT)) {
-            disk_write(page, addr/BlockSize);
+            disk_write(page, addr/BlockSize, 1);
         }
     }
 
@@ -257,7 +257,7 @@
 
     // beginning of a new block -> load a whole block in RAM
     if (!(addr%BlockSize))
-        disk_read(page, addr/BlockSize);
+        disk_read(page, addr/BlockSize, 1);
 
     // info are in RAM -> no need to re-read memory
     for (n = 0; n < size; n++) {
@@ -505,7 +505,7 @@
 
     // we read an entire block
     if (!(addr%BlockSize))
-        disk_read(page, addr/BlockSize);
+        disk_read(page, addr/BlockSize, 1);
 
     // write data which are in RAM
     writeNB(EPBULK_IN, &page[addr%BlockSize], n, MAX_PACKET_SIZE_EPBULK);