adjust can to hopefull work better

This commit is contained in:
2026-04-01 21:43:16 +02:00
parent eaa65637f1
commit 1fa765a5d8
2 changed files with 15 additions and 11 deletions

View File

@@ -367,11 +367,13 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
let config = self.twai_config.take().expect("twai config not set");
let mut twai = config.into_async().start();
let res = (async {
if twai.is_bus_off() {
bail!("Bus offline after start");
}
if twai.is_bus_off() {
info!("Bus offline after start, attempting recovery");
// Re-start to initiate recovery
twai = twai.stop().start();
}
let res = (async {
Timer::after_millis(10).await;
let mut moistures = Moistures::default();
@@ -395,11 +397,13 @@ impl<'a> BoardInteraction<'a> for V4<'a> {
let config = self.twai_config.take().expect("twai config not set");
let mut twai = config.into_async().start();
let res = (async {
if twai.is_bus_off() {
bail!("Bus offline after start");
}
if twai.is_bus_off() {
info!("Bus offline after start, attempting recovery");
// Re-start to initiate recovery
twai = twai.stop().start();
}
let res = (async {
Timer::after_millis(1000).await;
info!("Sending info messages now");
// Send a few test messages per potential sensor node