stm32h7xx-hal
stm32h7xx-hal copied to clipboard
fdcan implementation takes rec::Fdcan, so the other fdcan can't use it
can.rs:242
impl Can<FDCAN2> { pub fn fdcan2( rb: FDCAN2, prec: rec::Fdcan, ) -> fdcan::FdCan<Self, fdcan::ConfigMode> { prec.enable(); // Enable APB1 peripheral clock
prec is taken and never returned
The underlying trait CanExt forces this behaviour
Unfortunately the clock to all FDCAN peripherals are controlled by a single memroy-mapped bit in hardware. Therefore in the HAL abstraction it's not possible to safely clock multiple FDCAN blocks.
It is possible with unsafe using this method