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

improve error handling #25

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

improve error handling #25

wants to merge 2 commits into from

Conversation

DeeNewcum
Copy link
Contributor

This adds two new errors:

  • "Error: ./pi400 must be run as root"
  • "Error: This must be added to /boot/config.txt and the system rebooted: dtoverlay=dwc2"

Without this error-checking, the beginner user gets some strange errors that don't really correspond to what they need to fix to proceed.

@DeeNewcum
Copy link
Contributor Author

I'm a little confused what #define NO_OUTPUT is for, or whether the call to prechecks() should be wrapped in it.

@Gadgetoid
Copy link
Owner

NO_OUTPUT is a slightly hamfisted way to disable output to the USB gadget, so the code can be tested on a system without it supported or set up.

IIRC you need root either way, for grabbing the local devices but I could be misremembering.

But yes, the dtoverlay=dwc2 check should be wrapped in #IFNDEF NO_OUTPUT

@Gadgetoid
Copy link
Owner

Thank you. I'll try to get this tested & merged this week.

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

Successfully merging this pull request may close these issues.

2 participants