From de17e3e60a3a52b806b38315952fe2036aabbe41 Mon Sep 17 00:00:00 2001 From: Albin Hedman Date: Thu, 7 Nov 2024 21:37:36 +0100 Subject: [PATCH] Update src/fdcan.rs Co-authored-by: Zgarbul Andrey --- src/fdcan.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/fdcan.rs b/src/fdcan.rs index ae983f29..997e11b9 100644 --- a/src/fdcan.rs +++ b/src/fdcan.rs @@ -1159,10 +1159,11 @@ where #[inline] pub fn error_counters(&self) -> ErrorCounters { let can = self.registers(); - let cel: u8 = can.ecr().read().cel().bits(); - let rp: bool = can.ecr().read().rp().bit(); - let rec: u8 = can.ecr().read().rec().bits(); - let tec: u8 = can.ecr().read().tec().bits(); + let ecr = can.ecr().read(); + let cel: u8 = ecr.cel().bits(); + let rp: bool = ecr.rp().bit(); + let rec: u8 = ecr.rec().bits(); + let tec: u8 = ecr.tec().bits(); ErrorCounters { can_errors: cel,