Commit 380fccf
committed
Fix SPI register masking in busWriteBuf
Correct the SPI register address masking in busWriteBuf() to clear the
MSB instead of setting it. For SPI protocol, the MSB indicates read (1)
or write (0) operations. Write operations should use (reg & 0x7F) to
clear the MSB, not (reg | 0x80) which sets it.
This matches the correct implementation in busWrite() at line 318 which
uses (reg & 0x7F) for write operations.
Note: This bug affects theoretical future SPI devices using buffer writes.
Current devices using busWriteBuf() are all I2C-based (VL53L0X, VL53L1X,
MLX90393, TERARANGER_EVO, US42 rangefinders) and are unaffected.
Fixes #106741 parent 0e9f842 commit 380fccf
1 file changed
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
283 | 283 | | |
284 | 284 | | |
285 | 285 | | |
286 | | - | |
| 286 | + | |
287 | 287 | | |
288 | 288 | | |
289 | 289 | | |
| |||
0 commit comments