Open Willmac16 opened 9 months ago
For reference, when the original code is run, my compiler spits out:
.pio/libdeps/teensymm/SX1509 IO Expander/src/SparkFunSX1509.cpp: In member function 'bool SX1509::readPin(uint8_t, bool*)':
.pio/libdeps/teensymm/SX1509 IO Expander/src/SparkFunSX1509.cpp:789:26: warning: array subscript 1 is outside array bounds of 'uint16_t [1]' {aka 'short unsigned int [1]'} [-Warray-bounds]
789 | value[1] = dest[0];
| ~~~~~~~~~^~~~~~~~~
.pio/libdeps/teensymm/SX1509 IO Expander/src/SparkFunSX1509.cpp:212:18: note: while referencing 'tempRegDir'
212 | uint16_t tempRegDir;
Existing implementation accessed memory it shouldn't, and didn't write both values to the target uint16_t.