Closed Sh3Rm4n closed 3 years ago
Sounds reasonable to have this, yeah. I'm not entirely sure what free
should do exactly, since some stuff is up to the HAL (like turning off the clock).
Because free
in the HAL is usually about freeing the consumed pins, it has to wrap this free function anyways, so leave it up entirely to the HAL?
Yeah, that could work
In the case I understood the API correctly, it is currently not possible to retrieve the peripheral consumed with
Can::new
associated with theInstance
traithttps://github.com/stm32-rs/bxcan/blob/f4d5d9676b1653eaf7e51beb222e5af72e6baf1a/src/lib.rs#L49
To retrieve the peripheral, maybe a
free()
method should be implemented like that:This is probably not enough, I guess. I have only glanced over the implementation, but I imagine, that the peripheral has to be deconfigured to safely free it.