summaryrefslogtreecommitdiff
path: root/protocol/usb_hid/NullSerial.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocol/usb_hid/NullSerial.cpp')
-rw-r--r--protocol/usb_hid/NullSerial.cpp44
1 files changed, 44 insertions, 0 deletions
diff --git a/protocol/usb_hid/NullSerial.cpp b/protocol/usb_hid/NullSerial.cpp
new file mode 100644
index 0000000000..6d85caf2d8
--- /dev/null
+++ b/protocol/usb_hid/NullSerial.cpp
@@ -0,0 +1,44 @@
+#include "USBAPI.h"
+
+
+void NullSerial::begin(uint16_t baud_count)
+{
+}
+
+void NullSerial::end(void)
+{
+}
+
+void NullSerial::accept(void)
+{
+}
+
+int NullSerial::available(void)
+{
+ return 0;
+}
+
+int NullSerial::peek(void)
+{
+ return -1;
+}
+
+int NullSerial::read(void)
+{
+ return -1;
+}
+
+void NullSerial::flush(void)
+{
+}
+
+size_t NullSerial::write(uint8_t c)
+{
+ return 1;
+}
+
+NullSerial::operator bool() {
+ return true;
+}
+
+NullSerial Serial;