change(config): remove notch adjustment logic (for now)
All checks were successful
Publish nightly release / build (push) Successful in 2m6s
All checks were successful
Publish nightly release / build (push) Successful in 2m6s
This commit is contained in:
parent
0090116003
commit
03d5c478ef
3 changed files with 20 additions and 49 deletions
|
@ -61,7 +61,7 @@ codegen-units = 1
|
|||
debug = 2
|
||||
debug-assertions = true
|
||||
incremental = false
|
||||
opt-level = 3
|
||||
opt-level = 1
|
||||
lto = "fat"
|
||||
overflow-checks = true
|
||||
|
||||
|
@ -72,7 +72,7 @@ debug = 2
|
|||
debug-assertions = false
|
||||
incremental = false
|
||||
lto = 'fat'
|
||||
opt-level = 3
|
||||
opt-level = 1
|
||||
overflow-checks = false
|
||||
|
||||
# do not optimize proc-macro crates = faster builds from scratch
|
||||
|
|
|
@ -19,7 +19,7 @@ use crate::{
|
|||
},
|
||||
stick::{
|
||||
calc_stick_values, legalize_notches, AppliedCalibration, NotchStatus, CALIBRATION_ORDER,
|
||||
NOTCH_ADJUSTMENT_ORDER, NO_OF_ADJ_NOTCHES, NO_OF_CALIBRATION_POINTS, NO_OF_NOTCHES,
|
||||
NO_OF_CALIBRATION_POINTS, NO_OF_NOTCHES,
|
||||
},
|
||||
ADDR_OFFSET, FLASH_SIZE,
|
||||
};
|
||||
|
@ -484,32 +484,6 @@ impl<'a> StickCalibrationProcess<'a> {
|
|||
}
|
||||
|
||||
if self.calibration_step >= NO_OF_CALIBRATION_POINTS as u8 {
|
||||
let mut notch_idx = NOTCH_ADJUSTMENT_ORDER[min(
|
||||
self.calibration_step - NO_OF_CALIBRATION_POINTS as u8,
|
||||
NO_OF_ADJ_NOTCHES as u8 - 1,
|
||||
) as usize];
|
||||
|
||||
while self.applied_calibration.cleaned_calibration.notch_status[notch_idx]
|
||||
== NotchStatus::TertInactive
|
||||
&& self.calibration_step < NO_OF_CALIBRATION_POINTS as u8 + NO_OF_ADJ_NOTCHES as u8
|
||||
{
|
||||
stick_config.angles = *legalize_notches(
|
||||
self.calibration_step as usize,
|
||||
&self.applied_calibration.measured_notch_angles,
|
||||
&stick_config.angles.map(|e| *e),
|
||||
)
|
||||
.to_packed_float_array();
|
||||
|
||||
self.calibration_step += 1;
|
||||
|
||||
notch_idx = NOTCH_ADJUSTMENT_ORDER[min(
|
||||
self.calibration_step - NO_OF_CALIBRATION_POINTS as u8,
|
||||
NO_OF_ADJ_NOTCHES as u8 - 1,
|
||||
) as usize];
|
||||
}
|
||||
}
|
||||
|
||||
if self.calibration_step >= NO_OF_CALIBRATION_POINTS as u8 + NO_OF_ADJ_NOTCHES as u8 {
|
||||
stick_config.cal_points_x = self.cal_points.map(|p| p.x.into());
|
||||
stick_config.cal_points_y = self.cal_points.map(|p| p.y.into());
|
||||
|
||||
|
@ -528,30 +502,26 @@ impl<'a> StickCalibrationProcess<'a> {
|
|||
SIGNAL_IS_CALIBRATING.signal(true);
|
||||
|
||||
while {
|
||||
if self.calibration_step < NO_OF_CALIBRATION_POINTS as u8 {
|
||||
let (x, y) = get_stick_display_coords(self.calibration_step as usize);
|
||||
debug!(
|
||||
"Raw display coords for step {}: {}, {}",
|
||||
self.calibration_step, x, y
|
||||
);
|
||||
SIGNAL_OVERRIDE_STICK_STATE.signal(Some(OverrideStickState {
|
||||
x: x as u8,
|
||||
y: y as u8,
|
||||
which_stick: match self.which_stick {
|
||||
Stick::ControlStick => Stick::CStick,
|
||||
Stick::CStick => Stick::ControlStick,
|
||||
},
|
||||
}));
|
||||
} else {
|
||||
// TODO: phob calls `adjustNotch` here
|
||||
}
|
||||
let (x, y) = get_stick_display_coords(self.calibration_step as usize);
|
||||
debug!(
|
||||
"Raw display coords for step {}: {}, {}",
|
||||
self.calibration_step, x, y
|
||||
);
|
||||
SIGNAL_OVERRIDE_STICK_STATE.signal(Some(OverrideStickState {
|
||||
x: x as u8,
|
||||
y: y as u8,
|
||||
which_stick: match self.which_stick {
|
||||
Stick::ControlStick => Stick::CStick,
|
||||
Stick::CStick => Stick::ControlStick,
|
||||
},
|
||||
}));
|
||||
|
||||
gcc_subscriber
|
||||
.wait_for_button_release(&AwaitableButtons::A)
|
||||
.await;
|
||||
|
||||
// Prevent accidental double presses
|
||||
Timer::after_millis(100).await;
|
||||
Timer::after_millis(20).await;
|
||||
|
||||
gcc_subscriber
|
||||
.wait_for_button_press(&AwaitableButtons::A)
|
||||
|
@ -659,7 +629,7 @@ pub async fn config_task(
|
|||
});
|
||||
|
||||
// Wait for the user to release the buttons
|
||||
Timer::after_millis(500).await;
|
||||
Timer::after_millis(1500).await;
|
||||
|
||||
configuration_main_loop(¤t_config, &mut flash, &mut gcc_subscriber).await;
|
||||
|
||||
|
|
|
@ -494,6 +494,7 @@ pub async fn update_button_state_task(
|
|||
///
|
||||
/// Has to run on core0 because it makes use of SPI0.
|
||||
#[embassy_executor::task]
|
||||
#[link_section = ".time_critical.update_stick_states_task"]
|
||||
pub async fn update_stick_states_task(
|
||||
spi: Spi<'static, SPI0, embassy_rp::spi::Blocking>,
|
||||
spi_acs: Output<'static, AnyPin>,
|
||||
|
@ -554,7 +555,7 @@ pub async fn update_stick_states_task(
|
|||
match Instant::now() {
|
||||
n => {
|
||||
match (n - last_loop_time).as_micros() {
|
||||
a if a > 19999 => debug!("Loop took {} us", a),
|
||||
a if a > 1999 => debug!("Loop took {} us", a),
|
||||
_ => {}
|
||||
};
|
||||
last_loop_time = n;
|
||||
|
|
Loading…
Reference in a new issue