From 9b18fecebf4ab1065ec593d0a59d34ed5a5dc8b5 Mon Sep 17 00:00:00 2001 From: Giovanni Di Sirio Date: Sat, 7 Jan 2017 18:10:34 +0000 Subject: Fixed redundat assertion in STM32 CAN driver. Fixed some spacing issues. git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@10021 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 c28613a03..309a32f31 100644 --- a/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c +++ b/os/hal/ports/STM32/LLD/CANv1/hal_can_lld.c @@ -80,6 +80,7 @@ static void can_lld_set_filters(CANDriver* canp, uint32_t can2sb, uint32_t num, const CANFilter *cfp) { + #if STM32_CAN_USE_CAN2 if(canp == &CAND2) { /* Set handle to CAN1, because CAN1 manages the filters of CAN2.*/ @@ -96,6 +97,7 @@ static void can_lld_set_filters(CANDriver* canp, canp->can->FMR = (canp->can->FMR & 0xFFFF0000) | (can2sb << 8) | CAN_FMR_FINIT; } #endif + #if STM32_CAN_USE_CAN3 if(canp == &CAND3) { rccEnableCAN3(FALSE); @@ -121,6 +123,7 @@ static void can_lld_set_filters(CANDriver* canp, } } #endif + #if STM32_CAN_USE_CAN3 if(canp == &CAND3) { for (i = 0; i < STM32_CAN3_MAX_FILTERS; i++) { @@ -129,6 +132,7 @@ static void can_lld_set_filters(CANDriver* canp, } } #endif + /* Scanning the filters array.*/ for (i = 0; i < num; i++) { fmask = 1 << cfp->filter; @@ -1013,7 +1017,7 @@ void can_lld_wakeup(CANDriver *canp) { void canSTM32SetFilters(CANDriver *canp, uint32_t can2sb, uint32_t num, const CANFilter *cfp) { #if STM32_CAN_USE_CAN2 - osalDbgCheck((can2sb >= 0) && (can2sb <= STM32_CAN_MAX_FILTERS) && + osalDbgCheck((can2sb <= STM32_CAN_MAX_FILTERS) && (num <= STM32_CAN_MAX_FILTERS)); #endif -- cgit v1.2.3