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 <wf.yn386@gmail.com>
This commit is contained in:
Yuuki NAGAO
2025-09-21 15:01:19 +09:00
committed by Damien George
parent bf08f601fa
commit 592affce3f

View File

@@ -41,7 +41,10 @@ class Lexer:
r"#define +(?P<id>[A-Z0-9_]+) +\(?(\(uint32_t\))?(?P<hex>0x[0-9A-F]+)U?L?\)?($| */\*)" r"#define +(?P<id>[A-Z0-9_]+) +\(?(\(uint32_t\))?(?P<hex>0x[0-9A-F]+)U?L?\)?($| */\*)"
), ),
), ),
("#define X", re.compile(r"#define +(?P<id>[A-Z0-9_]+) +(?P<id2>[A-Z0-9_]+)($| +/\*)")), (
"#define X",
re.compile(r"#define +(?P<id>[A-Z0-9_]+) +\(?(?P<id2>[A-Z0-9_]+)\)?($| +/\*)"),
),
( (
"#define X+hex", "#define X+hex",
re.compile( re.compile(