Skip to content

Commit fa833f9

Browse files
author
Krzysztof Blazewicz
committed
stmhal/make-stmconst.py: fix regex's to work with current CMSIS
CMSIS v2.5.0 removed all uint32_t casts and uses only Misra Cast (U)
1 parent 7928b3e commit fa833f9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

stmhal/make-stmconst.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ class Lexer:
2929
re_comment = r'(?P<comment>[A-Za-z0-9 \-/_()&]+)'
3030
re_addr_offset = r'Address offset: (?P<offset>0x[0-9A-Z]{2,3})'
3131
regexs = (
32-
('#define hex', re.compile(r'#define +(?P<id>[A-Z0-9_]+) +\(\(uint32_t\)(?P<hex>0x[0-9A-F]+)\)($| +/\*)')),
32+
('#define hex', re.compile(r'#define +(?P<id>[A-Z0-9_]+) +(?:\(\(uint32_t\))?(?P<hex>0x[0-9A-F]+)U?(?:\))?($| +/\*)')),
3333
('#define X', re.compile(r'#define +(?P<id>[A-Z0-9_]+) +(?P<id2>[A-Z0-9_]+)($| +/\*)')),
34-
('#define X+hex', re.compile(r'#define +(?P<id>[A-Za-z0-9_]+) +\((?P<id2>[A-Z0-9_]+) \+ (?P<hex>0x[0-9A-F]+)\)($| +/\*)')),
34+
('#define X+hex', re.compile(r'#define +(?P<id>[A-Za-z0-9_]+) +\((?P<id2>[A-Z0-9_]+) \+ (?P<hex>0x[0-9A-F]+)U?\)($| +/\*)')),
3535
('#define typedef', re.compile(r'#define +(?P<id>[A-Z0-9_]+(ext)?) +\(\([A-Za-z0-9_]+_TypeDef \*\) (?P<id2>[A-Za-z0-9_]+)\)($| +/\*)')),
3636
('typedef struct', re.compile(r'typedef struct$')),
3737
('{', re.compile(r'{$')),

0 commit comments

Comments
 (0)