Merge pull request #1197 into task/pr1197: a Calibrate gyro row on the Controls tab removes the aim drift of a controller with a large gyro bias (palxex)

This commit is contained in:
Valiantsin Dzerakh committed 2026-11-15 09:21:40 +03:00
commit 0a792f22c1
8 files changed
+343 -5

No files matched your search

+16
View File
@@ -960,6 +960,22 @@ static void tab_controls(float scale) {
opt_choice("TOTK_PROMPTS", UI_MENU_PROMPTS, prompts, 3, UI_MENU_PROMPTS_DESC, note);
bool ask = restart && opt_button("##restart", UI_MENU_RESTART, UI_MENU_RESTART_DESC);
opt_toggle("TOTK_MOTION", UI_MENU_MOTION, UI_MENU_MOTION_DESC);
opt_toggle("TOTK_GYRO_CALIBRATION", UI_MENU_GYRO_CALIBRATION, UI_MENU_GYRO_CALIBRATION_DESC);
if (input_gyro_calibration_enabled()) {
// The row exists only while the switch is on: with the bias not applied there is nothing to calibrate and no
// state to show.
char pad[128] = "";
int st = input_motion_calib_state(pad, sizeof pad);
char status[192] = "";
if (st == 1)
snprintf(status, sizeof status, "%s", menu_text(UI_MENU_GYRO_CALIBRATE_WAIT));
else if (st == 2)
snprintf(status, sizeof status, menu_text(UI_MENU_GYRO_CALIBRATED), pad);
else if (st == 3)
snprintf(status, sizeof status, "%s", menu_text(UI_MENU_GYRO_CALIBRATE_FAILED));
if (opt_button("##gyro_calib", UI_MENU_GYRO_CALIBRATE, UI_MENU_GYRO_CALIBRATE_DESC, status))
input_motion_calibrate();
}
opt_slider("TOTK_RUMBLE_STRENGTH", UI_MENU_RUMBLE_STRENGTH, 0, 300, UI_MENU_RUMBLE_STRENGTH_DESC, 10, "%.0f %%");
opt_slider("TOTK_RUMBLE_CURVE", UI_MENU_RUMBLE_CURVE, 0.2f, 1.5f, UI_MENU_RUMBLE_CURVE_DESC, 0.05f, "%.2f");
opt_toggle("TOTK_RUMBLE_TRIGGERS", UI_MENU_RUMBLE_TRIGGERS, UI_MENU_RUMBLE_TRIGGERS_DESC);