rust-embedded / embedded-hal

A Hardware Abstraction Layer (HAL) for embedded systems
Apache License 2.0
2.01k stars 202 forks source link

Split embedded-can? #599

Open reneherrero opened 6 months ago

reneherrero commented 6 months ago

Hi,

I noticed that the embedded-can crate is always pulling the nb crate even if it's not being used.

One option would be to add features. Another would be to refactor the code and follow the same pattern as the embedded-hal crates (better in my opinion).

Thoughts?

Dirbaio commented 6 months ago

the nb crate is tiny, it compiles in milliseconds. If you don't use the nb stuff, code from nb doesnt end up at all on the final binary (the linker doesn't link unused code).

IMO the split is not worth the effort.

reneherrero commented 6 months ago

Then why create an embedded-hal-nb crate? Async for CAN is also in the works #585 ...

reneherrero commented 6 months ago

According to the stm32 bxcan project, the embedded-can crate is deprecated.

Is this the case? Understanding the state of affairs is "complicated"... even more so as far as CAN FD is concerned.

Any insight would be much appreciated,