From 6dde3d39b401b01695c2844635331df1a1226b4e Mon Sep 17 00:00:00 2001 From: stevstrong Date: Fri, 2 Jun 2017 20:26:55 +0200 Subject: [PATCH] added serial bool operator for "if(!Serial)" --- STM32F4/cores/maple/libmaple/HardwareSerial.h | 1 + 1 file changed, 1 insertion(+) diff --git a/STM32F4/cores/maple/libmaple/HardwareSerial.h b/STM32F4/cores/maple/libmaple/HardwareSerial.h index d7e8a3d..b49c4cf 100644 --- a/STM32F4/cores/maple/libmaple/HardwareSerial.h +++ b/STM32F4/cores/maple/libmaple/HardwareSerial.h @@ -57,6 +57,7 @@ public: void begin(uint32 baud); void end(void); + operator bool() { return true; } // This is needed because of "if (!Serial)" /* I/O */ virtual int available(void); virtual int peek(void);