Initial commit: Security Mesh Node
This commit is contained in:
33
scripts/add_external_sources.py
Normal file
33
scripts/add_external_sources.py
Normal file
@@ -0,0 +1,33 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import glob
|
||||
import os
|
||||
from os.path import join, normpath
|
||||
|
||||
Import("env")
|
||||
|
||||
project_dir = env.subst("$PROJECT_DIR")
|
||||
meshcore_dir = normpath(join(project_dir, "..", "MeshCore"))
|
||||
|
||||
# Add MeshCore source files via build_src_filter override
|
||||
# We need to add them before the build starts
|
||||
meshcore_glob_patterns = [
|
||||
"src/*.cpp",
|
||||
"src/helpers/*.cpp",
|
||||
"src/helpers/radiolib/*.cpp",
|
||||
"src/helpers/bridges/BridgeBase.cpp",
|
||||
"src/helpers/nrf52/SerialBLEInterface.cpp",
|
||||
]
|
||||
|
||||
# Add source files to the build environment
|
||||
for pattern in meshcore_glob_patterns:
|
||||
full_pattern = normpath(join(meshcore_dir, pattern))
|
||||
files = glob.glob(full_pattern)
|
||||
for f in sorted(files):
|
||||
env.Append(SOURCES=[f])
|
||||
|
||||
# Also add T114 variant files if they exist
|
||||
t114_pattern = normpath(join(meshcore_dir, "variants/heltec_t114/*.cpp"))
|
||||
t114_files = glob.glob(t114_pattern)
|
||||
for f in sorted(t114_files):
|
||||
env.Append(SOURCES=[f])
|
||||
31
scripts/create_uf2.py
Normal file
31
scripts/create_uf2.py
Normal file
@@ -0,0 +1,31 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import os
|
||||
|
||||
Import("env")
|
||||
|
||||
firmware_hex = "${BUILD_DIR}/${PROGNAME}.hex"
|
||||
uf2_file = os.environ.get("UF2_FILE_PATH", "${BUILD_DIR}/${PROGNAME}.uf2")
|
||||
meshcore_dir = os.path.normpath(os.path.join(env.subst("$PROJECT_DIR"), "..", "MeshCore"))
|
||||
uf2conv = os.path.join(meshcore_dir, "bin", "uf2conv", "uf2conv.py")
|
||||
|
||||
def create_uf2_action(source, target, env):
|
||||
uf2_cmd = " ".join(
|
||||
[
|
||||
'"$PYTHONEXE"',
|
||||
'"' + uf2conv + '"',
|
||||
'-f', '0xADA52840',
|
||||
'-c', firmware_hex,
|
||||
'-o', uf2_file,
|
||||
]
|
||||
)
|
||||
env.Execute(uf2_cmd)
|
||||
|
||||
env.AddCustomTarget(
|
||||
name="create_uf2",
|
||||
dependencies=firmware_hex,
|
||||
actions=create_uf2_action,
|
||||
title="Create UF2 file",
|
||||
description="Use uf2conv to convert hex binary into uf2",
|
||||
always_build=True,
|
||||
)
|
||||
Reference in New Issue
Block a user