From 6c41c808c35c73a52f72032e2869b4201c746ff2 Mon Sep 17 00:00:00 2001 From: Jeff Ciesielski Date: Thu, 1 Nov 2012 18:02:11 -0700 Subject: [PATCH] stm32/f1/can: Add clearing of can timing bits on init This corrects a bug introduced with the addition of allowing loopback and silent parameters in the init function. --- lib/stm32/f1/can.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/stm32/f1/can.c b/lib/stm32/f1/can.c index 96c3a2df..f04fd26c 100644 --- a/lib/stm32/f1/can.c +++ b/lib/stm32/f1/can.c @@ -55,6 +55,9 @@ int can_init(u32 canport, bool ttcm, bool abom, bool awum, bool nart, if ((CAN_MSR(canport) & CAN_MSR_INAK) != CAN_MSR_INAK) return 1; + /* clear can timing bits */ + CAN_BTR(canport) = 0; + /* Set the automatic bus-off management. */ if (ttcm) CAN_MCR(canport) |= CAN_MCR_TTCM;