Przeglądaj źródła

Add Print::availableForWrite

teensy4-core
PaulStoffregen 7 lat temu
rodzic
commit
3580ee2bd0
3 zmienionych plików z 3 dodań i 2 usunięć
  1. +1
    -0
      teensy3/Print.h
  2. +1
    -1
      teensy3/usb_seremu.h
  3. +1
    -1
      teensy3/usb_serial.h

+ 1
- 0
teensy3/Print.h Wyświetl plik

@@ -53,6 +53,7 @@ class Print
virtual size_t write(uint8_t b) = 0;
size_t write(const char *str) { return write((const uint8_t *)str, strlen(str)); }
virtual size_t write(const uint8_t *buffer, size_t size);
virtual int availableForWrite(void) { return 0; }
virtual void flush() { }
size_t write(const char *buffer, size_t size) { return write((const uint8_t *)buffer, size); }
size_t print(const String &s);

+ 1
- 1
teensy3/usb_seremu.h Wyświetl plik

@@ -76,7 +76,7 @@ public:
size_t write(long n) { return write((uint8_t)n); }
size_t write(unsigned int n) { return write((uint8_t)n); }
size_t write(int n) { return write((uint8_t)n); }
int availableForWrite() { return usb_seremu_write_buffer_free(); }
virtual int availableForWrite() { return usb_seremu_write_buffer_free(); }
using Print::write;
void send_now(void) { usb_seremu_flush_output(); };
uint32_t baud(void) { return 9600; }

+ 1
- 1
teensy3/usb_serial.h Wyświetl plik

@@ -90,7 +90,7 @@ public:
size_t write(long n) { return write((uint8_t)n); }
size_t write(unsigned int n) { return write((uint8_t)n); }
size_t write(int n) { return write((uint8_t)n); }
int availableForWrite() { return usb_serial_write_buffer_free(); }
virtual int availableForWrite() { return usb_serial_write_buffer_free(); }
using Print::write;
void send_now(void) { usb_serial_flush_output(); }
uint32_t baud(void) { return usb_cdc_line_coding[0]; }

Ładowanie…
Anuluj
Zapisz