laamaa / m8c

Cross-platform M8 tracker headless client
Other
380 stars 81 forks source link

Refactor serial port usage #92

Closed v3rm0n closed 1 year ago

v3rm0n commented 1 year ago

Closes #91

v3rm0n commented 1 year ago

Actually I would like to change it so that libserialport is always the default and I'll add libusb implementation which can be turned on by specifying USE_LIBUSB

v3rm0n commented 1 year ago

I'm marking it as a draft for now beecause I want to improve it a bit. I don't like the way that the filehandle works currently and it's pretty hard to do other libusb related stuff (like audio). Will work on it a bit more.

v3rm0n commented 1 year ago

I think it looks better now.

laamaa commented 1 year ago

Thanks for the PR! This is actually more how I originally wanted to make the program work, but didn't have the skills.. :)

Tested by editing makefile manually, adding libusb-1.0 to pkg-config parameters and compiling with CFLAGS=-DUSE_LIBUSB, seemed to work fine with that and by compiling "normally". With libusb there were occasional glitches in the graphics, but nothing too big.

A few thoughts:

v3rm0n commented 1 year ago

Probably some parameters need a bit of tuning to get it to work optimally. I just used whatever started to work (like #define serial_read_size 512)

laamaa commented 1 year ago

Thank you!! :)