Skip to content

Commit

Permalink
fixup! fixup! fixup! fixup! cpu/samd5x: avoid the use of bitfield in …
Browse files Browse the repository at this point in the history
…periph

Signed-off-by: Dylan Laduranty <dylan.laduranty@mesotic.com>
  • Loading branch information
dylad committed Jun 20, 2024
1 parent 71fe625 commit 43bbcac
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions cpu/samd5x/periph/can.c
Original file line number Diff line number Diff line change
Expand Up @@ -812,10 +812,10 @@ static void _isr(candev_t *candev)
DEBUG_PUTS("protocol error in data phase");
dev->conf->can->IR.reg |= CAN_IR_PED;
/* Extract the Tx and Rx error counters */
uint8_t tx_err_cnt = (uint8_t)(dev->conf->can->ECR.reg & CAN_ECR_TEC_Msk);
uint32_t reg = dev->conf->can->ECR.reg;
uint8_t tx_err_cnt = (uint8_t) (reg & CAN_ECR_TEC_Msk);
DEBUG("tx error counter = %u\n", tx_err_cnt);
uint8_t rx_err_cnt = (uint8_t)((dev->conf->can->ECR.reg & CAN_ECR_REC_Msk)
>> CAN_ECR_REC_Pos);
uint8_t rx_err_cnt = (uint8_t)((reg & CAN_ECR_REC_Msk) >> CAN_ECR_REC_Pos);
DEBUG("rx error counter = %u\n", rx_err_cnt);
/* Check the CAN error type */
uint8_t error_code = (uint8_t)(dev->conf->can->PSR.reg & CAN_PSR_LEC_Msk);
Expand Down

0 comments on commit 43bbcac

Please sign in to comment.