diff options
| author | Thales Fragoso <[email protected]> | 2021-05-22 22:25:44 -0300 |
|---|---|---|
| committer | Thales Fragoso <[email protected]> | 2021-05-22 22:25:44 -0300 |
| commit | 706992aef9851cdf6ebd701f9ee640c652e65132 (patch) | |
| tree | b789828bf950b88fea0ec1fc91b2d3da3a8c9e2b | |
| parent | 5e49a9932f7bcefd5c3c235fa731c2c084e75ac1 (diff) | |
Support block names with underscores
| -rw-r--r-- | embassy-stm32/gen.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/embassy-stm32/gen.py b/embassy-stm32/gen.py index 05cc3d3b7..addedc5e1 100644 --- a/embassy-stm32/gen.py +++ b/embassy-stm32/gen.py | |||
| @@ -84,9 +84,11 @@ for chip in chips.values(): | |||
| 84 | continue | 84 | continue |
| 85 | 85 | ||
| 86 | block = peri['block'] | 86 | block = peri['block'] |
| 87 | block_mod, block_name = block.rsplit('/') | 87 | block_mod, block_name_unparsed = block.rsplit('/') |
| 88 | block_mod, block_version = block_mod.rsplit('_') | 88 | block_mod, block_version = block_mod.rsplit('_') |
| 89 | block_name = block_name.capitalize() | 89 | block_name = '' |
| 90 | for b in block_name_unparsed.split('_'): | ||
| 91 | block_name += b.capitalize() | ||
| 90 | 92 | ||
| 91 | # Check all peripherals have the same version: it's not OK for the same chip to use both usart_v1 and usart_v2 | 93 | # Check all peripherals have the same version: it's not OK for the same chip to use both usart_v1 and usart_v2 |
| 92 | if old_version := peripheral_versions.get(block_mod): | 94 | if old_version := peripheral_versions.get(block_mod): |
