add TinyUSBDevice.ready() guard in send_cc to prevent crash
This commit is contained in:
@@ -92,6 +92,7 @@ void UsbMidiTransport::send_note_off(uint8_t channel, uint8_t note, uint8_t velo
|
||||
|
||||
void UsbMidiTransport::send_cc(uint8_t channel, uint8_t cc, uint8_t value) {
|
||||
if (!initialized) return;
|
||||
if (!TinyUSBDevice.ready()) return;
|
||||
uint8_t packet[4] = {0x0B, (uint8_t)(0xB0 | (channel - 1)), cc, value};
|
||||
usb_midi.writePacket(packet);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user