diff options
Diffstat (limited to 'protocol/usb_hid/override_Serial.cpp')
-rw-r--r-- | protocol/usb_hid/override_Serial.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/protocol/usb_hid/override_Serial.cpp b/protocol/usb_hid/override_Serial.cpp new file mode 100644 index 000000000..e1755a5dc --- /dev/null +++ b/protocol/usb_hid/override_Serial.cpp | |||
@@ -0,0 +1,51 @@ | |||
1 | /* | ||
2 | * Null implementation of Serial to dump debug print into blackhole | ||
3 | */ | ||
4 | #include "Arduino.h" | ||
5 | #include "sendchar.h" | ||
6 | |||
7 | #include "USBAPI.h" | ||
8 | |||
9 | |||
10 | void Serial_::begin(uint16_t baud_count) | ||
11 | { | ||
12 | } | ||
13 | |||
14 | void Serial_::end(void) | ||
15 | { | ||
16 | } | ||
17 | |||
18 | void Serial_::accept(void) | ||
19 | { | ||
20 | } | ||
21 | |||
22 | int Serial_::available(void) | ||
23 | { | ||
24 | return 0; | ||
25 | } | ||
26 | |||
27 | int Serial_::peek(void) | ||
28 | { | ||
29 | return -1; | ||
30 | } | ||
31 | |||
32 | int Serial_::read(void) | ||
33 | { | ||
34 | return -1; | ||
35 | } | ||
36 | |||
37 | void Serial_::flush(void) | ||
38 | { | ||
39 | } | ||
40 | |||
41 | size_t Serial_::write(uint8_t c) | ||
42 | { | ||
43 | sendchar(c); | ||
44 | return 1; | ||
45 | } | ||
46 | |||
47 | Serial_::operator bool() { | ||
48 | return true; | ||
49 | } | ||
50 | |||
51 | Serial_ Serial; | ||