I'm developing an app that is using Teensy 4.0 to connect with USB Host to Android powered tablet. With this library of course and ADK class. In my code I'm waiting with writing to the device until ADK.ready(). But it hangs the system sometimes (quite often). With some time I found out that:
After the sequence requesting switching to accessory mode - in ADK::control case 7 - we change the state to 8...
... what makes ADK::ready() returning true.
But we still need to wait for another enumeration starting with ISR: 408C Port Change - handled by USBHost::isr().
So we have a race between IRQ and writing (happening because of ADK::ready).
So I just have removed "state++" in ADK::control case 7 - and it works.
I'm just writing it to point a problem to be considered. Maybe my solution is OK or maybe I should wait with writing for something else.
PS. Thank you for a great job with the library nevertheless!
I'm developing an app that is using Teensy 4.0 to connect with USB Host to Android powered tablet. With this library of course and ADK class. In my code I'm waiting with writing to the device until ADK.ready(). But it hangs the system sometimes (quite often). With some time I found out that:
I'm just writing it to point a problem to be considered. Maybe my solution is OK or maybe I should wait with writing for something else.
PS. Thank you for a great job with the library nevertheless!