diff options
author | Alabastard-64 <96358682+Alabastard-64@users.noreply.github.com> | 2021-12-27 03:18:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-27 21:18:35 +1100 |
commit | f08824f6eb169cb47599a56eb1162e168aac49c4 (patch) | |
tree | 2a4e8b0653c9e8f723362fcec0a06842fe7abda3 /drivers | |
parent | 740c47d4d7518c3b399fa5201201eb831a86b5a4 (diff) |
Fix for SPI write timing in PMW3360 driver (#15519)
Timing does not match Pixart documentation for this sensor (may have been carried forward from adns9800).
Not aware of any issues coming from this currently.
It should only cause issues when writing to multiple registers in succession which currently only happens during initialization for the PMW3360.
This should prevent future issues with write operations if other features of the sensor are added.
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/sensors/pmw3360.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/sensors/pmw3360.c b/drivers/sensors/pmw3360.c index 78d9c3bc8b..cebf4f25d8 100644 --- a/drivers/sensors/pmw3360.c +++ b/drivers/sensors/pmw3360.c @@ -108,10 +108,10 @@ spi_status_t spi_write_adv(uint8_t reg_addr, uint8_t data) { status = spi_write(data); // tSCLK-NCS for write operation - wait_us(20); + wait_us(35); - // tSWW/tSWR (=120us) minus tSCLK-NCS. Could be shortened, but is looks like a safe lower bound - wait_us(100); + // tSWW/tSWR (=180us) minus tSCLK-NCS. Could be shortened, but is looks like a safe lower bound + wait_us(145); spi_stop(); return status; } |