diff --git a/src/config.rs b/src/config.rs index 8fd1302..33f7d7f 100644 --- a/src/config.rs +++ b/src/config.rs @@ -574,19 +574,19 @@ impl<'a> StickCalibrationProcess<'a> { // TODO: phob does something related to undo here if self.calibration_step == NO_OF_CALIBRATION_POINTS as u8 { - stick_config.angles = *legalize_notches( - self.calibration_step as usize, - &self.applied_calibration.measured_notch_angles, - &self.applied_calibration.notch_angles, - ) - .to_packed_float_array(); - self.applied_calibration = AppliedCalibration::from_points( &self.cal_points.map(|e| e.x), &self.cal_points.map(|e| e.y), &stick_config, self.which_stick, ); + + stick_config.angles = *legalize_notches( + self.calibration_step as usize, + &self.applied_calibration.measured_notch_angles, + &DEFAULT_ANGLES, + ) + .to_packed_float_array(); } if self.calibration_step >= NO_OF_CALIBRATION_POINTS as u8 { @@ -626,6 +626,10 @@ impl<'a> StickCalibrationProcess<'a> { return true; } + if self.calibration_step == NO_OF_CALIBRATION_POINTS as u8 { + SIGNAL_CONFIG_CHANGE.signal(self.gcc_config.clone()); + } + return false; }