Mainmenu #28
@@ -60,8 +60,6 @@ async fn main(spawner: Spawner) {
|
||||
let timg0 = TimerGroup::new(peripherals.TIMG0);
|
||||
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(
|
||||
peripherals.SPI2,
|
||||
peripherals.GPIO36,
|
||||
@@ -74,10 +72,6 @@ async fn main(spawner: Spawner) {
|
||||
|
||||
//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 =
|
||||
NfcPn532Driver::new(peripherals.I2C0, peripherals.GPIO17, peripherals.GPIO18);
|
||||
let timeout = Duration::from_millis(1000);
|
||||
|
||||
@@ -3,6 +3,9 @@ use crate::{display::primary_lcd::PrimaryLcdDisplay, navigation::inputs::Inputs}
|
||||
|
||||
use embassy_futures::select::Either6;
|
||||
use embassy_futures::select::select6;
|
||||
use embassy_time::{Duration, Timer};
|
||||
|
||||
const DEBOUNCE_DURATION_MILLIS: u64 = 100;
|
||||
|
||||
#[embassy_executor::task]
|
||||
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.display(display).await
|
||||
state.display(display).await;
|
||||
|
||||
Timer::after(Duration::from_millis(DEBOUNCE_DURATION_MILLIS)).await;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user