From f6d7e33d26edffe1adb0ce6160c7ada84f68b6db Mon Sep 17 00:00:00 2001 From: chrysn Date: Tue, 28 May 2019 12:44:07 +0200 Subject: [PATCH] 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. --- src/lib.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 1a903081a..0a035bc31 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -905,6 +905,9 @@ pub trait PwmPin { fn enable(&mut self); /// Returns the current duty cycle + /// + /// While the pin is transitioning to the new duty cycle after a `set_duty` call, this may + /// return the old or the new duty cycle depending on the implementation. fn get_duty(&self) -> Self::Duty; /// Returns the maximum duty cycle value