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

Add a timeout to the EverDrive side of the library #85

Closed
buu342 opened this issue Jul 20, 2022 · 5 comments
Closed

Add a timeout to the EverDrive side of the library #85

buu342 opened this issue Jul 20, 2022 · 5 comments
Assignees
Labels
Implemented This has been fixed but not yet published/pushed USB Library This is related to the USB library (usb.c)

Comments

@buu342
Copy link
Owner

buu342 commented Jul 20, 2022

anacierdem added 24d404e to the library, and it seemed to work fine with the samples, however a user was having trouble where his homebrew was failing to print. Later, we isolated a single sample which presented the same issue, being nu5 from libultra. We tried tweaking the function but we could not get it to work, so I undid the commit. See issue #83 for more information.

So unfortunately the solution proposed in the commit might not work well in a practical sense. Some alternative solution is needed, that is if the risk of the USB stalling permanantly is possible.

Hopefully this issue can be looked into by someone who owns an EverDrive?

@buu342 buu342 added the USB Library This is related to the USB library (usb.c) label Jul 20, 2022
@buu342 buu342 self-assigned this Jul 20, 2022
@buu342
Copy link
Owner Author

buu342 commented Jul 21, 2022

Paging @rasky and @anacierdem, since this could concern libdragon.

@anacierdem
Copy link
Contributor

anacierdem commented Jul 21, 2022

Found the original reason why this was added. It was taken from krikzz's repo to fix "something" that I don't remember. But I remember isolating that function as the source of the issue, comparing it to the reference code and this change was fixing the problem for me. Also note that I am using libdragon with this change for a very long time without any issues. I suspect it might have something to do with threading for the original sdk?

@anacierdem
Copy link
Contributor

After @rasky's reminder I remember this was to fix N64 side waiting too long if the PC is not listening and emptying the usb buffer. Also probably it was not waiting indefinitely but was slowing down the code too much. I will check how exactly it behaves.

@buu342
Copy link
Owner Author

buu342 commented Jul 21, 2022

That's a perfectly valid reason, the function just needs to be modified to output either error (on timeout) or zero on success, and subsequent calls to the function need to be modified to take the return value into account and branch accordingly, to prevent pushing data to the USB when it is still busy 😄

buu342 added a commit that referenced this issue Mar 26, 2023
@buu342 buu342 added the Implemented This has been fixed but not yet published/pushed label Mar 26, 2023
buu342 added a commit that referenced this issue Mar 26, 2023
@buu342
Copy link
Owner Author

buu342 commented Mar 26, 2023

Fixed in b716f17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Implemented This has been fixed but not yet published/pushed USB Library This is related to the USB library (usb.c)
Projects
None yet
Development

No branches or pull requests

2 participants