canbus debugging

This commit is contained in:
2026-03-15 13:43:36 +01:00
parent 32db326266
commit af27f3b820
3 changed files with 78 additions and 9 deletions

View File

@@ -358,6 +358,7 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
}
async fn measure_moisture_hz(&mut self) -> FatResult<Moistures> {
self.can_power.set_high();
Timer::after_millis(1000).await;
let config = self.twai_config.take().expect("twai config not set");
let mut twai = config.into_async().start();
@@ -377,6 +378,7 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
async fn detect_sensors(&mut self, request: Detection) -> FatResult<Detection> {
self.can_power.set_high();
Timer::after_millis(1000).await;
let config = self.twai_config.take().expect("twai config not set");
let mut twai = config.into_async().start();
@@ -409,7 +411,7 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
// Try a few times; we intentionally ignore rx here and rely on stub logic
let resu = twai
.transmit_async(&frame)
.with_timeout(Duration::from_millis(3000))
.with_timeout(Duration::from_millis(500))
.await;
match resu {
Ok(_) => {}