aboutsummaryrefslogtreecommitdiff
path: root/cores/arduino/CDC.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'cores/arduino/CDC.cpp')
-rw-r--r--cores/arduino/CDC.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cores/arduino/CDC.cpp b/cores/arduino/CDC.cpp
index 7206aa6..1275304 100644
--- a/cores/arduino/CDC.cpp
+++ b/cores/arduino/CDC.cpp
@@ -213,6 +213,12 @@ size_t Serial_::write(uint8_t c)
return 0;
}
+Serial_::operator bool() {
+ if (_usbLineInfo.lineState > 0)
+ return true;
+ return false;
+}
+
Serial_ Serial;
#endif