stm32/f1/can: clean up can_available_mailbox ->fewer 'if' statements
This commit is contained in:
parent
7e9b79aa55
commit
fa1d5f8e43
1 changed files with 1 additions and 9 deletions
|
@ -316,13 +316,5 @@ void can_receive(u32 canport, u8 fifo, bool release, u32 *id, bool *ext,
|
|||
|
||||
bool can_available_mailbox(u32 canport)
|
||||
{
|
||||
if ((CAN_TSR(canport) & CAN_TSR_TME0) == CAN_TSR_TME0) {
|
||||
return true;
|
||||
} else if ((CAN_TSR(canport) & CAN_TSR_TME1) == CAN_TSR_TME1) {
|
||||
return true;
|
||||
} else if ((CAN_TSR(canport) & CAN_TSR_TME2) == CAN_TSR_TME2) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
return CAN_TSR(canport) & (CAN_TSR_TME0 | CAN_TSR_TME1 | CAN_TSR_TME2);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue