Skip to content

Commit 43aa7c0

Browse files
committed
Follow Mbed OS coding style of if(...)
1 parent 9d7f489 commit 43aa7c0

File tree

2 files changed

+10
-8
lines changed

2 files changed

+10
-8
lines changed

targets/TARGET_NUVOTON/TARGET_M451/can_api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -286,14 +286,15 @@ int can_mode(can_t *obj, CanMode mode)
286286
int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle)
287287
{
288288
uint32_t numask = mask;
289-
if( numask == 0x0000 )
290-
{
289+
290+
if( numask == 0x0000 ) {
291291
return CAN_SetRxMsg((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id);
292292
}
293-
if( format == CANStandard )
294-
{
293+
294+
if( format == CANStandard ) {
295295
numask = (mask << 18);
296296
}
297+
297298
numask = (numask | CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk);
298299
return CAN_SetRxMsgAndMsk((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id, numask);
299300
}

targets/TARGET_NUVOTON/TARGET_M480/can_api.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -330,14 +330,15 @@ int can_mode(can_t *obj, CanMode mode)
330330
int can_filter(can_t *obj, uint32_t id, uint32_t mask, CANFormat format, int32_t handle)
331331
{
332332
uint32_t numask = mask;
333-
if( numask == 0x0000 )
334-
{
333+
334+
if( numask == 0x0000 ) {
335335
return CAN_SetRxMsg((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id);
336336
}
337-
if( format == CANStandard )
338-
{
337+
338+
if( format == CANStandard ) {
339339
numask = (mask << 18);
340340
}
341+
341342
numask = (numask | CAN_IF_MASK2_MDIR_Msk | CAN_IF_MASK2_MXTD_Msk);
342343
return CAN_SetRxMsgAndMsk((CAN_T *)NU_MODBASE(obj->can), handle, (uint32_t)format, id, numask);
343344
}

0 commit comments

Comments
 (0)