From 3b2091841a779acb50d13906da2e3528b109eff9 Mon Sep 17 00:00:00 2001 From: Patrick Wspanialy Date: Fri, 25 Aug 2023 13:24:38 -0400 Subject: [PATCH] added clearcore to builder scripts --- builder/frameworks/arduino/arduino-samd.py | 33 ++++++++++++++++++++++ builder/main.py | 4 +-- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/builder/frameworks/arduino/arduino-samd.py b/builder/frameworks/arduino/arduino-samd.py index f26241c..53db7e5 100644 --- a/builder/frameworks/arduino/arduino-samd.py +++ b/builder/frameworks/arduino/arduino-samd.py @@ -143,6 +143,13 @@ ] ) +if VENDOR_CORE == "clearcore": + env.Append( + CPPDEFINES=[ + ("USB_CONFIG_POWER", board.get("build.usb_power", 0)) + ], + ) + # # Vendor-specific configurations # @@ -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 diff --git a/builder/main.py b/builder/main.py index 3ce4945..31391b4 100644 --- a/builder/main.py +++ b/builder/main.py @@ -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=[