From b34b00eed2f5fe675b148a75b9b1cbfbc4679b28 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Sat, 19 Mar 2016 16:20:41 +0200 Subject: [PATCH] Move arduinoteensy specific math libraries to framework build script --- platformio/boards/teensy.json | 6 +++--- platformio/builder/scripts/frameworks/arduino.py | 5 +++++ 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/platformio/boards/teensy.json b/platformio/boards/teensy.json index eba8eea1..dd4816ae 100644 --- a/platformio/boards/teensy.json +++ b/platformio/boards/teensy.json @@ -36,7 +36,7 @@ "teensy30": { "build": { "core": "teensy3", - "extra_flags": "-D__MK20DX128__ -larm_cortexM4l_math", + "extra_flags": "-D__MK20DX128__", "f_cpu": "48000000L", "ldscript": "mk20dx128.ld", "mcu": "mk20dx128", @@ -56,7 +56,7 @@ "teensy31": { "build": { "core": "teensy3", - "extra_flags": "-D__MK20DX256__ -larm_cortexM4l_math", + "extra_flags": "-D__MK20DX256__", "f_cpu": "72000000L", "ldscript": "mk20dx256.ld", "mcu": "mk20dx256", @@ -76,7 +76,7 @@ "teensylc": { "build": { "core": "teensy3", - "extra_flags": "-D__MKL26Z64__ -larm_cortexM0l_math", + "extra_flags": "-D__MKL26Z64__", "f_cpu": "48000000L", "ldscript": "mkl26z64.ld", "mcu": "mkl26z64", diff --git a/platformio/builder/scripts/frameworks/arduino.py b/platformio/builder/scripts/frameworks/arduino.py index 4dc10571..fbe4ca15 100644 --- a/platformio/builder/scripts/frameworks/arduino.py +++ b/platformio/builder/scripts/frameworks/arduino.py @@ -251,6 +251,11 @@ if "variant" in BOARD_BUILDOPTS: envsafe = env.Clone() +if BOARD_BUILDOPTS.get("core", None) == "teensy3": + libs.append("arm_cortex%sl_math" % ( + "M4" if BOARD_BUILDOPTS.get("cpu") == "cortex-m4" else "M0") + ) + if "zero" in env.subst("$BOARD"): envsafe.Append( CFLAGS=[