I'm testing a basic code sending MIDI via usbHost on a Teensy 4.1 (lets call this the controller).
I have the host port connected to another MIDI device (lets call this device B).
Device B runs usbMIDI.read() in a loop. Once Device B gets put into a loop where it does not run usbMIDI.read(), the controller hangs. I believe the controller is waiting for a response from the USB Device when it sends a MIDI message.
I've narrowed it down the the usbHost code not removing the transfer from the async followup list (remove_from_async_followup_list).
Is there any way I can prevent the controller from stalling if it does not receive a response from the USB device?
Code:
// Simple test of USB Host
//
// This example is in the public domain
#include "USBHost_t36.h"
USBHost myusb;
USBHub hub1(myusb);
USBHub hub2(myusb);
USBHub hub3(myusb);
KeyboardController keyboard1(myusb);
KeyboardController keyboard2(myusb);
MIDIDevice midi1(myusb);
void setup()
{
while (!Serial) ; // wait for Arduino Serial Monitor
Serial.println("USB Host Testing");
myusb.begin();
}
void loop()
{
myusb.Task();
midi1.read();
midi1.send(0xB0, 0, 0, 5);
delay(1);
Serial.print(millis());
Serial.println(" send");
}
I have the host port connected to another MIDI device (lets call this device B).
Device B runs usbMIDI.read() in a loop. Once Device B gets put into a loop where it does not run usbMIDI.read(), the controller hangs. I believe the controller is waiting for a response from the USB Device when it sends a MIDI message.
I've narrowed it down the the usbHost code not removing the transfer from the async followup list (remove_from_async_followup_list).
Is there any way I can prevent the controller from stalling if it does not receive a response from the USB device?