From 11e02db9541f9ac616d4a98c0eb516d13aa26e55 Mon Sep 17 00:00:00 2001 From: Cristian Maglie Date: Thu, 19 Jun 2014 16:52:48 +0200 Subject: [PATCH] Fixed regression in USBAPI and CDC (xaljox) See: https://github.com/arduino/Arduino/commit/9ac7e30252fce5b9dafde3288519b020b73c37bd#commitcomment-6718676 --- hardware/arduino/cores/arduino/CDC.cpp | 2 ++ hardware/arduino/cores/arduino/USBAPI.h | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/hardware/arduino/cores/arduino/CDC.cpp b/hardware/arduino/cores/arduino/CDC.cpp index 3cfd1b756..aae91c221 100644 --- a/hardware/arduino/cores/arduino/CDC.cpp +++ b/hardware/arduino/cores/arduino/CDC.cpp @@ -116,10 +116,12 @@ bool WEAK CDC_Setup(Setup& setup) void Serial_::begin(unsigned long baud_count) { + peek_buffer = -1; } void Serial_::begin(unsigned long baud_count, byte config) { + peek_buffer = -1; } void Serial_::end(void) diff --git a/hardware/arduino/cores/arduino/USBAPI.h b/hardware/arduino/cores/arduino/USBAPI.h index 753bc6b20..4846fc2bf 100644 --- a/hardware/arduino/cores/arduino/USBAPI.h +++ b/hardware/arduino/cores/arduino/USBAPI.h @@ -28,8 +28,9 @@ extern USBDevice_ USBDevice; class Serial_ : public Stream { private: - int peek_buffer = -1; + int peek_buffer; public: + Serial_() { peek_buffer = -1; }; void begin(unsigned long); void begin(unsigned long, uint8_t); void end(void);