[core] Migrate to uf2ota v5.0.0, refactor OTA API

This commit is contained in:
Kuba Szczodrzyński
2023-07-13 12:15:48 +02:00
parent 39df2e7b54
commit a3bbdf1c16
10 changed files with 575 additions and 425 deletions

View File

@@ -38,7 +38,7 @@ if __name__ == "__main__":
implementation = re.sub(macro_regex, "", implementation, flags=re.MULTILINE)
implementation = re.sub(line_regex, "\n", implementation)
declaration_regex = r"^([\d\w\s]+ \*?)([\S]+?)\(.*?\);$"
declaration_regex = r"^([^\s][\d\w\s]+ \*?)([\S]+?)\(.*?\);$"
implementation_regex = r"^(__attribute__\(\(weak\)\) )?([\w\d* ]+?)([\w\d]+)\(.+?{"
function_types = {}
@@ -85,11 +85,15 @@ if __name__ == "__main__":
+ Style.RESET_ALL
)
function_types[function_name] = function_type
if is_weak:
weak_functions.add(function_name)
else:
impl_functions.add(function_name)
for function in list(impl_functions):
if "static" in function_types[function]:
impl_functions.remove(function)
common_functions = impl_functions.union(weak_functions)
family_functions = decl_functions - common_functions