Skip to content

Commit d26ccb9

Browse files
chrysneldruin
authored andcommitted
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.
1 parent 83f5bea commit d26ccb9

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/pwm.rs

+3
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,9 @@ pub trait PwmPin {
114114
fn try_enable(&mut self) -> Result<(), Self::Error>;
115115

116116
/// Returns the current duty cycle
117+
///
118+
/// While the pin is transitioning to the new duty cycle after a `try_set_duty` call, this may
119+
/// return the old or the new duty cycle depending on the implementation.
117120
fn try_get_duty(&self) -> Result<Self::Duty, Self::Error>;
118121

119122
/// Returns the maximum duty cycle value

0 commit comments

Comments
 (0)