Skip to content

Commit 592affc

Browse files
yn386dpgeorge
authored andcommitted
stm32/make-stmconst.py: Fix missing peripheral consts in stm module.
Lines like the following were not handled by `make-stmconst.py`: #define APBPERIPH_BASE (PERIPH_BASE) This leads to missing definitions on stm module. For example, `stm.RTC` is not defined if `RTC_BASE` is defined as #define RTC_BASE (APBPERIPH_BASE + 0x00002800UL) because `APBPERIPH_BASE` is not handled as a valid id. This patch modifies the RegExp so it can handle the above. Signed-off-by: Yuuki NAGAO <[email protected]>
1 parent bf08f60 commit 592affc

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

ports/stm32/make-stmconst.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ class Lexer:
4141
r"#define +(?P<id>[A-Z0-9_]+) +\(?(\(uint32_t\))?(?P<hex>0x[0-9A-F]+)U?L?\)?($| */\*)"
4242
),
4343
),
44-
("#define X", re.compile(r"#define +(?P<id>[A-Z0-9_]+) +(?P<id2>[A-Z0-9_]+)($| +/\*)")),
44+
(
45+
"#define X",
46+
re.compile(r"#define +(?P<id>[A-Z0-9_]+) +\(?(?P<id2>[A-Z0-9_]+)\)?($| +/\*)"),
47+
),
4548
(
4649
"#define X+hex",
4750
re.compile(

0 commit comments

Comments
 (0)