Browse Source

Add using Print::write to hardware serial

main
PaulStoffregen 7 years ago
parent
commit
d30f8ccab8
1 changed files with 6 additions and 0 deletions
  1. +6
    -0
      teensy3/HardwareSerial.h

+ 6
- 0
teensy3/HardwareSerial.h View File

virtual void flush(void) { serial_flush(); } virtual void flush(void) { serial_flush(); }
virtual void clear(void) { serial_clear(); } virtual void clear(void) { serial_clear(); }
virtual int availableForWrite(void) { return serial_write_buffer_free(); } virtual int availableForWrite(void) { return serial_write_buffer_free(); }
using Print::write;
virtual size_t write(uint8_t c) { serial_putchar(c); return 1; } virtual size_t write(uint8_t c) { serial_putchar(c); return 1; }
virtual size_t write(unsigned long n) { return write((uint8_t)n); } virtual size_t write(unsigned long n) { return write((uint8_t)n); }
virtual size_t write(long n) { return write((uint8_t)n); } virtual size_t write(long n) { return write((uint8_t)n); }
virtual void flush(void) { serial2_flush(); } virtual void flush(void) { serial2_flush(); }
virtual void clear(void) { serial2_clear(); } virtual void clear(void) { serial2_clear(); }
virtual int availableForWrite(void) { return serial2_write_buffer_free(); } virtual int availableForWrite(void) { return serial2_write_buffer_free(); }
using Print::write;
virtual size_t write(uint8_t c) { serial2_putchar(c); return 1; } virtual size_t write(uint8_t c) { serial2_putchar(c); return 1; }
virtual size_t write(unsigned long n) { return write((uint8_t)n); } virtual size_t write(unsigned long n) { return write((uint8_t)n); }
virtual size_t write(long n) { return write((uint8_t)n); } virtual size_t write(long n) { return write((uint8_t)n); }
virtual void flush(void) { serial3_flush(); } virtual void flush(void) { serial3_flush(); }
virtual void clear(void) { serial3_clear(); } virtual void clear(void) { serial3_clear(); }
virtual int availableForWrite(void) { return serial3_write_buffer_free(); } virtual int availableForWrite(void) { return serial3_write_buffer_free(); }
using Print::write;
virtual size_t write(uint8_t c) { serial3_putchar(c); return 1; } virtual size_t write(uint8_t c) { serial3_putchar(c); return 1; }
virtual size_t write(unsigned long n) { return write((uint8_t)n); } virtual size_t write(unsigned long n) { return write((uint8_t)n); }
virtual size_t write(long n) { return write((uint8_t)n); } virtual size_t write(long n) { return write((uint8_t)n); }
virtual void flush(void) { serial4_flush(); } virtual void flush(void) { serial4_flush(); }
virtual void clear(void) { serial4_clear(); } virtual void clear(void) { serial4_clear(); }
virtual int availableForWrite(void) { return serial4_write_buffer_free(); } virtual int availableForWrite(void) { return serial4_write_buffer_free(); }
using Print::write;
virtual size_t write(uint8_t c) { serial4_putchar(c); return 1; } virtual size_t write(uint8_t c) { serial4_putchar(c); return 1; }
virtual size_t write(unsigned long n) { return write((uint8_t)n); } virtual size_t write(unsigned long n) { return write((uint8_t)n); }
virtual size_t write(long n) { return write((uint8_t)n); } virtual size_t write(long n) { return write((uint8_t)n); }
virtual void flush(void) { serial5_flush(); } virtual void flush(void) { serial5_flush(); }
virtual void clear(void) { serial5_clear(); } virtual void clear(void) { serial5_clear(); }
virtual int availableForWrite(void) { return serial5_write_buffer_free(); } virtual int availableForWrite(void) { return serial5_write_buffer_free(); }
using Print::write;
virtual size_t write(uint8_t c) { serial5_putchar(c); return 1; } virtual size_t write(uint8_t c) { serial5_putchar(c); return 1; }
virtual size_t write(unsigned long n) { return write((uint8_t)n); } virtual size_t write(unsigned long n) { return write((uint8_t)n); }
virtual size_t write(long n) { return write((uint8_t)n); } virtual size_t write(long n) { return write((uint8_t)n); }
virtual void flush(void) { serial6_flush(); } virtual void flush(void) { serial6_flush(); }
virtual void clear(void) { serial6_clear(); } virtual void clear(void) { serial6_clear(); }
virtual int availableForWrite(void) { return serial6_write_buffer_free(); } virtual int availableForWrite(void) { return serial6_write_buffer_free(); }
using Print::write;
virtual size_t write(uint8_t c) { serial6_putchar(c); return 1; } virtual size_t write(uint8_t c) { serial6_putchar(c); return 1; }
virtual size_t write(unsigned long n) { return write((uint8_t)n); } virtual size_t write(unsigned long n) { return write((uint8_t)n); }
virtual size_t write(long n) { return write((uint8_t)n); } virtual size_t write(long n) { return write((uint8_t)n); }

Loading…
Cancel
Save