Fix USB flags processing for teensy platform // Issue #722

This commit is contained in:
Valeriy Koval
2016-07-18 14:52:25 +03:00
parent 7ad8d08037
commit 79a4a943dc
2 changed files with 16 additions and 1 deletions

View File

@ -198,6 +198,20 @@ if env.get("PLATFORM") == "teensy":
"ARDUINO=10600",
"TEENSYDUINO=%d" % ARDUINO_VERSION
]
USB_FLAGS = (
"USB_HID",
"USB_SERIAL_HID",
"USB_DISK",
"USB_DISK_SDFLASH",
"USB_MIDI",
"USB_RAWHID",
"USB_FLIGHTSIM",
"USB_DISABLED"
)
if not any(f in env.get("BUILD_FLAGS", []) for f in USB_FLAGS):
env.Append(CPPDEFINES=["USB_SERIAL"])
else:
ARDUINO_USBDEFINES += ["ARDUINO=%d" % ARDUINO_VERSION]
@ -310,6 +324,8 @@ if BOARD_BUILDOPTS.get("core", None) == "teensy":
with open(file_path, "w") as fp:
fp.write(content)
env.Append(CPPPATH=[join("$PLATFORMFW_DIR", "cores")])
#
# Target: Build Core Library
#

View File

@ -40,7 +40,6 @@ elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3":
env.Append(
CPPDEFINES=[
"USB_SERIAL",
"LAYOUT_US_ENGLISH"
],