mirror of
https://github.com/rust-embedded/embedded-hal.git
synced 2026-04-18 20:56:05 +00:00
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:
committed by
Diego Barrios Romero
parent
83f5beac72
commit
d26ccb9c88
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user