diff options
| author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2022-02-10 15:15:06 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-02-10 15:15:06 +0000 |
| commit | 9d682aa1fae81d9bb56bb41304828144b9a0d4a7 (patch) | |
| tree | fda3c3af254733ecd9e1804b79383b648ccd806f /examples/stm32h7/src/bin/low_level_timer_api.rs | |
| parent | 1d265b73b2f46baf60a481c8b8036e50c2b6583f (diff) | |
| parent | a8bd3ab9521fc2c3c4a409c40648068af3d63d97 (diff) | |
Merge #605
605: stm32: Remove OptionalPin r=Dirbaio a=Dirbaio
The idea behind OptionalPin has a few problems:
- you need to impl the signal traits for NoPin which is a bit weird https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L413-L416
- you can pass any combination of set/unset pins, which needs checking at runtime https://github.com/embassy-rs/embassy/blob/master/embassy-stm32/src/dcmi.rs#L130
The replacement is to do multiple `new` constructors for each combination of pins you want to take.
Co-authored-by: Dario Nieuwenhuis <[email protected]>
Diffstat (limited to 'examples/stm32h7/src/bin/low_level_timer_api.rs')
| -rw-r--r-- | examples/stm32h7/src/bin/low_level_timer_api.rs | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/examples/stm32h7/src/bin/low_level_timer_api.rs b/examples/stm32h7/src/bin/low_level_timer_api.rs index 2640f249d..1bf69104d 100644 --- a/examples/stm32h7/src/bin/low_level_timer_api.rs +++ b/examples/stm32h7/src/bin/low_level_timer_api.rs | |||
| @@ -10,7 +10,6 @@ use embassy::executor::Spawner; | |||
| 10 | use embassy::time::{Duration, Timer}; | 10 | use embassy::time::{Duration, Timer}; |
| 11 | use embassy::util::Unborrow; | 11 | use embassy::util::Unborrow; |
| 12 | use embassy_hal_common::unborrow; | 12 | use embassy_hal_common::unborrow; |
| 13 | use embassy_stm32::gpio::NoPin; | ||
| 14 | use embassy_stm32::pwm::{pins::*, Channel, OutputCompareMode}; | 13 | use embassy_stm32::pwm::{pins::*, Channel, OutputCompareMode}; |
| 15 | use embassy_stm32::time::{Hertz, U32Ext}; | 14 | use embassy_stm32::time::{Hertz, U32Ext}; |
| 16 | use embassy_stm32::timer::GeneralPurpose32bitInstance; | 15 | use embassy_stm32::timer::GeneralPurpose32bitInstance; |
| @@ -33,7 +32,7 @@ pub fn config() -> Config { | |||
| 33 | async fn main(_spawner: Spawner, p: Peripherals) { | 32 | async fn main(_spawner: Spawner, p: Peripherals) { |
| 34 | info!("Hello World!"); | 33 | info!("Hello World!"); |
| 35 | 34 | ||
| 36 | let mut pwm = SimplePwm32::new(p.TIM5, p.PA0, NoPin, NoPin, NoPin, 10000.hz()); | 35 | let mut pwm = SimplePwm32::new(p.TIM5, p.PA0, p.PA1, p.PA2, p.PA3, 10000.hz()); |
| 37 | let max = pwm.get_max_duty(); | 36 | let max = pwm.get_max_duty(); |
| 38 | pwm.enable(Channel::Ch1); | 37 | pwm.enable(Channel::Ch1); |
| 39 | 38 | ||
