diff options
author | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-08-26 13:08:52 +0000 |
---|---|---|
committer | Giovanni Di Sirio <gdisirio@gmail.com> | 2018-08-26 13:08:52 +0000 |
commit | 08d066b618a499ab1124248dc2ccf9478075a123 (patch) | |
tree | 5d7ed57d79fd51aa16bbf57c5e4ea248b906bf6e /os | |
parent | 44d3a3a9c32f216a26abbf77591f829b2e1b90eb (diff) | |
download | ChibiOS-08d066b618a499ab1124248dc2ccf9478075a123.tar.gz ChibiOS-08d066b618a499ab1124248dc2ccf9478075a123.tar.bz2 ChibiOS-08d066b618a499ab1124248dc2ccf9478075a123.zip |
Fixed a corner case.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@12232 110e8d01-0319-4d1e-a829-52ad28d1bb01
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c b/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c index 9d61f9952..5de18fcee 100644 --- a/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c +++ b/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c @@ -736,7 +736,7 @@ void can_lld_stop(CANDriver *canp) { CAN1->MCR = 0x00010002; /* Register reset value. */
CAN1->IER = 0x00000000; /* All sources disabled. */
#if STM32_CAN_USE_CAN2
- /* If CAND2 is not stopped then CAN1 clock is not stopped here.*/
+ /* If CAND2 is stopped then CAN1 clock is stopped here.*/
if (CAND2.state == CAN_STOP)
#endif
{
@@ -749,6 +749,13 @@ void can_lld_stop(CANDriver *canp) { if (&CAND2 == canp) {
CAN2->MCR = 0x00010002; /* Register reset value. */
CAN2->IER = 0x00000000; /* All sources disabled. */
+#if STM32_CAN_USE_CAN1
+ /* If CAND1 is stopped then CAN1 clock is stopped here.*/
+ if (CAND1.state == CAN_STOP)
+#endif
+ {
+ rccDisableCAN1();
+ }
rccDisableCAN2();
}
#endif
|