mirror of https://github.com/ARMmbed/mbed-os.git
Follow Mbed OS coding style of if statement
parent
3198bab7c6
commit
75dd2c22d1
|
@ -286,14 +286,15 @@ int can_mode(can_t *obj, CanMode mode)
|
|||
int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle)
|
||||
{
|
||||
uint32_t numask = mask;
|
||||
if( numask == 0x0000 )
|
||||
{
|
||||
|
||||
if (numask == 0x0000) {
|
||||
return CAN_SetRxMsg((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id);
|
||||
}
|
||||
if( format == CANStandard )
|
||||
{
|
||||
|
||||
if (format == CANStandard) {
|
||||
numask = (mask << 18);
|
||||
}
|
||||
|
||||
numask = (numask | CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk);
|
||||
return CAN_SetRxMsgAndMsk((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id, numask);
|
||||
}
|
||||
|
|
|
@ -330,14 +330,15 @@ int can_mode(can_t *obj, CanMode mode)
|
|||
int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle)
|
||||
{
|
||||
uint32_t numask = mask;
|
||||
if( numask == 0x0000 )
|
||||
{
|
||||
|
||||
if (numask == 0x0000) {
|
||||
return CAN_SetRxMsg((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id);
|
||||
}
|
||||
if( format == CANStandard )
|
||||
{
|
||||
|
||||
if (format == CANStandard) {
|
||||
numask = (mask << 18);
|
||||
}
|
||||
|
||||
numask = (numask | CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk);
|
||||
return CAN_SetRxMsgAndMsk((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id, numask);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue