From e4a55c83bcc0690653ebfb788ef8f7cd00f78604 Mon Sep 17 00:00:00 2001 From: Chun-Chieh Li Date: Wed, 17 Apr 2024 17:56:36 +0800 Subject: [PATCH] NUVOTON: CAN: Fix filter mask being zero On mask being zero, it means any match, not exact match. NOTE: This fix only targets CAN (M453/M487), not CAN-FD (M467). NOTE: NUC472 CAN doesn't support filter. --- targets/TARGET_NUVOTON/TARGET_M451/can_api.c | 4 ---- targets/TARGET_NUVOTON/TARGET_M480/can_api.c | 4 ---- 2 files changed, 8 deletions(-) diff --git a/targets/TARGET_NUVOTON/TARGET_M451/can_api.c b/targets/TARGET_NUVOTON/TARGET_M451/can_api.c index 5c4e0f34bc8..d8254406de8 100644 --- a/targets/TARGET_NUVOTON/TARGET_M451/can_api.c +++ b/targets/TARGET_NUVOTON/TARGET_M451/can_api.c @@ -314,10 +314,6 @@ int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t } uint32_t numask = mask; - if( numask == 0x0000 ) - { - return CAN_SetRxMsg((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id); - } if( format == CANStandard ) { numask = (mask << 18); diff --git a/targets/TARGET_NUVOTON/TARGET_M480/can_api.c b/targets/TARGET_NUVOTON/TARGET_M480/can_api.c index 4312ff12053..c4910180c5e 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/can_api.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/can_api.c @@ -363,10 +363,6 @@ int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t } uint32_t numask = mask; - if( numask == 0x0000 ) - { - return CAN_SetRxMsg((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id); - } if( format == CANStandard ) { numask = (mask << 18);