aboutsummaryrefslogtreecommitdiffstats
path: root/wirish
diff options
context:
space:
mode:
authorbnewbold <bnewbold@robocracy.org>2010-07-22 18:24:51 -0400
committerbnewbold <bnewbold@robocracy.org>2010-07-22 18:24:51 -0400
commit99c251b8462e7bc304e9e4a52bfc378d22804291 (patch)
tree051bdb863c92d9447191b92a49877e4dff141758 /wirish
parent05f137fab9f4604ca3c7e8bb415c4b29db40ae5e (diff)
downloadlibrambutan-99c251b8462e7bc304e9e4a52bfc378d22804291.tar.gz
librambutan-99c251b8462e7bc304e9e4a52bfc378d22804291.zip
added isConnected() to serialusb
Diffstat (limited to 'wirish')
-rw-r--r--wirish/usb_serial.cpp12
-rw-r--r--wirish/usb_serial.h1
2 files changed, 13 insertions, 0 deletions
diff --git a/wirish/usb_serial.cpp b/wirish/usb_serial.cpp
index 08cda55..c066112 100644
--- a/wirish/usb_serial.cpp
+++ b/wirish/usb_serial.cpp
@@ -103,5 +103,17 @@ uint8 USBSerial::pending(void) {
return usbGetPending();
}
+uint8 USBSerial::getDTR(void) {
+ return usbGetDTR();
+}
+
+uint8 USBSerial::getRTS(void) {
+ return usbGetRTS();
+}
+
+uint8 USBSerial::isConnected(void) {
+ return (usbIsConnected() && usbIsConfigured());
+}
+
USBSerial SerialUSB;
diff --git a/wirish/usb_serial.h b/wirish/usb_serial.h
index abb362b..7c87c04 100644
--- a/wirish/usb_serial.h
+++ b/wirish/usb_serial.h
@@ -50,6 +50,7 @@ class USBSerial : public Print {
uint8 getRTS();
uint8 getDTR();
+ uint8 isConnected();
uint8 pending();
};