eculocate

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README

commit e70bb99786eb44786bd4649a71995fb45a04c5fa
parent a06ca800f0892cb0f38d9d5abccc319f1f173eff
Author: Daniel Barlow <dan@telent.net>
Date:   Sat, 22 Nov 2025 23:29:35 +0000

temporarily call ecu.poll from main loop

this is just so we can test easily without having to involve bluetooth
yet

Diffstat:
Msrc/main.rs | 26++++++++++++++++++++++++--
1 file changed, 24 insertions(+), 2 deletions(-)

diff --git a/src/main.rs b/src/main.rs @@ -19,9 +19,15 @@ use esp_hal::{ use embassy_executor::Spawner; use embassy_futures::join::join; +use embassy_time::Timer; + use log::{info}; +use crate::ecu::{ + Ecu, Measure +}; + extern crate alloc; // This creates a default app-descriptor required by the esp-idf bootloader. @@ -49,10 +55,26 @@ async fn main(_s : Spawner) { info!("let's go!"); - let ecu = ecu::Ecu::new( + let mut ecu = Ecu::new( peripherals.GPIO21, peripherals.GPIO20, peripherals.UART0 ); - wibble::run_ble(peripherals.BT, ecu).await; + // wibble::run_ble(peripherals.BT, ecu).await; + + async { + loop { + let c = async |measure| { + match measure { + Measure::Rpm(v) => { + info!("got rpm {v}"); + } + } + }; + &ecu.poll(c).await; + Timer::after_millis(1000).await; + } + }.await; + + }