Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix hexpansions not being consistently detected on hotplug
For mysterious reasons the GPIO expanders seem to not always update the state of port 1 when doing a multi-byte read. If we instead do two single-byte reads, we appear to get the correct state 100% of the time. The datasheet has some confusing lines about how you always need to send a write command before reading the port states - I believe readfrom_mem actually does this, but since it's not actually sending any data for the write, it's only technically writing to address 0, which only updates port 0 (hence why buttons work consistently - they're all port 0!)
- Loading branch information