From de1bba47f4e0e92d20498faed4e5645f47cc7401 Mon Sep 17 00:00:00 2001 From: valeros Date: Wed, 4 Mar 2020 12:31:55 +0200 Subject: [PATCH 1/2] Update Teensyduino to 1.51 // Issues #58, #59, #60 --- boards/teensy2.json | 2 +- boards/teensy2pp.json | 2 +- boards/teensy30.json | 2 +- boards/teensy31.json | 2 +- boards/teensy35.json | 2 +- boards/teensy36.json | 2 +- boards/teensy40.json | 2 +- boards/teensylc.json | 2 +- builder/frameworks/arduino.py | 26 +++++++++++++------------- platform.json | 2 +- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/boards/teensy2.json b/boards/teensy2.json index 32ac20f..b77613a 100644 --- a/boards/teensy2.json +++ b/boards/teensy2.json @@ -1,7 +1,7 @@ { "build": { "core": "teensy", - "extra_flags": "-DARDUINO_ARCH_AVR -DTEENSY2", + "extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_TEENSY2", "f_cpu": "16000000L", "mcu": "atmega32u4" }, diff --git a/boards/teensy2pp.json b/boards/teensy2pp.json index 51738d5..7190eaa 100644 --- a/boards/teensy2pp.json +++ b/boards/teensy2pp.json @@ -1,7 +1,7 @@ { "build": { "core": "teensy", - "extra_flags": "-DTEENSY2PP", + "extra_flags": "-DARDUINO_TEENSY2PP", "f_cpu": "16000000L", "mcu": "at90usb1286" }, diff --git a/boards/teensy30.json b/boards/teensy30.json index ef06b13..ed1107b 100644 --- a/boards/teensy30.json +++ b/boards/teensy30.json @@ -5,7 +5,7 @@ }, "core": "teensy3", "cpu": "cortex-m4", - "extra_flags": "-D__MK20DX128__ -DTEENSY30", + "extra_flags": "-D__MK20DX128__ -DARDUINO_TEENSY30", "f_cpu": "48000000L", "mcu": "mk20dx128" }, diff --git a/boards/teensy31.json b/boards/teensy31.json index a7a9252..23175d1 100644 --- a/boards/teensy31.json +++ b/boards/teensy31.json @@ -5,7 +5,7 @@ }, "core": "teensy3", "cpu": "cortex-m4", - "extra_flags": "-D__MK20DX256__ -DTEENSY31", + "extra_flags": "-D__MK20DX256__ -DARDUINO_TEENSY31", "f_cpu": "72000000L", "mcu": "mk20dx256" }, diff --git a/boards/teensy35.json b/boards/teensy35.json index 0b85407..0726f99 100644 --- a/boards/teensy35.json +++ b/boards/teensy35.json @@ -5,7 +5,7 @@ }, "core": "teensy3", "cpu": "cortex-m4", - "extra_flags": "-D__MK64FX512__ -DTEENSY35", + "extra_flags": "-D__MK64FX512__ -DARDUINO_TEENSY35", "f_cpu": "120000000L", "mcu": "mk64fx512" }, diff --git a/boards/teensy36.json b/boards/teensy36.json index 171b709..1c16233 100644 --- a/boards/teensy36.json +++ b/boards/teensy36.json @@ -5,7 +5,7 @@ }, "core": "teensy3", "cpu": "cortex-m4", - "extra_flags": "-D__MK66FX1M0__ -DTEENSY36", + "extra_flags": "-D__MK66FX1M0__ -DARDUINO_TEENSY36", "f_cpu": "180000000L", "mcu": "mk66fx1m0" }, diff --git a/boards/teensy40.json b/boards/teensy40.json index 975fba9..39e350d 100644 --- a/boards/teensy40.json +++ b/boards/teensy40.json @@ -5,7 +5,7 @@ }, "core": "teensy4", "cpu": "cortex-m7", - "extra_flags": "-D__IMXRT1062__ -DTEENSY40", + "extra_flags": "-D__IMXRT1062__ -DARDUINO_TEENSY40", "f_cpu": "600000000", "mcu": "imxrt1062" }, diff --git a/boards/teensylc.json b/boards/teensylc.json index b02d0b1..711a7ba 100644 --- a/boards/teensylc.json +++ b/boards/teensylc.json @@ -5,7 +5,7 @@ }, "core": "teensy3", "cpu": "cortex-m0plus", - "extra_flags": "-D__MKL26Z64__ -DTEENSYLC", + "extra_flags": "-D__MKL26Z64__ -DARDUINO_TEENSYLC", "f_cpu": "48000000L", "mcu": "mkl26z64" }, diff --git a/builder/frameworks/arduino.py b/builder/frameworks/arduino.py index 2803545..693d639 100644 --- a/builder/frameworks/arduino.py +++ b/builder/frameworks/arduino.py @@ -264,19 +264,19 @@ ASFLAGS=env.get("CCFLAGS", [])[:] ) -# if "cortex-m" in env.BoardConfig().get("build.cpu", ""): -# board = env.subst("$BOARD") -# math_lib = "arm_cortex%s_math" -# if board in ("teensy35", "teensy36"): -# math_lib = math_lib % "M4lf" -# elif board in ("teensy30", "teensy31"): -# math_lib = math_lib % "M4l" -# elif board == "teensy40": -# math_lib = math_lib % "M7lfsp" -# else: -# math_lib = math_lib % "M0l" - -# env.Prepend(LIBS=[math_lib]) +if "cortex-m" in env.BoardConfig().get("build.cpu", ""): + board = env.subst("$BOARD") + math_lib = "arm_cortex%s_math" + if board in ("teensy35", "teensy36"): + math_lib = math_lib % "M4lf" + elif board in ("teensy30", "teensy31"): + math_lib = math_lib % "M4l" + elif board == "teensy40": + math_lib = math_lib % "M7lfsp" + else: + math_lib = math_lib % "M0l" + + env.Prepend(LIBS=[math_lib]) # Teensy 2.x Core if BUILD_CORE == "teensy": diff --git a/platform.json b/platform.json index 632d999..60805b9 100644 --- a/platform.json +++ b/platform.json @@ -41,7 +41,7 @@ "framework-arduinoteensy": { "type": "framework", "optional": true, - "version": "~1.149.0" + "version": "~1.151.0" }, "framework-mbed": { "type": "framework", From 7d7d67a0dd769847b297e74802da04c74db24e0d Mon Sep 17 00:00:00 2001 From: valeros Date: Thu, 5 Mar 2020 11:25:32 +0200 Subject: [PATCH 2/2] Bump version to 4.8.0 --- platform.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platform.json b/platform.json index 60805b9..d7fa8a8 100644 --- a/platform.json +++ b/platform.json @@ -12,7 +12,7 @@ "type": "git", "url": "https://github.com/platformio/platform-teensy.git" }, - "version": "4.7.1", + "version": "4.8.0", "packageRepositories": [ "https://dl.bintray.com/platformio/dl-packages/manifest.json", "http://dl.platformio.org/packages/manifest.json"