diff --git a/backend/src/main.rs b/backend/src/main.rs index ed7733e..d8db9b5 100644 --- a/backend/src/main.rs +++ b/backend/src/main.rs @@ -1,5 +1,3 @@ -use std::str::from_utf8; - use backend::{AppState, app}; use color_eyre::eyre; use packets::Packet; diff --git a/firmware/src/wifi.rs b/firmware/src/wifi.rs index b807ef0..001b101 100644 --- a/firmware/src/wifi.rs +++ b/firmware/src/wifi.rs @@ -12,6 +12,10 @@ use esp_radio::wifi::{ use log::info; use static_cell::StaticCell; +#[allow( + clippy::large_stack_frames, + reason = "embassy StackResources is to large nothing we can do" +)] pub async fn init_wifi( wifi: esp_hal::peripherals::WIFI<'static>, spawner: &Spawner, @@ -22,11 +26,14 @@ pub async fn init_wifi( .with_ssid(env!("SSID")) .with_password(env!("PASSWORD").into()), ); - let (wifi_controller, interfaces) = esp_radio::wifi::new( + let (mut wifi_controller, interfaces) = esp_radio::wifi::new( wifi, ControllerConfig::default().with_initial_config(station_config), ) .expect("Failed to initialize Wi-Fi controller"); + wifi_controller + .set_power_saving(esp_radio::wifi::PowerSaveMode::Minimum) + .unwrap(); let wifi_interface = interfaces.station; let rng = Rng::new(); @@ -48,6 +55,7 @@ pub async fn init_wifi( stack } +#[allow(clippy::large_stack_frames)] #[embassy_executor::task] async fn connection(mut controller: WifiController<'static>, led_pin: GPIO2<'static>) { info!("start connection task");