Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cirque connected check #22948

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions drivers/sensors/cirque_pinnacle.c
Original file line number Diff line number Diff line change
Expand Up @@ -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, &current_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 */
Expand Down