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.
This commit is contained in:
Jeff Ciesielski 2012-11-01 18:02:11 -07:00
parent fa1d5f8e43
commit 6c41c808c3

View File

@ -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) if ((CAN_MSR(canport) & CAN_MSR_INAK) != CAN_MSR_INAK)
return 1; return 1;
/* clear can timing bits */
CAN_BTR(canport) = 0;
/* Set the automatic bus-off management. */ /* Set the automatic bus-off management. */
if (ttcm) if (ttcm)
CAN_MCR(canport) |= CAN_MCR_TTCM; CAN_MCR(canport) |= CAN_MCR_TTCM;