nrf-rs / nrf-hal

A Rust HAL for the nRF family of devices
Apache License 2.0
503 stars 139 forks source link

Unified how pins are return in `free` calls #372

Closed korken89 closed 2 years ago

korken89 commented 2 years ago

Hi,

I unified so pins are returned the same for all peripherals.

korken89 commented 2 years ago

I wonder if it would be beneficial to add a free method that only returns the peripheral, for efficiency (the added volatile reads add to code size). Presumably users would almost always want the pins back though?

If there should be a free without the pins, to me it does not make sense to not get back all the hardware that was used. The efficiency loss here are 4 register reads worst case, so the overhead does not seem like an issue to me. Would you agree?

korken89 commented 2 years ago

There, it should be ready for a re-review now @jonas-schievink

jonas-schievink commented 2 years ago

bors r+

bors[bot] commented 2 years ago

Build succeeded: