Skip to content

Commit

Permalink
enforce limit of tcdo to maximum of 127
Browse files Browse the repository at this point in the history
  • Loading branch information
liamkinne committed Feb 3, 2025
1 parent 666b589 commit e95f8c4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,7 +750,8 @@ where

let can = self.registers();
if btr.tdc() {
let tcdo = btr.dtseg1() * btr.dbrp();
let tcdo = btr.dtseg1().saturating_mul(btr.dbrp());
let tcdo = core::cmp::min(tcdo, 127);
can.tdcr.write(|w| unsafe { w.tdco().bits(tcdo) });
}
can.dbtp.write(|w| unsafe {
Expand Down

0 comments on commit e95f8c4

Please sign in to comment.