Mainmenu #28

Merged
rhetenor merged 19 commits from mainmenu into main 2026-08-18 23:44:28 +02:00
2 changed files with 6 additions and 7 deletions
Showing only changes of commit 77b73902b8 - Show all commits
-6
View File
@@ -60,8 +60,6 @@ async fn main(spawner: Spawner) {
let timg0 = TimerGroup::new(peripherals.TIMG0); let timg0 = TimerGroup::new(peripherals.TIMG0);
esp_rtos::start(timg0.timer0, sw_interrupt.software_interrupt0); esp_rtos::start(timg0.timer0, sw_interrupt.software_interrupt0);
log::info!("Setup complete, entering main loop");
let display: &mut PrimaryLcdDisplay = Box::leak(Box::new(init_primary_lcd( let display: &mut PrimaryLcdDisplay = Box::leak(Box::new(init_primary_lcd(
peripherals.SPI2, peripherals.SPI2,
peripherals.GPIO36, peripherals.GPIO36,
@@ -74,10 +72,6 @@ async fn main(spawner: Spawner) {
//setup_wifi(peripherals.WIFI, peripherals.FLASH, &spawner).await; //setup_wifi(peripherals.WIFI, peripherals.FLASH, &spawner).await;
log::info!("Setup complete, entering main loop");
let mut nav_state = NavigationState::new();
let mut nfc_driver = let mut nfc_driver =
NfcPn532Driver::new(peripherals.I2C0, peripherals.GPIO17, peripherals.GPIO18); NfcPn532Driver::new(peripherals.I2C0, peripherals.GPIO17, peripherals.GPIO18);
let timeout = Duration::from_millis(1000); let timeout = Duration::from_millis(1000);
+6 -1
View File
@@ -3,6 +3,9 @@ use crate::{display::primary_lcd::PrimaryLcdDisplay, navigation::inputs::Inputs}
use embassy_futures::select::Either6; use embassy_futures::select::Either6;
use embassy_futures::select::select6; use embassy_futures::select::select6;
use embassy_time::{Duration, Timer};
const DEBOUNCE_DURATION_MILLIS: u64 = 100;
#[embassy_executor::task] #[embassy_executor::task]
pub async fn run(mut inputs: Inputs, display: &'static mut PrimaryLcdDisplay<'static>) { pub async fn run(mut inputs: Inputs, display: &'static mut PrimaryLcdDisplay<'static>) {
@@ -51,6 +54,8 @@ pub async fn run(mut inputs: Inputs, display: &'static mut PrimaryLcdDisplay<'st
state.selected = value; state.selected = value;
state.display(display).await state.display(display).await;
Timer::after(Duration::from_millis(DEBOUNCE_DURATION_MILLIS)).await;
} }
} }