Skip to content

Commit

Permalink
added clearcore to builder scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickwasp committed Aug 25, 2023
1 parent 55848fd commit 3b20918
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 2 deletions.
33 changes: 33 additions & 0 deletions builder/frameworks/arduino/arduino-samd.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,13 @@
]
)

if VENDOR_CORE == "clearcore":
env.Append(
CPPDEFINES=[
("USB_CONFIG_POWER", board.get("build.usb_power", 0))
],
)

#
# Vendor-specific configurations
#
Expand Down Expand Up @@ -170,6 +177,32 @@
os.path.join(FRAMEWORK_DIR, "cores", BUILD_CORE, "api", "deprecated-avr-comp")
]
)
elif VENDOR_CORE == "clearcore":
CLEARCORE_BASE_DIR = platform.get_package_dir("framework-arduino-samd-clearcore")
CLEARCORE_LIB_DIR = os.path.join(CLEARCORE_BASE_DIR, "Teknic")

env.Append(
CPPPATH=[
os.path.join(CLEARCORE_BASE_DIR, "variants", "clearcore", "ThirdParty", "SAME53", "CMSIS", "Device", "Include"),
os.path.join(CLEARCORE_BASE_DIR, "cores", "arduino", "api"),
os.path.join(CLEARCORE_BASE_DIR, "cores", "arduino"),
os.path.join(CLEARCORE_BASE_DIR, "variants", "clearcore"),
os.path.join(CLEARCORE_LIB_DIR, "LwIP", "LwIP", "port", "include"),
os.path.join(CLEARCORE_LIB_DIR, "LwIP", "LwIP", "src", "include"),
os.path.join(CLEARCORE_LIB_DIR, "libClearCore", "inc")
],

LIBPATH=[
os.path.join(CLEARCORE_LIB_DIR, "libClearCore", "Release"),
os.path.join(CLEARCORE_LIB_DIR, "LwIP", "Release")
],

LIBS=[
"ClearCore",
"LwIP",
"arm_cortexM4lf_math"
]
)

#
# Target: Build Core Library
Expand Down
4 changes: 2 additions & 2 deletions builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,8 +216,8 @@ def _jlink_cmd_script(env, source):
],
UPLOADCMD="$UPLOADER $UPLOADERFLAGS $SOURCES"
)
if board.get("build.core") in ("adafruit", "seeed", "sparkfun") and board.get(
"build.mcu").startswith(("samd51", "same51")):
if board.get("build.core") in ("adafruit", "seeed", "sparkfun", "clearcore") and board.get(
"build.mcu").startswith(("samd51", "same51", "same53")):
# special flags for the latest bossac tool
env.Append(
UPLOADERFLAGS=[
Expand Down

0 comments on commit 3b20918

Please sign in to comment.