oled: rewrite the oled UI to have animations, and support a version of sleeping where the display is blank, at least

This commit is contained in:
2025-10-17 20:28:55 +02:00
parent 25a7dc7e18
commit 2dcdca0675
5 changed files with 358 additions and 118 deletions

View File

@@ -61,7 +61,7 @@ async fn main(spawner: Spawner) {
let timer1 = TimerGroup::new(peripherals.TIMG1);
let mut ui_wdt = timer1.wdt;
ui_wdt.set_timeout(esp_hal::timer::timg::MwdtStage::Stage0, esp_hal::time::Duration::from_secs(10));
ui_wdt.enable(); //FIXME: Re-enable UI watchdog once we have a brain task running
ui_wdt.enable();
let garage = BUS_GARAGE.init(Default::default());
@@ -104,19 +104,12 @@ async fn main(spawner: Spawner) {
use esp_hal::i2c::master::{Config, I2c};
let mut rst = Output::new(peripherals.GPIO21, esp_hal::gpio::Level::Low, OutputConfig::default());
Timer::after_millis(10).await;
rst.set_high();
Timer::after_millis(10).await;
rst.set_low();
Timer::after_millis(10).await;
rst.set_high();
let i2c = I2c::new(
peripherals.I2C0,
Config::default().with_frequency(Rate::from_khz(400))
).unwrap().with_scl(peripherals.GPIO18).with_sda(peripherals.GPIO17).into_async();
spawner.must_spawn(renderbug_embassy::tasks::oled::oled_task(i2c, garage.telemetry.dyn_subscriber().unwrap()));
spawner.must_spawn(renderbug_embassy::tasks::oled::oled_task(i2c, rst, garage.telemetry.dyn_subscriber().unwrap()));
}
#[cfg(feature="simulation")]