aboutsummaryrefslogtreecommitdiff
path: root/examples/stm32f4
diff options
context:
space:
mode:
authorxoviat <[email protected]>2025-12-01 09:44:07 -0600
committerxoviat <[email protected]>2025-12-01 09:44:07 -0600
commit970138277bdbf176a3a9320c9d0de9256945d21e (patch)
tree77ebf80cf9cc905f07f85be26c1c52af0ab78d51 /examples/stm32f4
parenta1236b13c3d5fad687ae931a041ae463ac0612bb (diff)
timer: use u32 for high-level api
Diffstat (limited to 'examples/stm32f4')
-rw-r--r--examples/stm32f4/src/bin/pwm_complementary.rs2
-rw-r--r--examples/stm32f4/src/bin/ws2812_pwm.rs2
2 files changed, 2 insertions, 2 deletions
diff --git a/examples/stm32f4/src/bin/pwm_complementary.rs b/examples/stm32f4/src/bin/pwm_complementary.rs
index 50008a37b..5e39a06f5 100644
--- a/examples/stm32f4/src/bin/pwm_complementary.rs
+++ b/examples/stm32f4/src/bin/pwm_complementary.rs
@@ -33,7 +33,7 @@ async fn main(_spawner: Spawner) {
33 ); 33 );
34 34
35 let max = pwm.get_max_duty(); 35 let max = pwm.get_max_duty();
36 pwm.set_dead_time(max / 1024); 36 pwm.set_dead_time((max / 1024) as u16);
37 37
38 pwm.enable(Channel::Ch1); 38 pwm.enable(Channel::Ch1);
39 39
diff --git a/examples/stm32f4/src/bin/ws2812_pwm.rs b/examples/stm32f4/src/bin/ws2812_pwm.rs
index ccfd0661e..4e556f0d4 100644
--- a/examples/stm32f4/src/bin/ws2812_pwm.rs
+++ b/examples/stm32f4/src/bin/ws2812_pwm.rs
@@ -61,7 +61,7 @@ async fn main(_spawner: Spawner) {
61 // construct ws2812 non-return-to-zero (NRZ) code bit by bit 61 // construct ws2812 non-return-to-zero (NRZ) code bit by bit
62 // ws2812 only need 24 bits for each LED, but we add one bit more to keep PWM output low 62 // ws2812 only need 24 bits for each LED, but we add one bit more to keep PWM output low
63 63
64 let max_duty = ws2812_pwm.max_duty_cycle(); 64 let max_duty = ws2812_pwm.max_duty_cycle() as u16;
65 let n0 = 8 * max_duty / 25; // ws2812 Bit 0 high level timing 65 let n0 = 8 * max_duty / 25; // ws2812 Bit 0 high level timing
66 let n1 = 2 * n0; // ws2812 Bit 1 high level timing 66 let n1 = 2 * n0; // ws2812 Bit 1 high level timing
67 67