CAN1-CAN2 conflicts tentative fix.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12231 110e8d01-0319-4d1e-a829-52ad28d1bb01
This commit is contained in:
parent
cfb36c168f
commit
44d3a3a9c3
|
@ -688,9 +688,7 @@ void can_lld_start(CANDriver *canp) {
|
||||||
|
|
||||||
#if STM32_CAN_USE_CAN2
|
#if STM32_CAN_USE_CAN2
|
||||||
if (&CAND2 == canp) {
|
if (&CAND2 == canp) {
|
||||||
|
rccEnableCAN1(true); /* CAN 2 requires CAN1, so enabling it first.*/
|
||||||
osalDbgAssert(CAND1.state != CAN_STOP, "CAN1 must be started");
|
|
||||||
|
|
||||||
rccEnableCAN2(true);
|
rccEnableCAN2(true);
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
@ -735,14 +733,15 @@ void can_lld_stop(CANDriver *canp) {
|
||||||
if (canp->state == CAN_READY) {
|
if (canp->state == CAN_READY) {
|
||||||
#if STM32_CAN_USE_CAN1
|
#if STM32_CAN_USE_CAN1
|
||||||
if (&CAND1 == canp) {
|
if (&CAND1 == canp) {
|
||||||
|
|
||||||
#if STM32_CAN_USE_CAN2
|
|
||||||
osalDbgAssert(CAND2.state == CAN_STOP, "CAN2 must be stopped");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
CAN1->MCR = 0x00010002; /* Register reset value. */
|
CAN1->MCR = 0x00010002; /* Register reset value. */
|
||||||
CAN1->IER = 0x00000000; /* All sources disabled. */
|
CAN1->IER = 0x00000000; /* All sources disabled. */
|
||||||
rccDisableCAN1();
|
#if STM32_CAN_USE_CAN2
|
||||||
|
/* If CAND2 is not stopped then CAN1 clock is not stopped here.*/
|
||||||
|
if (CAND2.state == CAN_STOP)
|
||||||
|
#endif
|
||||||
|
{
|
||||||
|
rccDisableCAN1();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue