Skip to content

Commit

Permalink
Fix touchpad presses.
Browse files Browse the repository at this point in the history
  • Loading branch information
kareltucek committed Dec 26, 2024
1 parent 890a617 commit 1d53ce4
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions right/src/slave_drivers/touchpad_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ slave_result_t TouchpadDriver_Update(uint8_t uhkModuleDriverId)

ModuleConnectionStates[UhkModuleDriverId_RightModule].lastTimeConnected = CurrentTime;

#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wstrict-aliasing"
if (noFingers || deltaX || deltaY || *(uint16_t*)&gestureEvents || *(uint16_t*)&TouchpadEvents) {
#pragma GCC diagnostic pop
static bool somethingWasNonZero = false;
bool somethingIsNonZero = noFingers || deltaX || deltaY || ((uint8_t*)&gestureEvents)[0] || ((uint8_t*)&gestureEvents)[1];

if (somethingIsNonZero || somethingWasNonZero) {
bool somethingChanged = false;

if (
Expand Down Expand Up @@ -208,6 +208,7 @@ slave_result_t TouchpadDriver_Update(uint8_t uhkModuleDriverId)

res.status = I2cAsyncWrite(address, closeCommunicationWindow, sizeof(closeCommunicationWindow));
res.hold = false;
somethingWasNonZero = somethingIsNonZero;

phase = 3;
break;
Expand Down

0 comments on commit 1d53ce4

Please sign in to comment.