Skip to content

Commit

Permalink
Cali: Move cursor only after committing changes, not before.
Browse files Browse the repository at this point in the history
This shouldn't have functionally mattered, but there was at least one report regarding this, so it should be resolved?
  • Loading branch information
SeongGino committed Aug 28, 2024
1 parent 3bcc2c2 commit e6eec8c
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions SamcoEnhanced/SamcoEnhanced.ino
Original file line number Diff line number Diff line change
Expand Up @@ -1796,7 +1796,6 @@ void ExecCalMode()
Serial.printf("CalStage: %d\r\n", calStage);
// make sure our messages go through, or else the HID reports eats UART.
Serial.flush();
CaliMousePosMove(calStage);
switch(calStage) {
case Cali_Init:
break;
Expand All @@ -1821,29 +1820,21 @@ void ExecCalMode()
// Update Cam centre in perspective library
OpenFIREper.source(profileData[selectedProfile].adjX, profileData[selectedProfile].adjY);
OpenFIREper.deinit(0);
// Move to top calibration point
AbsMouse5.move(32768/2, 0);
break;

case Cali_Bottom:
// Set Offset buffer
topOffset = mouseY;
// Move to bottom calibration point
AbsMouse5.move(32768/2, 32766);
break;

case Cali_Left:
// Set Offset buffer
bottomOffset = (res_y - mouseY);
// Move to left calibration point
AbsMouse5.move(0, 32768/2);
break;

case Cali_Right:
// Set Offset buffer
leftOffset = mouseX;
// Move to right calibration point
AbsMouse5.move(32766, 32768/2);
break;

case Cali_Center:
Expand All @@ -1855,8 +1846,6 @@ void ExecCalMode()
profileData[selectedProfile].bottomOffset = bottomOffset;
profileData[selectedProfile].leftOffset = leftOffset;
profileData[selectedProfile].rightOffset = rightOffset;
// Move back to center calibration point
AbsMouse5.move(32768/2, 32768/2);
break;

case Cali_Verify:
Expand Down Expand Up @@ -1887,7 +1876,7 @@ void ExecCalMode()
break;
// Press A/B to restart cali for current profile
} else if(buttons.pressedReleased & ExitPauseModeHoldBtnMask) {
calStage = 0;
calStage = Cali_Init;
Serial.printf("CalStage: %d\r\n", Cali_Init);
Serial.flush();
// (re)set current values to factory defaults
Expand Down Expand Up @@ -1922,6 +1911,7 @@ void ExecCalMode()
}
break;
}
CaliMousePosMove(calStage);
}
}
// Break Cali
Expand Down

0 comments on commit e6eec8c

Please sign in to comment.