Version of USBDevice that works for KL25Z on Mbed OS2.

Fork of USBDevice by mbed official

Revision:
70:2c525a50f1b6
Parent:
47:a0cd9646ecd1
diff -r c5e178adb138 -r 2c525a50f1b6 USBSerial/USBSerial.cpp
--- a/USBSerial/USBSerial.cpp	Fri Nov 11 17:59:00 2016 +0000
+++ b/USBSerial/USBSerial.cpp	Thu Jul 20 10:14:36 2017 +0100
@@ -56,8 +56,9 @@
         buf.queue(c[i]);
     }
 
-    //call a potential handler
-    rx.call();
+    //call a potential handlenr
+    if (rx)
+        rx.call();
 
     return true;
 }
@@ -65,3 +66,7 @@
 uint8_t USBSerial::available() {
     return buf.available();
 }
+
+bool USBSerial::connected() {
+    return terminal_connected;
+}