diff options
| author | Dario Nieuwenhuis <[email protected]> | 2025-09-05 23:44:25 +0200 |
|---|---|---|
| committer | Dario Nieuwenhuis <[email protected]> | 2025-09-05 23:44:25 +0200 |
| commit | 35f4ae378cbc9a1263e46baaeac536cae2337896 (patch) | |
| tree | 7f142a458cf10b0ffa444b9963d0e2b30349ef0b /embassy-stm32/src/timer/one_pulse.rs | |
| parent | 7419b398bf7cc5c1ff164c504f4a4027cd6bcd3b (diff) | |
stm32/afio: make the A generic param only appear in chips with AFIO.
Diffstat (limited to 'embassy-stm32/src/timer/one_pulse.rs')
| -rw-r--r-- | embassy-stm32/src/timer/one_pulse.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/embassy-stm32/src/timer/one_pulse.rs b/embassy-stm32/src/timer/one_pulse.rs index b15cea679..edab38022 100644 --- a/embassy-stm32/src/timer/one_pulse.rs +++ b/embassy-stm32/src/timer/one_pulse.rs | |||
| @@ -64,7 +64,7 @@ impl SealedTriggerSource for Ext {} | |||
| 64 | 64 | ||
| 65 | impl<'d, T: GeneralInstance4Channel, C: TriggerSource + TimerChannel> TriggerPin<'d, T, C> { | 65 | impl<'d, T: GeneralInstance4Channel, C: TriggerSource + TimerChannel> TriggerPin<'d, T, C> { |
| 66 | /// Create a new Channel trigger pin instance. | 66 | /// Create a new Channel trigger pin instance. |
| 67 | pub fn new<A>(pin: Peri<'d, impl TimerPin<T, C, A>>, pull: Pull) -> Self { | 67 | pub fn new<#[cfg(afio)] A>(pin: Peri<'d, if_afio!(impl TimerPin<T, C, A>)>, pull: Pull) -> Self { |
| 68 | pin.set_as_af(pin.af_num(), AfType::input(pull)); | 68 | pin.set_as_af(pin.af_num(), AfType::input(pull)); |
| 69 | #[cfg(afio)] | 69 | #[cfg(afio)] |
| 70 | pin.afio_remap(); | 70 | pin.afio_remap(); |
| @@ -77,7 +77,7 @@ impl<'d, T: GeneralInstance4Channel, C: TriggerSource + TimerChannel> TriggerPin | |||
| 77 | 77 | ||
| 78 | impl<'d, T: GeneralInstance4Channel> TriggerPin<'d, T, Ext> { | 78 | impl<'d, T: GeneralInstance4Channel> TriggerPin<'d, T, Ext> { |
| 79 | /// Create a new external trigger pin instance. | 79 | /// Create a new external trigger pin instance. |
| 80 | pub fn new_external<A>(pin: Peri<'d, impl ExternalTriggerPin<T, A>>, pull: Pull) -> Self { | 80 | pub fn new_external<#[cfg(afio)] A>(pin: Peri<'d, if_afio!(impl ExternalTriggerPin<T, A>)>, pull: Pull) -> Self { |
| 81 | pin.set_as_af(pin.af_num(), AfType::input(pull)); | 81 | pin.set_as_af(pin.af_num(), AfType::input(pull)); |
| 82 | #[cfg(afio)] | 82 | #[cfg(afio)] |
| 83 | pin.afio_remap(); | 83 | pin.afio_remap(); |
