From 7c04e6612f0189ca46cd970b7458f47ce371a200 Mon Sep 17 00:00:00 2001 From: Yorick de Wid Date: Fri, 16 Feb 2024 16:07:23 +0100 Subject: [PATCH] Feed watchdog as last --- hcu/src/main.rs | 4 ++-- m-ecu/src/main.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hcu/src/main.rs b/hcu/src/main.rs index 2aa63ad..059cd12 100644 --- a/hcu/src/main.rs +++ b/hcu/src/main.rs @@ -314,8 +314,6 @@ mod app { .led .set_color(&state.as_led(), &vecraft::led::LedState::On); - ctx.local.watchdog.feed(); - let id = IdBuilder::from_pgn(PGN::Other(65_288)) .sa(crate::J1939_ADDRESS) .build(); @@ -340,6 +338,8 @@ mod app { ctx.shared.canbus1.lock(|canbus1| canbus1.send(frame)); + ctx.local.watchdog.feed(); + firmware_state::spawn_after(50.millis().into()).ok(); } diff --git a/m-ecu/src/main.rs b/m-ecu/src/main.rs index 319a5a9..e7eb3c8 100644 --- a/m-ecu/src/main.rs +++ b/m-ecu/src/main.rs @@ -229,8 +229,6 @@ mod app { .led .set_color(&state.as_led(), &vecraft::led::LedState::On); - ctx.local.watchdog.feed(); - let id = IdBuilder::from_pgn(PGN::Other(65_288)) .sa(crate::J1939_ADDRESS) .build(); @@ -254,6 +252,8 @@ mod app { ctx.shared.canbus1.lock(|canbus1| canbus1.send(frame)); + ctx.local.watchdog.feed(); + firmware_state::spawn_after(50.millis().into()).unwrap(); }