aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorgdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-06-08 07:06:10 +0000
committergdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4>2014-06-08 07:06:10 +0000
commit8bcf3434a822c9d64b71f87272fb7ad2358ca962 (patch)
tree2dac9b8ec57bb435821275d39f46d646e5addbc5 /os
parent3e9fe7c6d06bc4e0e1b5e7139b1641c221e0a4ac (diff)
downloadChibiOS-8bcf3434a822c9d64b71f87272fb7ad2358ca962.tar.gz
ChibiOS-8bcf3434a822c9d64b71f87272fb7ad2358ca962.tar.bz2
ChibiOS-8bcf3434a822c9d64b71f87272fb7ad2358ca962.zip
Fixed bug #511.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6983 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/hal/ports/STM32/LLD/can_lld.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/os/hal/ports/STM32/LLD/can_lld.c b/os/hal/ports/STM32/LLD/can_lld.c
index 48820f171..01a05083f 100644
--- a/os/hal/ports/STM32/LLD/can_lld.c
+++ b/os/hal/ports/STM32/LLD/can_lld.c
@@ -105,12 +105,16 @@ static void can_lld_set_filters(uint32_t can2sb,
CANs.*/
CAN1->sFilterRegister[0].FR1 = 0;
CAN1->sFilterRegister[0].FR2 = 0;
+#if STM32_HAS_CAN2
CAN1->sFilterRegister[can2sb].FR1 = 0;
CAN1->sFilterRegister[can2sb].FR2 = 0;
+#endif
CAN1->FM1R = 0;
CAN1->FFA1R = 0;
+#if STM32_HAS_CAN2
CAN1->FS1R = 1 | (1 << can2sb);
CAN1->FA1R = 1 | (1 << can2sb);
+#endif
}
CAN1->FMR &= ~CAN_FMR_FINIT;
@@ -683,8 +687,8 @@ void can_lld_wakeup(CANDriver *canp) {
*/
void canSTM32SetFilters(uint32_t can2sb, uint32_t num, const CANFilter *cfp) {
- osalDbgCheck((can2sb > 1) && (can2sb < STM32_CAN_MAX_FILTERS) &&
- (num < STM32_CAN_MAX_FILTERS));
+ osalDbgCheck((can2sb >= 1) && (can2sb < STM32_CAN_MAX_FILTERS) &&
+ (num <? STM32_CAN_MAX_FILTERS));
#if STM32_CAN_USE_CAN1
osalDbgAssert(CAND1.state == CAN_STOP, "invalid state");