stm32/boards/pllvalues.py: Support HSx_VALUE defined without uint32_t.

pull/1/head
Damien George 2019-06-25 13:39:06 +10:00
parent 04c7cdb668
commit 89ebb3325b
1 changed files with 2 additions and 2 deletions

View File

@ -137,7 +137,7 @@ def print_table(hse, valid_plls):
def search_header_for_hsx_values(filename, vals):
regex_inc = re.compile(r'#include "(boards/[A-Za-z0-9_./]+)"')
regex_def = re.compile(r'#define +(HSE_VALUE|HSI_VALUE) +\(\(uint32_t\)([0-9]+)\)')
regex_def = re.compile(r'#define +(HSE_VALUE|HSI_VALUE) +\((\(uint32_t\))?([0-9]+)\)')
with open(filename) as f:
for line in f:
line = line.strip()
@ -149,7 +149,7 @@ def search_header_for_hsx_values(filename, vals):
m = regex_def.match(line)
if m:
# Found HSE_VALUE or HSI_VALUE
val = int(m.group(2)) // 1000000
val = int(m.group(3)) // 1000000
if m.group(1) == 'HSE_VALUE':
vals[0] = val
else: