From aed64aaef4724c01a30b1815c0c910ca8b1a5e43 Mon Sep 17 00:00:00 2001 From: Drashna Jaelre Date: Wed, 15 Dec 2021 13:41:07 -0800 Subject: [Core] Fix Sensor driver code (#15484) --- drivers/sensors/pmw3360.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'drivers/sensors/pmw3360.c') diff --git a/drivers/sensors/pmw3360.c b/drivers/sensors/pmw3360.c index 7e830cdde0..50d1c35801 100644 --- a/drivers/sensors/pmw3360.c +++ b/drivers/sensors/pmw3360.c @@ -143,7 +143,7 @@ void pmw3360_set_cpi(uint16_t cpi) { uint16_t pmw3360_get_cpi(void) { uint8_t cpival = spi_read_adv(REG_Config1); - return (uint16_t)(cpival & 0xFF) * 100; + return (uint16_t)((cpival + 1) & 0xFF) * 100; } bool pmw3360_init(void) { -- cgit v1.2.1