stm32-rs / fdcan

FDCAN peripheral driver for STM32 chips
Apache License 2.0
12 stars 14 forks source link

id::IdReg::to_id() performs operations in incorrect order #17

Closed SDEEV closed 2 years ago

SDEEV commented 2 years ago

line 222: ((self.0 >> Self::STANDARD_SHIFT) & Self::STANDARD_MASK) as u16, should be ((self.0 & Self::STANDARD_MASK) >> Self::STANDARD_SHIFT) as u16,

richardeoin commented 2 years ago

Thanks for reporting, this is indeed a bug! I guess this shows up with any non-zero ID, we definitely need more test cases to catch these problems

richardeoin commented 2 years ago

There's a fix in the pull request above

richardeoin commented 2 years ago

Fixed in #18