summaryrefslogtreecommitdiff
path: root/drivers/sensors/pmw3360.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/sensors/pmw3360.c')
-rw-r--r--drivers/sensors/pmw3360.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/sensors/pmw3360.c b/drivers/sensors/pmw3360.c
index 50d1c35801..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;
}
@@ -184,7 +184,7 @@ bool pmw3360_init(void) {
spi_write_adv(REG_Config2, 0x00);
- spi_write_adv(REG_Angle_Tune, constrain(ROTATIONAL_TRANSFORM_ANGLE, -30, 30));
+ spi_write_adv(REG_Angle_Tune, constrain(ROTATIONAL_TRANSFORM_ANGLE, -127, 127));
spi_write_adv(REG_Lift_Config, PMW3360_LIFTOFF_DISTANCE);