diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/ports/STM32/LLD/can_lld.c | 8 |
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");
|