From 8172db6d8e41e526c08454c233c4be2d74cd0818 Mon Sep 17 00:00:00 2001 From: Ulf Lilleengen Date: Wed, 19 May 2021 10:37:52 +0200 Subject: [PATCH] Match on RNG interrupt names to support other RNG peripherals --- embassy-stm32/gen.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/embassy-stm32/gen.py b/embassy-stm32/gen.py index 6c931e4a7..97773bb45 100644 --- a/embassy-stm32/gen.py +++ b/embassy-stm32/gen.py @@ -3,6 +3,7 @@ import yaml import re import json import os +import re import toml from collections import OrderedDict from glob import glob @@ -113,10 +114,9 @@ for chip in chips.values(): f.write(f'impl_usart_pin!({name}, CkPin, {pin}, {func});') if block_mod == 'rng': - if 'RNG' in chip['interrupts']: - f.write(f'impl_rng!({name}, RNG);') - else: - f.write(f'impl_rng!({name}, HASH_RNG);') + for irq in chip['interrupts']: + if re.search('RNG', irq): + f.write(f'impl_rng!({name}, ' + irq + f');') if block_mod == 'spi': if 'clock' in peri: