diff options
Diffstat (limited to 'cores/arduino/USBAPI.h')
-rw-r--r-- | cores/arduino/USBAPI.h | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/cores/arduino/USBAPI.h b/cores/arduino/USBAPI.h index d506b58..c637fda 100644 --- a/cores/arduino/USBAPI.h +++ b/cores/arduino/USBAPI.h @@ -25,6 +25,14 @@ extern USBDevice_ USBDevice; //================================================================================ // Serial over CDC (Serial1 is the physical port) +struct ring_buffer; + +#if (RAMEND < 1000) +#define SERIAL_BUFFER_SIZE 16 +#else +#define SERIAL_BUFFER_SIZE 64 +#endif + class Serial_ : public Stream { private: @@ -42,9 +50,15 @@ public: virtual size_t write(const uint8_t*, size_t); using Print::write; // pull in write(str) and write(buf, size) from Print operator bool(); + + volatile uint8_t _rx_buffer_head; + volatile uint8_t _rx_buffer_tail; + unsigned char _rx_buffer[SERIAL_BUFFER_SIZE]; }; extern Serial_ Serial; +#define HAVE_CDCSERIAL + //================================================================================ //================================================================================ // Mouse |