chore: fix deprecated ref to static mut

This commit is contained in:
Naxdy 2024-10-14 16:52:41 +02:00
parent 1db551dc9d
commit e15a7c7bec
Signed by: Naxdy
GPG key ID: CC15075846BCE91B

View file

@ -9,6 +9,8 @@ mod input_filter;
mod stick; mod stick;
mod usb_comms; mod usb_comms;
use core::ptr::addr_of_mut;
use config::config_task; use config::config_task;
use defmt::info; use defmt::info;
use embassy_executor::Executor; use embassy_executor::Executor;
@ -72,33 +74,37 @@ fn main() -> ! {
let spi_acs = Output::new(AnyPin::from(p_acs), Level::High); // active low let spi_acs = Output::new(AnyPin::from(p_acs), Level::High); // active low
let spi_ccs = Output::new(AnyPin::from(p_ccs), Level::High); // active low let spi_ccs = Output::new(AnyPin::from(p_ccs), Level::High); // active low
spawn_core1(p.CORE1, unsafe { &mut CORE1_STACK }, move || { spawn_core1(
let executor1 = EXECUTOR1.init(Executor::new()); p.CORE1,
executor1.run(|spawner| { unsafe { addr_of_mut!(CORE1_STACK).as_mut().unwrap() },
spawner.spawn(usb_transfer_task(uid, driver)).unwrap(); move || {
spawner.spawn(enter_config_mode_task()).unwrap(); let executor1 = EXECUTOR1.init(Executor::new());
spawner executor1.run(|spawner| {
.spawn(rumble_task(p.PIN_25, p.PIN_29, p.PWM_SLICE4, p.PWM_SLICE6)) spawner.spawn(usb_transfer_task(uid, driver)).unwrap();
.unwrap(); spawner.spawn(enter_config_mode_task()).unwrap();
// spawner.spawn(input_integrity_benchmark()).unwrap(); spawner
spawner .spawn(rumble_task(p.PIN_25, p.PIN_29, p.PWM_SLICE4, p.PWM_SLICE6))
.spawn(update_button_state_task( .unwrap();
Input::new(AnyPin::from(p.PIN_20), gpio::Pull::Up), // spawner.spawn(input_integrity_benchmark()).unwrap();
Input::new(AnyPin::from(p.PIN_17), gpio::Pull::Up), spawner
Input::new(AnyPin::from(p.PIN_16), gpio::Pull::Up), .spawn(update_button_state_task(
Input::new(AnyPin::from(p.PIN_11), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_20), gpio::Pull::Up),
Input::new(AnyPin::from(p.PIN_9), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_17), gpio::Pull::Up),
Input::new(AnyPin::from(p.PIN_10), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_16), gpio::Pull::Up),
Input::new(AnyPin::from(p.PIN_8), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_11), gpio::Pull::Up),
Input::new(AnyPin::from(p.PIN_22), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_9), gpio::Pull::Up),
Input::new(AnyPin::from(p.PIN_21), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_10), gpio::Pull::Up),
Input::new(AnyPin::from(p.PIN_18), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_8), gpio::Pull::Up),
Input::new(AnyPin::from(p.PIN_19), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_22), gpio::Pull::Up),
Input::new(AnyPin::from(p.PIN_5), gpio::Pull::Up), Input::new(AnyPin::from(p.PIN_21), gpio::Pull::Up),
)) Input::new(AnyPin::from(p.PIN_18), gpio::Pull::Up),
.unwrap() Input::new(AnyPin::from(p.PIN_19), gpio::Pull::Up),
}); Input::new(AnyPin::from(p.PIN_5), gpio::Pull::Up),
}); ))
.unwrap()
});
},
);
let executor0 = EXECUTOR0.init(Executor::new()); let executor0 = EXECUTOR0.init(Executor::new());
info!("Initialized."); info!("Initialized.");