Skip to content

Commit ec94703

Browse files
luctiusCor Peters
andauthored
Fix #34 (#40)
Co-authored-by: Cor Peters <[email protected]>
1 parent 45a7fc6 commit ec94703

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/fdcan.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,6 +1391,7 @@ where
13911391
// Check if there is a request pending to abort
13921392
if self.has_pending_frame(idx) {
13931393
let idx: u8 = idx.into();
1394+
let idx = 1u8 << idx;
13941395

13951396
// Abort Request
13961397
can.txbcr.write(|w| unsafe { w.cr().bits(idx) });
@@ -1411,6 +1412,7 @@ where
14111412
fn has_pending_frame(&self, idx: Mailbox) -> bool {
14121413
let can = self.registers();
14131414
let idx: u8 = idx.into();
1415+
let idx = 1u8 << idx;
14141416

14151417
can.txbrp.read().trp().bits() & idx != 0
14161418
}

src/fdcan/filter.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl StandardFilter {
3737
filter: 0x0,
3838
mask: 0x0,
3939
},
40-
action: Action::StoreInFifo0,
40+
action: Action::StoreInFifo1,
4141
}
4242
}
4343

@@ -80,7 +80,7 @@ impl ExtendedFilter {
8080
filter: 0x0,
8181
mask: 0x0,
8282
},
83-
action: Action::StoreInFifo0,
83+
action: Action::StoreInFifo1,
8484
}
8585
}
8686

src/fdcan/message_ram/txbuffer_element.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ impl<'a> ID_W<'a> {
127127
#[inline(always)]
128128
#[allow(dead_code)]
129129
pub unsafe fn bits(self, value: u32) -> &'a mut W {
130-
self.w.bits[0] = (self.w.bits[0] & !(0x0FFFFFFF)) | ((value as u32) & 0x0FFFFFFF);
130+
self.w.bits[0] = (self.w.bits[0] & !(0x1FFFFFFF)) | ((value as u32) & 0x1FFFFFFF);
131131
self.w
132132
}
133133
}

0 commit comments

Comments
 (0)