aboutsummaryrefslogtreecommitdiff
path: root/lib/stm32/f1
diff options
context:
space:
mode:
authorJeff Ciesielski2012-11-01 18:02:11 -0700
committerJeff Ciesielski2012-11-01 18:02:11 -0700
commit6c41c808c35c73a52f72032e2869b4201c746ff2 (patch)
tree0b480a2e3dd43f0fc769f46bd4585dd95e8266fc /lib/stm32/f1
parentfa1d5f8e43296b8dcc8522ca4d1a1a8d1313c0ef (diff)
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.
Diffstat (limited to 'lib/stm32/f1')
-rw-r--r--lib/stm32/f1/can.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/stm32/f1/can.c b/lib/stm32/f1/can.c
index 96c3a2d..f04fd26 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;