diff options
| author | Vincent Stakenburg <[email protected]> | 2022-06-28 13:15:23 +0200 |
|---|---|---|
| committer | Vincent Stakenburg <[email protected]> | 2022-06-28 13:22:43 +0200 |
| commit | d1d07cd9e3b86b2d387b26b652e3caebe114e36b (patch) | |
| tree | b71c1ac30edc78d3172e2a2e35cfbd8ab9d1dd5b | |
| parent | f2ad9c2d9d892d4656f05e04c54cb24922d71d97 (diff) | |
fix case when chip has multiple iwdg
| -rw-r--r-- | embassy-stm32/src/wdg/mod.rs | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/embassy-stm32/src/wdg/mod.rs b/embassy-stm32/src/wdg/mod.rs index ce3af1484..da25692ab 100644 --- a/embassy-stm32/src/wdg/mod.rs +++ b/embassy-stm32/src/wdg/mod.rs | |||
| @@ -40,10 +40,14 @@ mod sealed { | |||
| 40 | 40 | ||
| 41 | pub trait Instance: sealed::Instance {} | 41 | pub trait Instance: sealed::Instance {} |
| 42 | 42 | ||
| 43 | impl sealed::Instance for crate::peripherals::IWDG { | 43 | foreach_peripheral!( |
| 44 | fn regs() -> crate::pac::iwdg::Iwdg { | 44 | (iwdg, $inst:ident) => { |
| 45 | crate::pac::IWDG | 45 | impl sealed::Instance for crate::peripherals::$inst { |
| 46 | } | 46 | fn regs() -> crate::pac::iwdg::Iwdg { |
| 47 | } | 47 | crate::pac::$inst |
| 48 | } | ||
| 49 | } | ||
| 48 | 50 | ||
| 49 | impl Instance for crate::peripherals::IWDG {} | 51 | impl Instance for crate::peripherals::$inst {} |
| 52 | }; | ||
| 53 | ); | ||
