summaryrefslogtreecommitdiff
path: root/drivers/sensors/pmw3360.c
diff options
context:
space:
mode:
authorDrashna Jaelre <drashna@live.com>2021-12-15 13:41:07 -0800
committerGitHub <noreply@github.com>2021-12-15 13:41:07 -0800
commitaed64aaef4724c01a30b1815c0c910ca8b1a5e43 (patch)
tree785af8d14b310374997d8a4d959e4b00e658f246 /drivers/sensors/pmw3360.c
parent3fa592a4024a24a636fa0c562e6761667a94f565 (diff)
downloadqmk_firmware-aed64aaef4724c01a30b1815c0c910ca8b1a5e43.tar.gz
qmk_firmware-aed64aaef4724c01a30b1815c0c910ca8b1a5e43.zip
[Core] Fix Sensor driver code (#15484)
Diffstat (limited to 'drivers/sensors/pmw3360.c')
-rw-r--r--drivers/sensors/pmw3360.c2
1 files changed, 1 insertions, 1 deletions
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) {