From c2d5ac0a1f211a4e31e4e4b3f43f7654073b3bd1 Mon Sep 17 00:00:00 2001 From: Roger Clark Date: Sun, 21 Dec 2014 18:08:16 +1100 Subject: [PATCH] Added missing operator bool to USBSerial. Note. Its odd that I'd not spotted this was missing as I added it to HardwareSerial ages ago --- STM32F1XX/cores/maple/usb_serial.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/STM32F1XX/cores/maple/usb_serial.h b/STM32F1XX/cores/maple/usb_serial.h index 58b2c69..4f8f56a 100644 --- a/STM32F1XX/cores/maple/usb_serial.h +++ b/STM32F1XX/cores/maple/usb_serial.h @@ -49,6 +49,8 @@ public: void begin(unsigned long, uint8_t); void end(void); + operator bool() { return true; } // Roger Clark. This is needed because in cardinfo.ino it does if (!Serial) . It seems to be a work around for the Leonardo that we needed to implement just to be compliant with the API + virtual int available(void);// Changed to virtual uint32 read(void *buf, uint32 len);