Gadgetoid / pi400kb

Raw HID keyboard forwarder to turn the Pi 400 into a USB keyboard
MIT License
276 stars 36 forks source link

improve error handling #25

Open DeeNewcum opened 2 years ago

DeeNewcum commented 2 years ago

This adds two new errors:

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 commented 2 years ago

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

Gadgetoid commented 2 years ago

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 commented 2 years ago

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