mirror of
https://github.com/micropython/micropython.git
synced 2025-12-16 01:40:14 +01:00
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:
committed by
Damien George
parent
bf08f601fa
commit
592affce3f
@@ -41,7 +41,10 @@ class Lexer:
|
||||
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",
|
||||
re.compile(
|
||||
|
||||
Reference in New Issue
Block a user