Skip to content

Commit

Permalink
NUVOTON: CAN: Fix filter mask
Browse files Browse the repository at this point in the history
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 7ae592d commit 63bdb26
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion targets/TARGET_NUVOTON/TARGET_M451/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t
{
numask = (mask << 18);
}
numask = (numask | CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk);
numask = (numask | ((CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk) << 16));
return CAN_SetRxMsgAndMsk((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id, numask);
}

Expand Down
2 changes: 1 addition & 1 deletion targets/TARGET_NUVOTON/TARGET_M480/can_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -341,7 +341,7 @@ int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t
{
numask = (mask << 18);
}
numask = (numask | CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk);
numask = (numask | ((CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk) << 16));
return CAN_SetRxMsgAndMsk((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id, numask);
}

Expand Down

0 comments on commit 63bdb26

Please sign in to comment.