Skip to content

Commit

Permalink
Use wheel instead of mouse during calibration
Browse files Browse the repository at this point in the history
more precision
  • Loading branch information
Slamy committed Mar 22, 2024
1 parent 80e6dc2 commit 221d93d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
8 changes: 4 additions & 4 deletions c64tool/calibration.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,20 +53,20 @@ void display_calibration_state() {
"on your mouse.\r\n");
break;
case kCalibratePotX64:
cputs("Slide mouse to make Pot X stable 64... \r\n"
cputs("Use wheel to make Pot X stable 64. \r\n"
"Press left mouse button to continue \r\n"
"Press right mouse button to abort \r\n");
cclearxy(0, 13, 40);

break;
case kCalibratePotX191:
cprintf("Slide mouse to make Pot X stable 191...\r\n");
cputs("Use wheel to make Pot X stable 191. \r\n");
break;
case kCalibratePotY64:
cprintf("Slide mouse to make Pot Y stable 64... \r\n");
cputs("Use wheel to make Pot Y stable 64. \r\n");
break;
case kCalibratePotY191:
cprintf("Slide mouse to make Pot Y stable 191...\r\n");
cputs("Use wheel to make Pot Y stable 191. \r\n");
break;
}
}
Expand Down
11 changes: 6 additions & 5 deletions src/processors/mouse_c1351.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ class C1351Converter : public RunnableMouseReportProcessor {
// Make the calibration fluctuate during calibration mode
// to improve the results after calibration.
if (operating_state_ != OperatingState::kEffective) {
calibration += (values_pushed_cnt_ & 0x08) ? 10 : -10;
calibration += (values_pushed_cnt_ & 0x08) ? 20 : -20;
}

pio_sm_put(pio_, sm, (kDrainLength + pot_value) * kDigitPerUs + calibration);
Expand Down Expand Up @@ -327,28 +327,29 @@ class C1351Converter : public RunnableMouseReportProcessor {
}
break;
case OperatingState::kCalibratePotX64:
calib.pot_x_64_ += mouse_report.relx;
calib.pot_x_64_ += mouse_report.wheel;

if (state_.fire1 && !last_state_.fire1) {
operating_state_ = OperatingState::kCalibratePotX191;
PRINTF("To kCalibratePotX191\n");
}
break;
case OperatingState::kCalibratePotX191:
calib.pot_x_191_ += mouse_report.relx;
calib.pot_x_191_ += mouse_report.wheel;
if (state_.fire1 && !last_state_.fire1) {
operating_state_ = OperatingState::kCalibratePotY64;
PRINTF("To kCalibratePotY64\n");
}
break;
case OperatingState::kCalibratePotY64:
calib.pot_y_64_ += mouse_report.relx;
calib.pot_y_64_ += mouse_report.wheel;
if (state_.fire1 && !last_state_.fire1) {
operating_state_ = OperatingState::kCalibratePotY191;
PRINTF("To kCalibratePotY191\n");
}
break;
case OperatingState::kCalibratePotY191:
calib.pot_y_191_ += mouse_report.relx;
calib.pot_y_191_ += mouse_report.wheel;
if (state_.fire1 && !last_state_.fire1) {
operating_state_ = OperatingState::kEffective;
PRINTF("Calibration finished! %ld %ld %ld %ld\n", calib.pot_x_64_, calib.pot_x_191_, calib.pot_y_64_,
Expand Down

0 comments on commit 221d93d

Please sign in to comment.