Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ADK hangs sometimes on write - with fix proposition #79

Open
hellmutbrudny opened this issue Jan 21, 2022 · 0 comments
Open

ADK hangs sometimes on write - with fix proposition #79

hellmutbrudny opened this issue Jan 21, 2022 · 0 comments

Comments

@hellmutbrudny
Copy link

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:

  1. After the sequence requesting switching to accessory mode - in ADK::control case 7 - we change the state to 8...
  2. ... what makes ADK::ready() returning true.
  3. But we still need to wait for another enumeration starting with ISR: 408C Port Change - handled by USBHost::isr().
  4. So we have a race between IRQ and writing (happening because of ADK::ready).
  5. 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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant