Skip to content

Commit 0b05478

Browse files
committed
Pwm: 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 5b898bb commit 0b05478

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
@@ -79,6 +79,9 @@ pub trait Pwm {
7979
fn try_get_period(&self) -> Result<Self::Time, Self::Error>;
8080

8181
/// Returns the current duty cycle
82+
///
83+
/// While the pin is transitioning to the new duty cycle after a `try_set_duty` call, this may
84+
/// return the old or the new duty cycle depending on the implementation.
8285
fn try_get_duty(&self, channel: Self::Channel) -> Result<Self::Duty, Self::Error>;
8386

8487
/// Returns the maximum duty cycle value

0 commit comments

Comments
 (0)