From 27c504c6694dc29eb9d85049d7f0f02afa7e1a6f Mon Sep 17 00:00:00 2001 From: Raul Victor Trombin Date: Tue, 27 Feb 2024 16:36:04 -0300 Subject: [PATCH] src: lib: pwm: Optimize using a single call for both ON and OFF channels --- src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 9b3c64f9b4..50ae7be0ea 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -477,8 +477,9 @@ impl Navigator { warn!("Invalid value. Value must be less than or equal {max_value}."); value = max_value; } - self.pwm.set_channel_on(channel.into(), 0).unwrap(); - self.pwm.set_channel_off(channel.into(), value).unwrap(); + self.pwm + .set_channel_on_off(channel.into(), 0, value) + .unwrap(); } /// Calculate and set the necessary values for the desired Duty Cycle (high value time) of selected channel.