Skip to content

Commit fb1bdf0

Browse files
committed
stm32/make-stmconst.py: Support structs with names ending in _t.
Signed-off-by: Damien George <damien@micropython.org>
1 parent 68b09ab commit fb1bdf0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ports/stm32/make-stmconst.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,10 @@ class Lexer:
7171
("typedef struct", re.compile(r"typedef struct$")),
7272
("{", re.compile(r"{$")),
7373
("}", re.compile(r"}$")),
74+
(
75+
"} _t",
76+
re.compile(r"} *([A-Za-z0-9_]+)_t;$"),
77+
),
7478
(
7579
"} TypeDef",
7680
re.compile(r"} *(?P<id>[A-Z][A-Za-z0-9_]*)_(?P<global>([A-Za-z0-9_]+)?)TypeDef;$"),
@@ -157,7 +161,7 @@ def parse_file(filename):
157161
for i in range(int(d["array"])):
158162
regs.append((reg + str(i), offset + i * bits // 8, bits, comment))
159163
m = lexer.next_match()
160-
if m[0] == "}":
164+
if m[0] in ("}", "} _t"):
161165
pass
162166
elif m[0] == "} TypeDef":
163167
d = m[1].groupdict()

0 commit comments

Comments
 (0)