Skip to content

Commit

Permalink
fixup: Uart shared irq misinterpretation
Browse files Browse the repository at this point in the history
  • Loading branch information
rleh committed May 9, 2021
1 parent a2e5e26 commit 7f4cc65
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions src/modm/platform/uart/stm32/module.lb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@ def prepare(module, options):
shared_irqs = [v for v in shared_irqs if ("USART" in v or "UART" in v or "LPUART" in v) and "_" in v]
for shared_irq in shared_irqs:
uart_type = ""
for s in shared_irq.split("_"):
import re
for s in re.findall(r"L?P?US?ART[\d_]+", shared_irq):
if "LPUART" in s:
uart_type = "Lpuart"
elif "UART" in s:
Expand All @@ -121,8 +122,11 @@ def prepare(module, options):
else:
# use type from previous irq id
pass
irq_id = s[-1]
shared_irqs_new[uart_type + irq_id] = shared_irq
irq_ids = re.findall(r"\d+", s)
if len(irq_ids) == 2:
irq_ids = range(int(irq_ids[0]), int(irq_ids[1])+1)
for irq_id in irq_ids:
shared_irqs_new[uart_type + str(irq_id)] = shared_irq
props["shared_irqs"] = shared_irqs_new

props["target"] = device.identifier
Expand Down

0 comments on commit 7f4cc65

Please sign in to comment.