Keep local Companion control parsing in a cold function

This commit is contained in:
mikecarper committed 2026-10-28 03:15:49 -07:00
1 parent be6d636c79
commit 411144f69c
3 files changed
+6 -8

No files matched your search

+4 -6
View File
@@ -259,7 +259,7 @@ def compile_packed_help(build_env, node):
return build_env.Object(node, **flags)
def _compile_shared_reply_copies(build_env, node, relative_path, extra_flags=()):
def _compile_shared_reply_copies(build_env, node, relative_path):
source = Path(node.srcnode().get_abspath()).resolve()
expected = Path(build_env.subst("$PROJECT_DIR/" + relative_path)).resolve()
if source != expected:
@@ -267,9 +267,8 @@ def _compile_shared_reply_copies(build_env, node, relative_path, extra_flags=())
# GCC otherwise expands many constant strcpy replies into repeated stores.
# Use the same libc function and strings, with no parser or output changes.
flags = list(build_env.get("CCFLAGS", ()))
for flag in ("-fno-builtin-strcpy", *extra_flags):
if flag not in flags:
flags.append(flag)
if "-fno-builtin-strcpy" not in flags:
flags.append("-fno-builtin-strcpy")
return build_env.Object(node, CCFLAGS=flags)
@@ -279,8 +278,7 @@ def compile_shared_cli_replies(build_env, node):
def compile_shared_companion_replies(build_env, node):
return _compile_shared_reply_copies(build_env, node, "examples/companion_radio/MyMesh.cpp",
("-fno-builtin-strncpy",))
return _compile_shared_reply_copies(build_env, node, "examples/companion_radio/MyMesh.cpp")
def companion_shared_replies_policy(platform, mcu, env_name, src_filter,