diff options
| -rw-r--r-- | embassy-stm32/gen.py | 9 | ||||
| -rw-r--r-- | embassy-stm32/src/exti.rs | 3 |
2 files changed, 5 insertions, 7 deletions
diff --git a/embassy-stm32/gen.py b/embassy-stm32/gen.py index 40904e3c5..c344df493 100644 --- a/embassy-stm32/gen.py +++ b/embassy-stm32/gen.py | |||
| @@ -57,7 +57,7 @@ for chip in chips.values(): | |||
| 57 | 57 | ||
| 58 | af = gpio_afs[chip['gpio_af']] | 58 | af = gpio_afs[chip['gpio_af']] |
| 59 | peripheral_names = [] # USART1, PA5, EXTI8 | 59 | peripheral_names = [] # USART1, PA5, EXTI8 |
| 60 | exti_interrupts = [] # EXTI IRQs, EXTI0, EXTI4_15 etc. | 60 | exti_interrupts = [] # EXTI IRQs, EXTI0, EXTI4_15 etc. |
| 61 | peripheral_versions = {} # usart -> v1, syscfg -> f4 | 61 | peripheral_versions = {} # usart -> v1, syscfg -> f4 |
| 62 | pins = set() # set of all present pins. PA4, PA5... | 62 | pins = set() # set of all present pins. PA4, PA5... |
| 63 | 63 | ||
| @@ -118,7 +118,7 @@ for chip in chips.values(): | |||
| 118 | if block_mod == 'rng': | 118 | if block_mod == 'rng': |
| 119 | for irq in chip['interrupts']: | 119 | for irq in chip['interrupts']: |
| 120 | if re.search('RNG', irq): | 120 | if re.search('RNG', irq): |
| 121 | f.write(f'impl_rng!({name}, ' + irq + f');') | 121 | f.write(f'impl_rng!({name}, {irq});') |
| 122 | 122 | ||
| 123 | if block_mod == 'spi': | 123 | if block_mod == 'spi': |
| 124 | if 'clock' in peri: | 124 | if 'clock' in peri: |
| @@ -182,7 +182,6 @@ for chip in chips.values(): | |||
| 182 | if func := funcs.get(f'{name}_D7'): | 182 | if func := funcs.get(f'{name}_D7'): |
| 183 | f.write(f'impl_sdmmc_pin!({name}, D7Pin, {pin}, {func});') | 183 | f.write(f'impl_sdmmc_pin!({name}, D7Pin, {pin}, {func});') |
| 184 | 184 | ||
| 185 | |||
| 186 | if block_mod == 'exti': | 185 | if block_mod == 'exti': |
| 187 | for irq in chip['interrupts']: | 186 | for irq in chip['interrupts']: |
| 188 | if re.match('EXTI', irq): | 187 | if re.match('EXTI', irq): |
| @@ -201,7 +200,6 @@ for chip in chips.values(): | |||
| 201 | peripherals!({','.join(peripheral_names)}); | 200 | peripherals!({','.join(peripheral_names)}); |
| 202 | """) | 201 | """) |
| 203 | 202 | ||
| 204 | |||
| 205 | # ========= DMA peripherals | 203 | # ========= DMA peripherals |
| 206 | if num_dmas > 0: | 204 | if num_dmas > 0: |
| 207 | f.write(f""" | 205 | f.write(f""" |
| @@ -219,9 +217,6 @@ for chip in chips.values(): | |||
| 219 | # ========= exti interrupts | 217 | # ========= exti interrupts |
| 220 | 218 | ||
| 221 | f.write(f""" | 219 | f.write(f""" |
| 222 | use embassy::interrupt::Interrupt; | ||
| 223 | use embassy::interrupt::InterruptExt; | ||
| 224 | |||
| 225 | impl_exti_irq!({','.join(exti_interrupts)}); | 220 | impl_exti_irq!({','.join(exti_interrupts)}); |
| 226 | """) | 221 | """) |
| 227 | 222 | ||
diff --git a/embassy-stm32/src/exti.rs b/embassy-stm32/src/exti.rs index 83245f842..0b74fe05f 100644 --- a/embassy-stm32/src/exti.rs +++ b/embassy-stm32/src/exti.rs | |||
| @@ -216,6 +216,9 @@ macro_rules! impl_exti_irq { | |||
| 216 | ($($e:ident),+) => { | 216 | ($($e:ident),+) => { |
| 217 | /// safety: must be called only once | 217 | /// safety: must be called only once |
| 218 | pub(crate) unsafe fn init_exti() { | 218 | pub(crate) unsafe fn init_exti() { |
| 219 | use embassy::interrupt::Interrupt; | ||
| 220 | use embassy::interrupt::InterruptExt; | ||
| 221 | |||
| 219 | $( | 222 | $( |
| 220 | crate::interrupt::$e::steal().enable(); | 223 | crate::interrupt::$e::steal().enable(); |
| 221 | )+ | 224 | )+ |
