diff --git a/cpu/stm32/dist/irqs/gen_irqs.py b/cpu/stm32/dist/irqs/gen_irqs.py index 8192ea662b..fbb262b9c3 100755 --- a/cpu/stm32/dist/irqs/gen_irqs.py +++ b/cpu/stm32/dist/irqs/gen_irqs.py @@ -86,7 +86,8 @@ def irq_numof(cpu_fam, cpu_line): ): continue # Stop at the end of the IRQn_Type enum definition - if "IRQn_Type" in line: + if "IRQn_Type" in line \ + and "#else" not in cmsis_content[line_idx + 1].decode(): break # Ensure we are on a valid line, otherwise search in earlier lines diff --git a/cpu/stm32/dist/irqs/gen_vectors.py b/cpu/stm32/dist/irqs/gen_vectors.py index 537920916a..cff84b4c40 100755 --- a/cpu/stm32/dist/irqs/gen_vectors.py +++ b/cpu/stm32/dist/irqs/gen_vectors.py @@ -75,6 +75,7 @@ def parse_cmsis(cpu_line): continue # start filling lines after interrupt Doxygen comment if "typedef enum" in line: + irq_lines = [] # Cleanup any previous content use_line = True # use a regexp to get the available IRQs