Skip to content

Commit 1bf32c5

Browse files
committed
MIDI: Specify number of cables with API call
1 parent abcff3f commit 1bf32c5

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

src/Adafruit_USBD_MIDI.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@
3535

3636
Adafruit_USBD_MIDI::Adafruit_USBD_MIDI(void) : _n_cables(1) {}
3737

38-
Adafruit_USBD_MIDI::Adafruit_USBD_MIDI(uint8_t n_cables)
39-
: _n_cables(n_cables) {}
38+
void Adafruit_USBD_MIDI::setCables(uint8_t n_cables) {
39+
_n_cables = n_cables;
40+
}
4041

4142
bool Adafruit_USBD_MIDI::begin(void) {
4243
if (!USBDevice.addInterface(*this))

src/Adafruit_USBD_MIDI.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
class Adafruit_USBD_MIDI : public Stream, Adafruit_USBD_Interface {
3131
public:
3232
Adafruit_USBD_MIDI(void);
33-
Adafruit_USBD_MIDI(uint8_t n_cables);
3433

3534
bool begin(void);
3635

@@ -55,6 +54,8 @@ class Adafruit_USBD_MIDI : public Stream, Adafruit_USBD_Interface {
5554
virtual uint16_t getDescriptor(uint8_t itfnum, uint8_t *buf,
5655
uint16_t bufsize);
5756

57+
void setCables(uint8_t n_cables);
58+
5859
private:
5960
uint8_t _n_cables;
6061
};

0 commit comments

Comments
 (0)