Files
platformio-core/platformio/platforms/teensy.py

60 lines
1.5 KiB
Python
Raw Normal View History

2015-02-04 20:39:38 +02:00
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from platformio.platforms.base import BasePlatform
from platformio.util import get_boards
2015-02-04 20:39:38 +02:00
class TeensyPlatform(BasePlatform):
"""
Teensy is a complete USB-based microcontroller development system, in
a very small footprint, capable of implementing many types of projects.
All programming is done via the USB port. No special programmer is
needed, only a standard "Mini-B" USB cable and a PC or Macintosh with
a USB port.
https://www.pjrc.com/teensy
2015-02-04 20:39:38 +02:00
"""
PACKAGES = {
"toolchain-atmelavr": {
"default": True
},
2015-02-04 20:39:38 +02:00
"toolchain-gccarmnoneeabi": {
"default": True
},
"ldscripts": {
2015-02-04 20:39:38 +02:00
"default": True
},
"framework-arduinoteensy": {
"default": True
},
"tool-teensy": {
2015-02-15 16:00:19 +02:00
"alias": "uploader",
"default": True
2015-02-04 20:39:38 +02:00
}
}
2015-03-16 14:15:57 +02:00
def get_name(self):
return "Teensy"
def run(self, variables, targets):
for v in variables:
if "BOARD=" not in v:
continue
_, board = v.split("=")
bdata = get_boards(board)
if bdata['build']['core'] == "teensy":
tpackage = "toolchain-atmelavr"
else:
tpackage = "toolchain-gccarmnoneeabi"
self.PACKAGES[tpackage]['alias'] = "toolchain"
break
return BasePlatform.run(self, variables, targets)