Skip to content

Commit 2d13250

Browse files
authored
allow use of all write() variants
Adafruit_USBD_MIDI implements Stream, and transitively Print. Print overloads write() with several versions, only one of which must be implemented, write(uint8_t). Because Adafruit_USBD_MIDI declares write(uint8_t) in its class definition (as it must), it will _lose_ the overloaded versions, unless explicitly including them with a using declaration... Which is what this commit does. Without this using declaration, users of this class cannot call write(const char* str) or write(const uint8_t *, size_t) as they would expect, since it inherits from Print.
1 parent f62ce45 commit 2d13250

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/Adafruit_USBD_MIDI.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,8 @@ class Adafruit_USBD_MIDI : public Stream, Adafruit_USBD_Interface {
4646
virtual int peek(void);
4747
virtual void flush(void);
4848

49+
using Stream::write;
50+
4951
// Raw MIDI USB packet interface.
5052
bool send(const uint8_t packet[4]);
5153
bool receive(uint8_t packet[4]);

0 commit comments

Comments
 (0)