Add support for RFDuino // Resolve #319

This commit is contained in:
Ivan Kravets
2015-12-26 21:24:01 +02:00
11 changed files with 148 additions and 8 deletions
@@ -60,6 +60,34 @@ elif env.get("PLATFORM") == "espressif":
LIBS=["smartconfig", "pp", "main", "wpa", "lwip",
"net80211", "wps", "crypto", "phy", "hal", "axtls", "gcc", "m"]
)
elif env.get("PLATFORM") == "nordicnrf51":
PLATFORMFW_DIR = join(
"$PIOPACKAGES_DIR",
"framework-arduinonordicnrf51"
)
env.Prepend(
CPPPATH=[
join("$PLATFORMFW_DIR", "system", "CMSIS", "CMSIS", "Include"),
join("$PLATFORMFW_DIR", "system", "RFduino"),
join("$PLATFORMFW_DIR", "system", "RFduino", "include")
],
LIBPATH=[
join(
"$PLATFORMFW_DIR",
"variants",
"${BOARD_OPTIONS['build']['variant']}"
),
join(
"$PLATFORMFW_DIR",
"variants",
"${BOARD_OPTIONS['build']['variant']}",
"linker_scripts",
"gcc"
),
],
LIBS=["RFduino", "RFduinoBLE", "RFduinoGZLL", "RFduinoSystem"]
)
env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR)
+17 -1
View File
@@ -25,6 +25,17 @@ env = DefaultEnvironment()
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
if env.subst("$BOARD") == "rfduino":
env.Append(
CPPFLAGS=["-fno-builtin"],
LINKFLAGS=["--specs=nano.specs"]
)
env.Replace(
UPLOADER=join("$PIOPACKAGES_DIR", "tool-rfdloader", "rfdloader"),
UPLOADERFLAGS=["-q", "$UPLOAD_PORT", "$SOURCES"],
UPLOADCMD='"$UPLOADER" $UPLOADERFLAGS"'
)
#
# Target: Build executable and linkable firmware
#
@@ -51,7 +62,12 @@ AlwaysBuild(target_size)
# Target: Upload by default .bin file
#
upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk)
if env.subst("$BOARD") == "rfduino":
upload = env.Alias(
["upload", "uploadlazy"], target_firm,
[lambda target, source, env: env.AutodetectUploadPort(), "$UPLOADCMD"])
else:
upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk)
AlwaysBuild(upload)
#