Skip to content

Commit

Permalink
Merge branch 'hotfix/v3.7.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankravets committed Jan 31, 2019
2 parents 7803941 + a058f03 commit f35dcc0
Show file tree
Hide file tree
Showing 4 changed files with 66 additions and 4 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: python
python:
- "2.7"
- "3.6"

env:
- PLATFORMIO_PROJECT_DIR=examples/arduino-blink
Expand Down
65 changes: 63 additions & 2 deletions builder/frameworks/arduino.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@
ASFLAGS=["-x", "assembler-with-cpp"],

CCFLAGS=[
"-Os", # optimize for size
"-Wall", # show warnings
"-ffunction-sections", # place each function in its own section
"-fdata-sections",
Expand All @@ -142,7 +141,6 @@
RANLIBFLAGS=["-s"],

LINKFLAGS=[
"-Os",
"-Wl,--gc-sections,--relax",
"-mthumb",
"-mcpu=%s" % env.BoardConfig().get("build.cpu"),
Expand All @@ -166,6 +164,69 @@
]
)

# Optimization
if "TEENSY_OPT_FASTER_LTO" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-O2", "-flto", "-fno-fat-lto-objects"],
LINKFLAGS=["-O2", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"]
)
elif "TEENSY_OPT_FAST" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-O1"],
LINKFLAGS=["-O1"]
)
elif "TEENSY_OPT_FAST_LTO" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-O1", "-flto", "-fno-fat-lto-objects"],
LINKFLAGS=["-O1", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"]
)
elif "TEENSY_OPT_FASTEST" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-O3"],
LINKFLAGS=["-O3"]
)
elif "TEENSY_OPT_FASTEST_LTO" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-O3", "-flto", "-fno-fat-lto-objects"],
LINKFLAGS=["-O3", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"]
)
elif "TEENSY_OPT_FASTEST_PURE_CODE" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-O3", "-mpure-code"],
CPPDEFINES=["__PURE_CODE__"],
LINKFLAGS=["-O3", "-mpure-code"]
)
elif "TEENSY_OPT_FASTEST_PURE_CODE_LTO" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-O3", "-mpure-code", "-flto", "-fno-fat-lto-objects"],
CPPDEFINES=["__PURE_CODE__"],
LINKFLAGS=["-O3", "-mpure-code", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"]
)
elif "TEENSY_OPT_DEBUG" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-g", "-Og"],
LINKFLAGS=["-g", "-Og"]
)
elif "TEENSY_OPT_DEBUG_LTO" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-g", "-Og", "-flto", "-fno-fat-lto-objects"],
LINKFLAGS=["-g", "-Og", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"]
)
elif "TEENSY_OPT_SMALLEST_CODE" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-Os", "--specs=nano.specs"],
LINKFLAGS=["-Os", "--specs=nano.specs"]
)
elif "TEENSY_OPT_SMALLEST_CODE_LTO" in env['CPPDEFINES']:
env.Append(
CCFLAGS=["-Os", "--specs=nano.specs", "-flto", "-fno-fat-lto-objects"],
LINKFLAGS=["-Os", "--specs=nano.specs", "-flto", "-fno-fat-lto-objects", "-fuse-linker-plugin"]
)
# TEENSY_OPT_FASTER
else:
env.Append(CCFLAGS=["-O2"], LINKFLAGS=["-O2"])


env.Append(
ASFLAGS=env.get("CCFLAGS", [])[:]
)
Expand Down
2 changes: 1 addition & 1 deletion builder/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ def _jlink_cmd_script(env, source):
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]

# custom upload tool
elif "UPLOADCMD" in env:
elif upload_protocol == "custom":
upload_actions = [env.VerboseAction("$UPLOADCMD", "Uploading $SOURCE")]

else:
Expand Down
2 changes: 1 addition & 1 deletion platform.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"type": "git",
"url": "https://github.com/platformio/platform-teensy.git"
},
"version": "3.7.0",
"version": "3.7.1",
"packageRepositories": [
"https://dl.bintray.com/platformio/dl-packages/manifest.json",
"http://dl.platformio.org/packages/manifest.json"
Expand Down

0 comments on commit f35dcc0

Please sign in to comment.