Skip to content

Commit

Permalink
Add bool operator to HardwareSerial
Browse files Browse the repository at this point in the history
  • Loading branch information
PaulStoffregen committed Oct 28, 2015
1 parent 0a94f68 commit 7a6898b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions teensy3/HardwareSerial.h
Expand Up @@ -193,6 +193,7 @@ class HardwareSerial : public Stream
serial_write((const uint8_t *)str, len);
return len; }
virtual size_t write9bit(uint32_t c) { serial_putchar(c); return 1; }
operator bool() { return true; }
};
extern HardwareSerial Serial1;
extern void serialEvent1(void);
Expand Down Expand Up @@ -223,6 +224,7 @@ class HardwareSerial2 : public HardwareSerial
serial2_write((const uint8_t *)str, len);
return len; }
virtual size_t write9bit(uint32_t c) { serial2_putchar(c); return 1; }
operator bool() { return true; }
};
extern HardwareSerial2 Serial2;
extern void serialEvent2(void);
Expand Down Expand Up @@ -253,6 +255,7 @@ class HardwareSerial3 : public HardwareSerial
serial3_write((const uint8_t *)str, len);
return len; }
virtual size_t write9bit(uint32_t c) { serial3_putchar(c); return 1; }
operator bool() { return true; }
};
extern HardwareSerial3 Serial3;
extern void serialEvent3(void);
Expand Down

0 comments on commit 7a6898b

Please sign in to comment.