Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fdcan implementation takes rec::Fdcan, so the other fdcan can't use it #369

Open
SDEEV opened this issue Jul 8, 2022 · 1 comment
Open
Labels
wontfix This will not be worked on

Comments

@SDEEV
Copy link

SDEEV commented Jul 8, 2022

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

@SDEEV SDEEV changed the title fdcan implementation takes rec::Fdcan fdcan implementation takes rec::Fdcan, so the other fdcan can't use it Jul 8, 2022
@richardeoin
Copy link
Member

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

@richardeoin richardeoin added the wontfix This will not be worked on label Aug 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

2 participants