Skip to content

Commit

Permalink
cppcheck: ignore redundantAssignment and selfAssignment for registers…
Browse files Browse the repository at this point in the history
… in llcan.h
  • Loading branch information
rbiasini committed Jul 9, 2019
1 parent 9ce6311 commit f45dd04
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions board/drivers/llcan.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ bool llcan_set_speed(CAN_TypeDef *CAN_obj, uint32_t speed, bool loopback, bool s
}

// reset
// cppcheck-suppress redundantAssignment ; it's a register
CAN_obj->MCR = CAN_MCR_TTCM | CAN_MCR_ABOM;

#define CAN_TIMEOUT 1000000
Expand Down Expand Up @@ -80,6 +81,7 @@ void llcan_init(CAN_TypeDef *CAN_obj) {
void llcan_clear_send(CAN_TypeDef *CAN_obj) {
CAN_obj->TSR |= CAN_TSR_ABRQ0;
CAN_obj->MSR &= ~(CAN_MSR_ERRI);
// cppcheck-suppress selfAssignment ; needed to clear the register
CAN_obj->MSR = CAN_obj->MSR;
}

0 comments on commit f45dd04

Please sign in to comment.