PwmPin: allow get_duty to return the old value for some time

PWM is often implemented in a buffered way to allow glitch-free
operation; as a result, implementing a strict "you get what you last
set" is not feasible for some implementations.
This commit is contained in:
chrysn
2019-05-28 12:44:07 +02:00
committed by Diego Barrios Romero
parent 83f5beac72
commit d26ccb9c88

View File

@@ -114,6 +114,9 @@ pub trait PwmPin {
fn try_enable(&mut self) -> Result<(), Self::Error>;
/// Returns the current duty cycle
///
/// While the pin is transitioning to the new duty cycle after a `try_set_duty` call, this may
/// return the old or the new duty cycle depending on the implementation.
fn try_get_duty(&self) -> Result<Self::Duty, Self::Error>;
/// Returns the maximum duty cycle value