adds a USB serial port to your design

Dependents:   Example_WatchDog_Timer

Revision:
70:2c525a50f1b6
Parent:
47:a0cd9646ecd1
Child:
77:3e96144c2bf2
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;
+}