feat: add bus-off error handling in CAN error status register with error blinking loop
This commit is contained in:
@@ -429,6 +429,11 @@ async fn can_task(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Check CAN error status register for bus-off condition
|
||||||
|
if hal::pac::CAN1.errsr().read().boff() {
|
||||||
|
blink_error_loop(info, warn, 3, 3).await; // Bus-off error
|
||||||
|
}
|
||||||
|
|
||||||
while let Ok(mut frame) = CAN_TX_CH.try_receive() {
|
while let Ok(mut frame) = CAN_TX_CH.try_receive() {
|
||||||
match can.transmit(&mut frame) {
|
match can.transmit(&mut frame) {
|
||||||
Ok(..) => {
|
Ok(..) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user