diff options
author | Dasky <[email protected]> | 2024-01-23 10:05:59 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2024-01-23 10:05:59 +0000 |
commit | 2c3d0126bae9bd70a4b6746be83e4b91f8fbb5d9 (patch) | |
tree | 16e36a7df64b8f3ae4756feb53ca5ac874b79ea3 /drivers/sensors | |
parent | e46285b9285eee848e5cf1d9ee29aa881eb1c04e (diff) | |
download | qmk_firmware-2c3d0126bae9bd70a4b6746be83e4b91f8fbb5d9.tar.gz qmk_firmware-2c3d0126bae9bd70a4b6746be83e4b91f8fbb5d9.zip |
crique zidle fix (#22948)
Diffstat (limited to 'drivers/sensors')
-rw-r--r-- | drivers/sensors/cirque_pinnacle.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/sensors/cirque_pinnacle.c b/drivers/sensors/cirque_pinnacle.c index 38e1fae3e3..9afc9df804 100644 --- a/drivers/sensors/cirque_pinnacle.c +++ b/drivers/sensors/cirque_pinnacle.c @@ -218,9 +218,16 @@ void cirque_pinnacle_cursor_smoothing(bool enable) { // Check sensor is connected bool cirque_pinnacle_connected(void) { - uint8_t zidle = 0; - RAP_ReadBytes(HOSTREG__ZIDLE, &zidle, 1); - return zidle == HOSTREG__ZIDLE_DEFVAL; + uint8_t current_zidle = 0; + uint8_t temp_zidle = 0; + RAP_ReadBytes(HOSTREG__ZIDLE, ¤t_zidle, 1); + RAP_Write(HOSTREG__ZIDLE, HOSTREG__ZIDLE_DEFVAL); + RAP_ReadBytes(HOSTREG__ZIDLE, &temp_zidle, 1); + if (temp_zidle == HOSTREG__ZIDLE_DEFVAL) { + RAP_Write(HOSTREG__ZIDLE, current_zidle); + return true; + } + return false; } /* Pinnacle-based TM040040/TM035035/TM023023 Functions */ |