Aharoni-Lab / Miniscope-DAQ-Cypress-firmware

DAQ firmware for V3 and V4 Miniscope platforms
15 stars 8 forks source link

Add a command to make the device perform a hard reset #14

Closed ximion closed 1 year ago

ximion commented 1 year ago

Hi! I was investigating buffer corruption and reconnection issues of the Miniscope on Linux (once disconnected, reconnecting didn't work 90% of the time, and occasionally buffers were corrupt causing striping), and I found an extremely good client-side workaround for this. While investigating the issue, I implemented this command to hard-reset a Miniscope DAQ board from software (just send 0xFE 0x01 as "I2C" command). Ultimately, no changes on the firmware were necessary to address the issues (it's now super reliable!), but the reset command is fairly useful for development, or if you just want to bring back the board into a known-good state without power-cycling it (maybe the USB port of it is hard to reach), so I thought it made sense to contribute this change back.

As a bonus, I also modernized the clang-format configuration from the last patch.

Thanks for considering! Cheers, Matthias

daharoni commented 1 year ago

Thanks!