embassy icon indicating copy to clipboard operation
embassy copied to clipboard

embassy-nrf::SimplePwm::set_period() is misnamed

Open peter9477 opened this issue 2 years ago • 0 comments

The set_period() routine in https://github.com/embassy-rs/embassy/blob/master/embassy-nrf/src/pwm.rs#L779 appears to be mis-named, as it's actually taking in a frequency value. Yes, technically it calculates a period from that frequency (to set the max duty cycle), but I think users would probably expect it to be named after the argument it takes, not what it does internally.

The period() getter likewise is calculating a frequency from the max duty cycle and returning it, so probably should be frequency().

peter9477 avatar Aug 01 '22 23:08 peter9477