Skip to content

Commit

Permalink
Update mod.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
dstric-aqueduct committed Nov 27, 2022
1 parent ff22943 commit c367a4e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions imxrt1060-hal/src/can/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,13 +173,19 @@ const FLEXCAN_MB_CODE_RX_OVERRUN: u8 = 0b0110;
const FLEXCAN_MB_CODE_RX_BUSY: u8 = 0b0001;

const FLEXCAN_MB_CODE_TX_INACTIVE: u8 = 0b1000;
const FLEXCAN_MB_CODE_TX_ABORT: u8 = 0b1001;
const FLEXCAN_MB_CODE_TX_ONCE: u8 = 0b1100;

#[inline]
fn to_flexcan_mb_cs_code(status: u8) -> u32 {
((status as u32) & 0x0000000F) << 24
}

#[inline]
fn from_flexcan_mb_cs_code(code: u32) -> u8 {
((code & FLEXCAN_MB_CS_CODE_MASK) >> 24) as u8
}

impl<M> CAN<M>
where
M: Unsigned,
Expand Down

0 comments on commit c367a4e

Please sign in to comment.