chore(input): use AnyPin for button state func

This commit is contained in:
Naxdy 2024-04-18 18:00:53 +02:00
parent 6f1d49b164
commit d661abc882
Signed by: Naxdy
GPG key ID: CC15075846BCE91B

View file

@ -349,33 +349,20 @@ async fn update_stick_states(
} }
#[allow(clippy::too_many_arguments)] #[allow(clippy::too_many_arguments)]
fn update_button_states< fn update_button_states(
A: Pin,
B: Pin,
X: Pin,
Y: Pin,
Start: Pin,
L: Pin,
R: Pin,
Z: Pin,
DLeft: Pin,
DRight: Pin,
DUp: Pin,
DDown: Pin,
>(
gcc_state: &mut GcReport, gcc_state: &mut GcReport,
btn_a: &Input<'_, A>, btn_a: &Input<'_, AnyPin>,
btn_b: &Input<'_, B>, btn_b: &Input<'_, AnyPin>,
btn_x: &Input<'_, X>, btn_x: &Input<'_, AnyPin>,
btn_y: &Input<'_, Y>, btn_y: &Input<'_, AnyPin>,
btn_start: &Input<'_, Start>, btn_start: &Input<'_, AnyPin>,
btn_l: &Input<'_, L>, btn_l: &Input<'_, AnyPin>,
btn_r: &Input<'_, R>, btn_r: &Input<'_, AnyPin>,
btn_z: &Input<'_, Z>, btn_z: &Input<'_, AnyPin>,
btn_dleft: &Input<'_, DLeft>, btn_dleft: &Input<'_, AnyPin>,
btn_dright: &Input<'_, DRight>, btn_dright: &Input<'_, AnyPin>,
btn_dup: &Input<'_, DUp>, btn_dup: &Input<'_, AnyPin>,
btn_ddown: &Input<'_, DDown>, btn_ddown: &Input<'_, AnyPin>,
) { ) {
gcc_state.buttons_1.button_a = btn_a.is_low(); gcc_state.buttons_1.button_a = btn_a.is_low();
gcc_state.buttons_1.button_b = btn_b.is_low(); gcc_state.buttons_1.button_b = btn_b.is_low();