Skip to content

Commit

Permalink
can: set watermark to RX_FIFO_MAX / TX_EVENT_MAX
Browse files Browse the repository at this point in the history
  • Loading branch information
richardeoin committed Mar 18, 2022
1 parent 29c2700 commit 79e7069
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/can.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,18 +98,33 @@ macro_rules! message_ram_layout {
word_adr += 2 * EXTENDED_FILTER_MAX as u16;
// Rx FIFO 0
$can.rxf0c.modify(|_, w| unsafe {
w.f0sa().bits(word_adr).f0s().bits(RX_FIFO_MAX)
w.f0sa()
.bits(word_adr)
.f0s()
.bits(RX_FIFO_MAX)
.f0wm()
.bits(RX_FIFO_MAX)
});
word_adr += 18 * RX_FIFO_MAX as u16;
// Rx FIFO 1
$can.rxf1c.modify(|_, w| unsafe {
w.f1sa().bits(word_adr).f1s().bits(RX_FIFO_MAX)
w.f1sa()
.bits(word_adr)
.f1s()
.bits(RX_FIFO_MAX)
.f1wm()
.bits(RX_FIFO_MAX)
});
word_adr += 18 * RX_FIFO_MAX as u16;
// Rx buffer - see below
// Tx event FIFO
$can.txefc.modify(|_, w| unsafe {
w.efsa().bits(word_adr).efs().bits(TX_EVENT_MAX)
w.efsa()
.bits(word_adr)
.efs()
.bits(TX_EVENT_MAX)
.efwm()
.bits(TX_EVENT_MAX)
});
word_adr += 2 * TX_EVENT_MAX as u16;
// Tx buffers
Expand Down

0 comments on commit 79e7069

Please sign in to comment.