Skip to content

Commit

Permalink
Fix bug with turbo speed change on MidiUSB
Browse files Browse the repository at this point in the history
  • Loading branch information
jmamma committed Apr 5, 2023
1 parent 40131de commit 5981ce8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion avr/cores/megacommand/MCL/MidiActivePeering.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ static MidiDevice *connected_midi_devices[2] = {&null_midi_device,
&null_midi_device};

void MidiActivePeering::disconnect(uint8_t port) {
DEBUG_PRINTLN("disconnect");
DEBUG_PRINTLN(port);
MidiUartClass *pmidi = _getMidiUart(port);
if (!pmidi) { return; }
MidiDevice **drivers;
Expand Down Expand Up @@ -182,7 +184,7 @@ void MidiActivePeering::run() {
resource_loaded = false;

//Setting USB turbo speed too early can cause OS upload to fail
if (turbo_light.lookup_speed(mcl_cfg.usb_turbo) != MidiUartUSB.speed && slowclock > 4000 && usb_set_speed) {
if (turbo_light.tmSpeeds[turbo_light.lookup_speed(mcl_cfg.usb_turbo)] != MidiUartUSB.speed && slowclock > 4000 && usb_set_speed) {
turbo_light.set_speed(turbo_light.lookup_speed(mcl_cfg.usb_turbo), MidiUSB.uart);
usb_set_speed = false;
}
Expand Down

0 comments on commit 5981ce8

Please sign in to comment.