+ фикс кривых проверок на наличие uint8_t
+ фикс перевод float в iq + фикс поиска вручнуб добавленных переменных в debug_vars.c
This commit is contained in:
@@ -285,15 +285,20 @@ def add_new_vars_to_xml(proj_path, xml_rel_path, output_path):
|
||||
Возвращает True если что-то добавлено и XML перезаписан, иначе False.
|
||||
"""
|
||||
|
||||
pattern = re.compile(
|
||||
r'{\s*\(uint8_t\s*\*\)\s*&([a-zA-Z_][a-zA-Z0-9_]*(?:\[.*?\])?(?:(?:\.|->)[a-zA-Z_][a-zA-Z0-9_]*(?:\[.*?\])?)*)\s*,\s*'
|
||||
r'(pt_\w+)\s*,\s*'
|
||||
r'(t?_?iq\w+)\s*,\s*'
|
||||
r'(t?_?iq\w+)\s*,\s*'
|
||||
r'"([^"]+)"'
|
||||
)
|
||||
# Считываем существующие переменные
|
||||
parsed_vars = {}
|
||||
if os.path.isfile(output_path):
|
||||
with open(output_path, 'r', encoding='utf-8', errors='ignore') as f:
|
||||
for line in f:
|
||||
# {(uint8_t *)&some.deep.var.name , pt_uint16 , t_iq15 , "ShortName"},
|
||||
m = re.match(
|
||||
r'{\s*\(uint8_t\s*\*\)\s*&([a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)*)\s*,\s*(pt_\w+)\s*,\s*(t?iq_\w+)\s*,\s*"([^"]+)"',
|
||||
line)
|
||||
# {(uint8_t *)&some.deep.var.name , pt_uint16 , t_iq15 , t_iq10, "ShortName"},
|
||||
m = pattern.search(line)
|
||||
if m:
|
||||
full_varname = m.group(1) # e.g., some.deep.var.name
|
||||
pt_type = m.group(2)
|
||||
@@ -556,7 +561,7 @@ def generate_vars_file(proj_path, xml_path, output_dir):
|
||||
out_lines.append(f'int DebugVar_Qnt = {len(all_debug_lines)};')
|
||||
if stm_flag_global == 0:
|
||||
out_lines.append('#pragma DATA_SECTION(dbg_vars,".dbgvar_info")')
|
||||
out_lines.append('// pointer_type iq_type return_iq_type short_name')
|
||||
out_lines.append('// pointer_type iq_type return_iq_type short_name')
|
||||
out_lines.append('DebugVar_t dbg_vars[] = {\\')
|
||||
out_lines.extend(all_debug_lines)
|
||||
out_lines.append('};')
|
||||
|
||||
Reference in New Issue
Block a user