pd-rs / crank

A wrapper for cargo to use creating games for the Playdate handheld gaming system.
MIT License
83 stars 16 forks source link

On Linux, find the Playdate serial device if possible #38

Closed tjkirch closed 1 year ago

tjkirch commented 1 year ago
This will use the /dev/serial/by-id/usb-Panic_Inc_Playdate_PDU1-*
symlink to find the appropriate serial device, if possible.  If the
PLAYDATE_SERIAL_DEVICE variable is set, that will take precedence.  If
multiple Playdate devices are found, the user is told, and the first is
used.  If none are found, the same /dev/ttyACM0 backup will be used.

This should eliminate the issue of a new crank user on Linux having to set PLAYDATE_SERIAL_DEVICE and having a bit of trouble getting started. Other devices can use /dev/ttyACM0, like my keyboard, so I ran into this.

Should address the Linux case for #24.

I tested the following cases on Linux:

tjkirch commented 1 year ago

The integration tests failed, only on Mac OS, with a crate fetch error for zip-extensions. The only thing that changed related to that is that there was no newline at the end of Cargo.toml before, and I added a couple lines at the end of the file, so now there's a newline at the end of that line. I've never had anything like that cause a fetch error before, though... I wonder if it would pass on a retry?

rtsuk commented 1 year ago

I tested this PR and it worked fine on Mac.