Skip to content

Commit

Permalink
NUVOTON: CAN: Fix filter mask being zero
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ccli8 committed Apr 18, 2024
1 parent 989a694 commit c1c9550
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 8 deletions.
4 changes: 0 additions & 4 deletions targets/TARGET_NUVOTON/TARGET_M451/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
4 changes: 0 additions & 4 deletions targets/TARGET_NUVOTON/TARGET_M480/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c1c9550

Please sign in to comment.