diff --git a/src/bin/main.rs b/src/bin/main.rs index 54e353d..4235be9 100644 --- a/src/bin/main.rs +++ b/src/bin/main.rs @@ -11,7 +11,7 @@ use core::ptr::addr_of_mut; use embassy_executor::Spawner; use embassy_time::{Instant, Timer}; -use esp_hal::{gpio::{Output, OutputConfig}, peripherals, time::Rate}; +use esp_hal::{gpio::{Output, OutputConfig}, time::Rate}; #[allow(unused_imports)] use esp_hal::{ clock::CpuClock, interrupt::software::SoftwareInterruptControl, system::{AppCoreGuard, CpuControl, Stack}, timer::{systimer::SystemTimer, timg::{TimerGroup, Wdt}}, diff --git a/src/display.rs b/src/display.rs index 5f2f8f2..466079b 100644 --- a/src/display.rs +++ b/src/display.rs @@ -1,4 +1,4 @@ -use embassy_sync::{blocking_mutex::{raw::CriticalSectionRawMutex, Mutex}, signal::Signal, watch::{Receiver, Watch}}; +use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, signal::Signal, watch::{Receiver, Watch}}; use figments::prelude::*; use core::{fmt::Debug, sync::atomic::{AtomicBool, AtomicU8}}; use alloc::sync::Arc; @@ -202,7 +202,7 @@ impl DisplayControls { } impl GammaCorrected for DisplayControls { - fn set_gamma(&mut self, gamma: GammaCurve) { + fn set_gamma(&mut self, _gamma: GammaCurve) { todo!() } } diff --git a/src/ego/engine.rs b/src/ego/engine.rs index 70260b3..bb6ed26 100644 --- a/src/ego/engine.rs +++ b/src/ego/engine.rs @@ -7,7 +7,7 @@ use nalgebra::{ComplexField, RealField}; use core::fmt::Debug; -use crate::{ego::{heading::HeadingEstimator, kalman::Ekf2D, orientation::OrientationEstimator}, events::{Notification, Prediction, Telemetry}, idle::IdleClock, Breaker, CircularBuffer}; +use crate::{ego::{heading::HeadingEstimator, kalman::Ekf2D, orientation::OrientationEstimator}, events::{Notification, Prediction}, idle::IdleClock, Breaker, CircularBuffer}; #[derive(PartialEq, Debug, Default, Clone, Copy)] pub enum MotionState { diff --git a/src/tasks/demo.rs b/src/tasks/demo.rs index 7b20bd3..d1a4ca0 100644 --- a/src/tasks/demo.rs +++ b/src/tasks/demo.rs @@ -1,4 +1,4 @@ -use embassy_sync::{channel::DynamicSender, pubsub::DynPublisher}; +use embassy_sync::pubsub::DynPublisher; use embassy_time::Timer; use crate::events::{Notification, Scene}; diff --git a/src/tasks/mpu.rs b/src/tasks/mpu.rs index a3e2ed4..f4ebead 100644 --- a/src/tasks/mpu.rs +++ b/src/tasks/mpu.rs @@ -1,5 +1,4 @@ use core::cell::RefCell; -use core::u8; use embassy_embedded_hal::shared_bus::asynch::i2c::I2cDevice; use embassy_sync::{blocking_mutex::raw::CriticalSectionRawMutex, channel::DynamicSender}; @@ -7,11 +6,7 @@ use embassy_time::{Delay, Timer, Instant}; use esp_hal::{i2c::master::I2c, Async}; use log::*; use mpu6050_dmp::{address::Address, calibration::CalibrationParameters, error_async::Error, sensor_async::Mpu6050}; -use mpu6050_dmp::{ - calibration::CalibrationActions, - accel::Accel, - gyro::Gyro -}; +use mpu6050_dmp::calibration::CalibrationActions; use nalgebra::Vector3; use core::f32::consts::PI; use crate::events::SensorSource; @@ -134,7 +129,7 @@ async fn mpu_init(sensor: &mut Mpu6050, mut events: DynSubscriber<'sta let mut display = Ssd1306Async::new(interface.replace(None).unwrap(), DisplaySize128x64, DisplayRotation::Rotate0) .into_buffered_graphics_mode(); if let Err(e) = display.init().await { + warn!("Failed to set up OLED display: {e:?}"); interface.replace(Some(display.release())); Err(()) } else { diff --git a/src/tasks/safetyui.rs b/src/tasks/safetyui.rs index 69d8c99..a7996cb 100644 --- a/src/tasks/safetyui.rs +++ b/src/tasks/safetyui.rs @@ -1,14 +1,13 @@ -use embassy_sync::{channel::DynamicReceiver, pubsub::DynSubscriber}; +use embassy_sync::pubsub::DynSubscriber; use embassy_time::{Duration, Timer}; use figments::prelude::*; use figments_render::output::Brightness; -use rgb::{Rgb, Rgba}; -use log::*; -use alloc::sync::Arc; +use rgb::Rgba; use core::fmt::Debug; use futures::join; +use log::*; -use crate::{animation::{AnimDisplay, AnimatedSurface, Animation}, display::{DisplayControls, SegmentSpace, Uniforms}, events::{Notification, Scene, SensorSource}, shaders::*, tasks::ui::UiSurfacePool}; +use crate::{animation::{AnimDisplay, AnimatedSurface, Animation}, display::{DisplayControls, SegmentSpace, Uniforms}, events::Notification, shaders::*, tasks::ui::UiSurfacePool}; pub struct SafetyUi { // Headlight and brakelight layers can only be overpainted by the bootsplash overlay layer diff --git a/src/tasks/ui.rs b/src/tasks/ui.rs index 1846c5b..c5d2a6c 100644 --- a/src/tasks/ui.rs +++ b/src/tasks/ui.rs @@ -1,13 +1,12 @@ -use embassy_sync::{channel::{DynamicReceiver, DynamicSender}, pubsub::{DynPublisher, DynSubscriber}}; +use embassy_sync::pubsub::{DynPublisher, DynSubscriber}; use embassy_time::{Duration, Timer}; use figments::prelude::*; use rgb::{Rgb, Rgba}; -use log::*; -use alloc::sync::Arc; use core::fmt::Debug; use futures::join; +use log::*; -use crate::{animation::{AnimDisplay, AnimatedSurface, Animation}, display::{SegmentSpace, Uniforms}, events::{Notification, Scene, SensorSource, Telemetry}, shaders::*}; +use crate::{animation::{AnimatedSurface, Animation}, display::{SegmentSpace, Uniforms}, events::{Notification, Scene, SensorSource, Telemetry}, shaders::*}; pub struct Ui { // Background layer provides an always-running background for everything to draw on @@ -176,7 +175,7 @@ impl + 'static>(&mut self, shader: T) { + fn set_shader + 'static>(&mut self, _shader: T) { unimplemented!() } diff --git a/src/tasks/wifi.rs b/src/tasks/wifi.rs index dd7a114..e3a269a 100644 --- a/src/tasks/wifi.rs +++ b/src/tasks/wifi.rs @@ -1,14 +1,13 @@ -use bleps::{ad_structure::{create_advertising_data, AdStructure, BR_EDR_NOT_SUPPORTED, LE_GENERAL_DISCOVERABLE}, attribute_server::{AttributeServer, NotificationData}, gatt, Ble, HciConnector}; +use bleps::{ad_structure::{create_advertising_data, AdStructure, BR_EDR_NOT_SUPPORTED, LE_GENERAL_DISCOVERABLE}, attribute_server::AttributeServer, gatt, Ble, HciConnector}; use embassy_sync::channel::DynamicReceiver; use embassy_sync::pubsub::DynSubscriber; -use embassy_time::Timer; use esp_hal::timer::AnyTimer; use esp_wifi::ble::controller::BleConnector; use log::*; use crate::events::Notification; -pub async fn ble_task(notify: DynSubscriber<'static, Notification>, wifi_init: &esp_wifi::EspWifiController<'_>, bluetooth_device: esp_hal::peripherals::BT<'static>) { +pub async fn ble_task(_notify: DynSubscriber<'static, Notification>, wifi_init: &esp_wifi::EspWifiController<'_>, bluetooth_device: esp_hal::peripherals::BT<'static>) { info!("Setting up BLE stack"); let connector = BleConnector::new(wifi_init, bluetooth_device); let get_millis = || esp_hal::time::Instant::now().duration_since_epoch().as_millis(); @@ -61,7 +60,7 @@ pub async fn ble_task(notify: DynSubscriber<'static, Notification>, wifi_init: & ] }]); let mut rng = bleps::no_rng::NoRng; - let mut srv = AttributeServer::new(&mut ble, &mut gatt_attributes, &mut rng); + let mut _srv = AttributeServer::new(&mut ble, &mut gatt_attributes, &mut rng); info!("BLE running!"); // TODO: Somehow need to recreate the attributeserver after disconnecting? @@ -89,9 +88,9 @@ pub async fn ble_task(notify: DynSubscriber<'static, Notification>, wifi_init: & // TODO: Wifi task needs to know when there is data to upload, so it only connects when needed. #[embassy_executor::task] -pub async fn wireless_task(notify: DynamicReceiver<'static, Notification>, timer: AnyTimer<'static>, rng: esp_hal::peripherals::RNG<'static>, _wifi_device: esp_hal::peripherals::WIFI<'static>, bluetooth_device: esp_hal::peripherals::BT<'static>) { +pub async fn wireless_task(_notify: DynamicReceiver<'static, Notification>, timer: AnyTimer<'static>, rng: esp_hal::peripherals::RNG<'static>, _wifi_device: esp_hal::peripherals::WIFI<'static>, _bluetooth_device: esp_hal::peripherals::BT<'static>) { let rng = esp_hal::rng::Rng::new(rng); - let wifi_init = + let _wifi_init = esp_wifi::init(timer, rng).expect("Failed to initialize WIFI/BLE controller"); //ble_task(notify, &wifi_init, bluetooth_device).await;