aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/ports/STM32/LLD/CANv1
diff options
context:
space:
mode:
authorGiovanni Di Sirio <gdisirio@gmail.com>2018-08-26 13:08:52 +0000
committerGiovanni Di Sirio <gdisirio@gmail.com>2018-08-26 13:08:52 +0000
commit08d066b618a499ab1124248dc2ccf9478075a123 (patch)
tree5d7ed57d79fd51aa16bbf57c5e4ea248b906bf6e /os/hal/ports/STM32/LLD/CANv1
parent44d3a3a9c32f216a26abbf77591f829b2e1b90eb (diff)
downloadChibiOS-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/hal/ports/STM32/LLD/CANv1')
-rw-r--r--os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c9
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