Compare commits
225 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6c2883ba3b | ||
|
|
249b00df1a | ||
|
|
3fcf0a1bda | ||
|
|
c31f591ca0 | ||
|
|
c80fb5f4b3 | ||
|
|
218a978f6d | ||
|
|
f6aed63055 | ||
|
|
a119e39ede | ||
|
|
94da243dad | ||
|
|
244412daf1 | ||
|
|
29d7137a3d | ||
|
|
9017cb1600 | ||
|
|
80b012c157 | ||
|
|
b80c525952 | ||
|
|
1af6eba151 | ||
|
|
e288499db9 | ||
|
|
ebdbf79868 | ||
|
|
776a2027fb | ||
|
|
a928f4aa8f | ||
|
|
9c5f9b6e30 | ||
|
|
ae4918bdb7 | ||
|
|
a581ba9814 | ||
|
|
31840bbc11 | ||
|
|
53b005bbed | ||
|
|
82864d38e2 | ||
|
|
43205b8cd5 | ||
|
|
e240e0ee32 | ||
|
|
6c7e26412a | ||
|
|
3232ba6a6c | ||
|
|
46461b0721 | ||
|
|
90508dfd96 | ||
|
|
d8dba90f77 | ||
|
|
829d5781a5 | ||
|
|
8e95bfb464 | ||
|
|
91563b01d2 | ||
|
|
89e2f46e68 | ||
|
|
5f1f4a1b19 | ||
|
|
4669dc7f16 | ||
|
|
ca721d7262 | ||
|
|
14f84a49a6 | ||
|
|
4744f5afdc | ||
|
|
3a48f1c40b | ||
|
|
aea7121076 | ||
|
|
50875ff74b | ||
|
|
dc13048254 | ||
|
|
18145d2c1c | ||
|
|
f868c64d81 | ||
|
|
3b7ad2d333 | ||
|
|
6732c7cb7c | ||
|
|
7ba67582de | ||
|
|
35ae470196 | ||
|
|
fa339a8b70 | ||
|
|
43b27c138a | ||
|
|
36cdbb8f0c | ||
|
|
8c331df105 | ||
|
|
02d4efcfb5 | ||
|
|
00cb6bd845 | ||
|
|
f038c7a28e | ||
|
|
18b4497be7 | ||
|
|
8704ad4032 | ||
|
|
f899e255f3 | ||
|
|
23cf725c20 | ||
|
|
ba20459178 | ||
|
|
442604003d | ||
|
|
369d0e1a00 | ||
|
|
04b2f94478 | ||
|
|
61b2bd6cb8 | ||
|
|
eea4ba3581 | ||
|
|
3cb3b4f2ba | ||
|
|
2f376c9d36 | ||
|
|
c4877e4444 | ||
|
|
a288736ced | ||
|
|
1debe847d4 | ||
|
|
0c2a15a866 | ||
|
|
da7e60b49f | ||
|
|
d7c6da71f1 | ||
|
|
c4ed09c68f | ||
|
|
06baa98823 | ||
|
|
8d9071e7c2 | ||
|
|
8d0785cf1b | ||
|
|
ef0ce3fc07 | ||
|
|
af9cdd0694 | ||
|
|
a120514e9e | ||
|
|
e627a6ebdd | ||
|
|
94c37f4584 | ||
|
|
a48b62b0f2 | ||
|
|
a9a9545b37 | ||
|
|
ca1df9462d | ||
|
|
32b057d1f3 | ||
|
|
5e340843b1 | ||
|
|
0311298af1 | ||
|
|
b4c2e9301c | ||
|
|
089ef2fa08 | ||
|
|
9232c7abb1 | ||
|
|
27b7c2e201 | ||
|
|
392758a842 | ||
|
|
25fde8db86 | ||
|
|
65ad07af6b | ||
|
|
ac7479415b | ||
|
|
1f64f0aacf | ||
|
|
8fb0e1b75f | ||
|
|
78db2cda27 | ||
|
|
6534fdaf04 | ||
|
|
2e214f16e7 | ||
|
|
1f373b1e47 | ||
|
|
4d36db1319 | ||
|
|
58f0f8fab4 | ||
|
|
7d949ecb16 | ||
|
|
be70047233 | ||
|
|
7649769437 | ||
|
|
bcf0cc26aa | ||
|
|
96ce0692f8 | ||
|
|
9ba3136a24 | ||
|
|
92313c0686 | ||
|
|
a1bb98fd5c | ||
|
|
146d430695 | ||
|
|
b6a0a0f7c7 | ||
|
|
97de38d6a6 | ||
|
|
65ba676f01 | ||
|
|
5d9f81533d | ||
|
|
1948a730d9 | ||
|
|
77f2b17afd | ||
|
|
8739efaee4 | ||
|
|
8f65492d96 | ||
|
|
4f10047ba3 | ||
|
|
9560a665e5 | ||
|
|
1113e5d69c | ||
|
|
363c65da5f | ||
|
|
28dd32070f | ||
|
|
f732d4088b | ||
|
|
e22e4d23e4 | ||
|
|
ce7d6f0507 | ||
|
|
f499494963 | ||
|
|
429722724f | ||
|
|
6a7a9a78ae | ||
|
|
49842df368 | ||
|
|
5cee4463e0 | ||
|
|
e0f0ee0f1a | ||
|
|
76ddcb9d37 | ||
|
|
a7f8b65356 | ||
|
|
d3a4a04a6d | ||
|
|
3a82d4a804 | ||
|
|
274b04c08f | ||
|
|
41fc7dffaf | ||
|
|
66ac453c0f | ||
|
|
251cab64f3 | ||
|
|
963b182cb9 | ||
|
|
3af709e95b | ||
|
|
9136fe9a8b | ||
|
|
e15efa7e08 | ||
|
|
1f2b31f174 | ||
|
|
352fb01068 | ||
|
|
1a9cfc3311 | ||
|
|
77838f2938 | ||
|
|
a1cc5f4282 | ||
|
|
afdc28df80 | ||
|
|
49c389ce70 | ||
|
|
92bfa8f36d | ||
|
|
fd39a88b26 | ||
|
|
dd4fa733e1 | ||
|
|
5d54727139 | ||
|
|
18d4b3fc1b | ||
|
|
82a0ec0d2b | ||
|
|
6a4843c258 | ||
|
|
f414b91b08 | ||
|
|
8a6fe2692c | ||
|
|
8673bc15bc | ||
|
|
c7b034b154 | ||
|
|
4a132941f6 | ||
|
|
c933c1edea | ||
|
|
ccfc9afba7 | ||
|
|
49aea2fcf4 | ||
|
|
40322e0f9b | ||
|
|
72ebe0ec1b | ||
|
|
44eaf1db22 | ||
|
|
8133a12dc3 | ||
|
|
a1bad33d9d | ||
|
|
510c4decb7 | ||
|
|
7822a929f3 | ||
|
|
19b7c730ae | ||
|
|
92e81ee619 | ||
|
|
eeeed1ba08 | ||
|
|
04f246ea9d | ||
|
|
945b1324af | ||
|
|
5469b98057 | ||
|
|
f001c087ec | ||
|
|
125c7b2aba | ||
|
|
424e87a811 | ||
|
|
7391dfa936 | ||
|
|
0a474d34d8 | ||
|
|
ab9a7e05c8 | ||
|
|
6967e936a6 | ||
|
|
47903a7ac9 | ||
|
|
cd842d5a86 | ||
|
|
7b80e17664 | ||
|
|
bdcf89bf32 | ||
|
|
0d19f021f1 | ||
|
|
49bd13adc4 | ||
|
|
3657891833 | ||
|
|
1033e827c0 | ||
|
|
c14b436aec | ||
|
|
8b8d5c360c | ||
|
|
97d229232d | ||
|
|
36ad6efa25 | ||
|
|
0bf7e68ea5 | ||
|
|
d415cbbe45 | ||
|
|
c79114c345 | ||
|
|
6fd07e1e56 | ||
|
|
97044bf5a5 | ||
|
|
31a2880c3c | ||
|
|
476de84dc5 | ||
|
|
0d648074e4 | ||
|
|
47b8a4dd69 | ||
|
|
60863a4304 | ||
|
|
4d8cbc1349 | ||
|
|
5af3b9b7c9 | ||
|
|
84354edcc1 | ||
|
|
c8af9aacbb | ||
|
|
71261023de | ||
|
|
ee962c1919 | ||
|
|
1cf026d956 | ||
|
|
07022bb3be | ||
|
|
b52ff11d3c | ||
|
|
a9942e675f | ||
|
|
8d75194884 |
@@ -1,3 +1,3 @@
|
||||
[settings]
|
||||
line_length=79
|
||||
known_third_party=click,requests,serial,SCons,pytest
|
||||
known_third_party=click,requests,serial,SCons,pytest,bottle
|
||||
|
||||
@@ -1,7 +1,3 @@
|
||||
cache:
|
||||
directories:
|
||||
- $HOME/.platformio
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
|
||||
151
HISTORY.rst
@@ -1,6 +1,144 @@
|
||||
Release History
|
||||
===============
|
||||
|
||||
2.2.0 (2015-07-01)
|
||||
------------------
|
||||
|
||||
* Allowed to exclude/include source files from build process using
|
||||
`src_filter <http://docs.platformio.org/en/latest/projectconf.html#src-filter>`__
|
||||
(`issue #240 <https://github.com/platformio/platformio/issues/240>`_)
|
||||
* Launch own extra script before firmware building/uploading processes
|
||||
(`issue #239 <https://github.com/platformio/platformio/issues/239>`_)
|
||||
* Specify own path to the linker script (ld) using
|
||||
`build_flags <http://docs.platformio.org/en/latest/projectconf.html#build-flags>`__
|
||||
option
|
||||
(`issue #233 <https://github.com/platformio/platformio/issues/233>`_)
|
||||
* Specify library compatibility with the all platforms/frameworks
|
||||
using ``*`` symbol in
|
||||
`library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`__
|
||||
* Added support for new embedded boards: *ST 32L0538DISCOVERY and Delta DFCM-NNN40*
|
||||
to `Framework mbed <http://docs.platformio.org/en/latest/frameworks/mbed.html>`__
|
||||
* Updated packages for
|
||||
`Framework Arduino (AVR, SAM, Espressif and Teensy cores <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__,
|
||||
`Framework mbed <http://docs.platformio.org/en/latest/frameworks/mbed.html>`__,
|
||||
`Espressif ESP8266 SDK <http://docs.platformio.org/en/latest/platforms/espressif.html>`__
|
||||
(`issue #246 <https://github.com/platformio/platformio/issues/246>`_)
|
||||
* Fixed ``stk500v2_command(): command failed``
|
||||
(`issue #238 <https://github.com/platformio/platformio/issues/238>`_)
|
||||
* Fixed IDE project generator when board is specified
|
||||
(`issue #242 <https://github.com/platformio/platformio/issues/242>`_)
|
||||
* Fixed relative path for includes when generating project for IDE
|
||||
(`issue #243 <https://github.com/platformio/platformio/issues/243>`_)
|
||||
* Fixed ESP8266 native SDK exception
|
||||
(`issue #245 <https://github.com/platformio/platformio/issues/245>`_)
|
||||
|
||||
2.1.2 (2015-06-21)
|
||||
------------------
|
||||
|
||||
* Fixed broken link to SCons installer
|
||||
|
||||
2.1.1 (2015-06-09)
|
||||
------------------
|
||||
|
||||
* Automatically detect upload port using VID:PID board settings
|
||||
(`issue #231 <https://github.com/platformio/platformio/issues/231>`_)
|
||||
* Improved detection of build changes
|
||||
* Avoided ``LibInstallDependencyError`` when more then 1 library is found
|
||||
(`issue #229 <https://github.com/platformio/platformio/issues/229>`_)
|
||||
|
||||
2.1.0 (2015-06-03)
|
||||
------------------
|
||||
|
||||
* Added Silicon Labs EFM32 `siliconlabsefm32 <http://docs.platformio.org/en/latest/platforms/siliconlabsefm32.html>`_
|
||||
development platform
|
||||
(`issue #226 <https://github.com/platformio/platformio/issues/226>`_)
|
||||
* Integrate PlatformIO with `Circle CI <https://circleci.com>`_ and
|
||||
`Shippable CI <https://shippable.com>`_
|
||||
* Described in documentation how to `create/register own board <http://docs.platformio.org/en/latest/platforms/creating_board.html>`_ for PlatformIO
|
||||
* Disabled "nano.specs" for ARM-based platforms
|
||||
(`issue #219 <https://github.com/platformio/platformio/issues/219>`_)
|
||||
* Fixed "ConnectionError" when PlatformIO SF Storage is off-line
|
||||
* Fixed resolving of C/C++ std libs by Eclipse IDE
|
||||
(`issue #220 <https://github.com/platformio/platformio/issues/220>`_)
|
||||
* Fixed firmware uploading using USB programmer (USBasp) for
|
||||
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html>`_
|
||||
platform
|
||||
(`issue #221 <https://github.com/platformio/platformio/issues/221>`_)
|
||||
|
||||
2.0.2 (2015-05-27)
|
||||
------------------
|
||||
|
||||
* Fixed libraries order for "Library Dependency Finder" under Linux OS
|
||||
|
||||
2.0.1 (2015-05-27)
|
||||
------------------
|
||||
|
||||
* Handle new environment variable
|
||||
`PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`_
|
||||
* Pass to API requests information about Continuous Integration system. This
|
||||
information will be used by PlatformIO-API.
|
||||
* Use ``include`` directories from toolchain when initialising project for IDE
|
||||
(`issue #210 <https://github.com/platformio/platformio/issues/210>`_)
|
||||
* Added support for new WildFire boards from
|
||||
`Wicked Device <http://wickeddevice.com>`_ to
|
||||
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#boards>`__
|
||||
platform
|
||||
* Updated `Arduino Framework <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__ to
|
||||
1.6.4 version (`issue #212 <https://github.com/platformio/platformio/issues/212>`_)
|
||||
* Handle Atmel AVR Symbols when initialising project for IDE
|
||||
(`issue #216 <https://github.com/platformio/platformio/issues/216>`_)
|
||||
* Fixed bug with converting ``*.ino`` to ``*.cpp``
|
||||
* Fixed failing with ``platformio init --ide eclipse`` without boards
|
||||
(`issue #217 <https://github.com/platformio/platformio/issues/217>`_)
|
||||
|
||||
2.0.0 (2015-05-22)
|
||||
------------------
|
||||
|
||||
*Made in* `Paradise <https://twitter.com/ikravets/status/592356377185619969>`_
|
||||
|
||||
* PlatformIO as `Continuous Integration <http://docs.platformio.org/en/latest/ci/index.html>`_
|
||||
(CI) tool for embedded projects
|
||||
(`issue #108 <https://github.com/platformio/platformio/issues/108>`_)
|
||||
* Initialise PlatformIO project for the specified IDE
|
||||
(`issue #151 <https://github.com/platformio/platformio/issues/151>`_)
|
||||
* PlatformIO CLI 2.0: "platform" related commands have been
|
||||
moved to ``platformio platforms`` subcommand
|
||||
(`issue #158 <https://github.com/platformio/platformio/issues/158>`_)
|
||||
* Created `PlatformIO gitter.im <https://gitter.im/platformio/platformio>`_ room
|
||||
(`issue #174 <https://github.com/platformio/platformio/issues/174>`_)
|
||||
* Global ``-f, --force`` option which will force to accept any
|
||||
confirmation prompts
|
||||
(`issue #152 <https://github.com/platformio/platformio/issues/152>`_)
|
||||
* Run project with `platformio run --project-dir <http://docs.platformio.org/en/latest/userguide/cmd_run.html#cmdoption--project-dir>`_ option without changing the current working
|
||||
directory
|
||||
(`issue #192 <https://github.com/platformio/platformio/issues/192>`_)
|
||||
* Control verbosity of `platformio run <http://docs.platformio.org/en/latest/userguide/cmd_run.html#cmdoption-platformio-run-v>`_ command via ``-v/--verbose`` option
|
||||
* Add library dependencies for build environment using
|
||||
`lib_install <http://docs.platformio.org/en/latest/projectconf.html#lib-install>`_
|
||||
option in ``platformio.ini``
|
||||
(`issue #134 <https://github.com/platformio/platformio/issues/134>`_)
|
||||
* Specify libraries which are compatible with build environment using
|
||||
`lib_use <http://docs.platformio.org/en/latest/projectconf.html#lib-use>`_
|
||||
option in ``platformio.ini``
|
||||
(`issue #148 <https://github.com/platformio/platformio/issues/148>`_)
|
||||
* Add more boards to PlatformIO project with
|
||||
`platformio init --board <http://docs.platformio.org/en/latest/userguide/cmd_init.html#cmdoption--board>`__
|
||||
command
|
||||
(`issue #167 <https://github.com/platformio/platformio/issues/167>`_)
|
||||
* Choose which library to update
|
||||
(`issue #168 <https://github.com/platformio/platformio/issues/168>`_)
|
||||
* Specify `platformio init --env-prefix <http://docs.platformio.org/en/latest/userguide/cmd_init.html#cmdoption--env-prefix>`__ when initialise/update project
|
||||
(`issue #182 <https://github.com/platformio/platformio/issues/182>`_)
|
||||
* Added new Armstrap boards
|
||||
(`issue #204 <https://github.com/platformio/platformio/issues/204>`_)
|
||||
* Updated SDK for `espressif <http://docs.platformio.org/en/latest/platforms/espressif.html>`__
|
||||
development platform to v1.1
|
||||
(`issue #179 <https://github.com/platformio/platformio/issues/179>`_)
|
||||
* Disabled automatic updates by default for platforms, packages and libraries
|
||||
(`issue #171 <https://github.com/platformio/platformio/issues/171>`_)
|
||||
* Fixed bug with creating copies of source files
|
||||
(`issue #177 <https://github.com/platformio/platformio/issues/177>`_)
|
||||
|
||||
1.5.0 (2015-05-15)
|
||||
------------------
|
||||
|
||||
@@ -35,15 +173,16 @@ Release History
|
||||
`teensy <http://docs.platformio.org/en/latest/platforms/teensy.html>`__
|
||||
platform
|
||||
* Added support for new Arduino based boards by *SparkFun, BQ, LightUp,
|
||||
LowPowerLab, Quirkbot, RedBearLab, TinyCircuits, WickedDevice* to
|
||||
LowPowerLab, Quirkbot, RedBearLab, TinyCircuits* to
|
||||
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#boards>`__
|
||||
platform
|
||||
* Upgraded `Arduino Framework <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__ to
|
||||
1.6.3 version (`issue #156 <https://github.com/platformio/platformio/issues/156>`_)
|
||||
* Upgraded `Energia Framework <http://docs.platformio.org/en/latest/frameworks/energia.html>`__ to
|
||||
0101E0015 version (`issue #146 <https://github.com/platformio/platformio/issues/146>`_)
|
||||
* Upgraded `Arduino Framework with Teensy Core <http://docs.platformio.org/en/latest/frameworks/arduino.html>`_ to
|
||||
1.22 version (`issue #162 <https://github.com/platformio/platformio/issues/162>`_,
|
||||
* Upgraded `Arduino Framework with Teensy Core <http://docs.platformio.org/en/latest/frameworks/arduino.html>`_
|
||||
to 1.22 version
|
||||
(`issue #162 <https://github.com/platformio/platformio/issues/162>`_,
|
||||
`issue #170 <https://github.com/platformio/platformio/issues/170>`_)
|
||||
* Fixed exceptions with PlatformIO auto-updates when Internet connection isn't
|
||||
active
|
||||
@@ -167,7 +306,7 @@ Release History
|
||||
commands which allows to return the output in `JSON <http://en.wikipedia.org/wiki/JSON>`_ format
|
||||
(`issue #42 <https://github.com/platformio/platformio/issues/42>`_)
|
||||
* Allowed to ignore some libs from *Library Dependency Finder* via
|
||||
`ignore_libs <http://docs.platformio.org/en/latest/projectconf.html#ignore-libs>`_ option
|
||||
`lib_ignore <http://docs.platformio.org/en/latest/projectconf.html#lib-ignore>`_ option
|
||||
* Improved `platformio run <http://docs.platformio.org/en/latest/userguide/cmd_run.html>`__
|
||||
command: asynchronous output for build process, timing and detailed
|
||||
information about environment configuration
|
||||
@@ -335,10 +474,10 @@ Release History
|
||||
|
||||
* Implemented `platformio serialports <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html>`_ command
|
||||
* Allowed to put special build flags only for ``src`` files via
|
||||
`srcbuild_flags <http://docs.platformio.org/en/latest/projectconf.html#srcbuild-flags>`_
|
||||
`src_build_flags <http://docs.platformio.org/en/latest/projectconf.html#src_build-flags>`_
|
||||
environment option
|
||||
* Allowed to override some of settings via system environment variables
|
||||
such as: ``PLATFORMIO_SRCBUILD_FLAGS`` and ``PLATFORMIO_ENVS_DIR``
|
||||
such as: ``PLATFORMIO_SRC_BUILD_FLAGS`` and ``PLATFORMIO_ENVS_DIR``
|
||||
* Added ``--upload-port`` option for `platformio run <http://docs.platformio.org/en/latest/userguide/cmd_run.html#cmdoption--upload-port>`__ command
|
||||
* Implemented (especially for `SmartAnthill <http://docs.smartanthill.ikravets.com/>`_)
|
||||
`platformio run -t uploadlazy <http://docs.platformio.org/en/latest/userguide/cmd_run.html>`_
|
||||
|
||||
40
README.rst
@@ -4,24 +4,32 @@ PlatformIO
|
||||
.. image:: https://travis-ci.org/platformio/platformio.svg?branch=develop
|
||||
:target: https://travis-ci.org/platformio/platformio
|
||||
:alt: Travis.CI Build Status
|
||||
.. image:: https://ci.appveyor.com/api/projects/status/ee26e58de798rctd/branch/develop?svg=true
|
||||
.. image:: https://ci.appveyor.com/api/projects/status/dku0h2rutfj0ctls/branch/develop?svg=true
|
||||
:target: https://ci.appveyor.com/project/ivankravets/platformio
|
||||
:alt: AppVeyor.CI Build Status
|
||||
.. image:: https://api.shippable.com/projects/555b0ceeedd7f2c052f3c2d0/badge?branchName=develop
|
||||
:target: https://app.shippable.com/projects/555b0ceeedd7f2c052f3c2d0
|
||||
:alt: Shippable Build Status
|
||||
.. image:: https://circleci.com/gh/platformio/platformio/tree/develop.svg?style=svg
|
||||
:target: https://circleci.com/gh/platformio/platformio/tree/develop
|
||||
:alt: Circle.CI Build Status
|
||||
.. image:: https://gemnasium.com/platformio/platformio.png
|
||||
:target: https://gemnasium.com/platformio/platformio
|
||||
:alt: Dependency Status
|
||||
.. image:: https://pypip.in/version/platformio/badge.png?style=flat
|
||||
.. image:: https://img.shields.io/pypi/v/platformio.svg
|
||||
:target: https://pypi.python.org/pypi/platformio/
|
||||
:alt: Latest Version
|
||||
.. image:: https://pypip.in/download/platformio/badge.png?style=flat
|
||||
.. image:: https://img.shields.io/pypi/dm/platformio.svg
|
||||
:target: https://pypi.python.org/pypi/platformio/
|
||||
:alt: Downloads
|
||||
.. image:: https://pypip.in/license/platformio/badge.png?style=flat
|
||||
.. image:: https://img.shields.io/pypi/l/platformio.svg
|
||||
:target: https://pypi.python.org/pypi/platformio/
|
||||
:alt: License
|
||||
.. image:: https://badges.gitter.im/Join%20Chat.svg
|
||||
:alt: Join the chat at https://gitter.im/platformio/platformio
|
||||
:target: https://gitter.im/platformio/platformio
|
||||
.. image:: https://www.openhub.net/p/platformio/widgets/project_thin_badge.gif
|
||||
:target: https://www.openhub.net/p/platformio
|
||||
|
||||
`Website + Library Search <http://platformio.org>`_ |
|
||||
`Documentation <http://docs.platformio.org>`_ |
|
||||
@@ -30,14 +38,16 @@ PlatformIO
|
||||
`Reddit <http://www.reddit.com/r/platformio/>`_ |
|
||||
`Twitter <https://twitter.com/PlatformIO_Org>`_
|
||||
|
||||
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
|
||||
ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc.*
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/platformio/platformio/develop/docs/_static/platformio-logo.png
|
||||
:target: http://platformio.org
|
||||
|
||||
`PlatformIO <http://platformio.org>`_ is a cross-platform code builder
|
||||
and the missing library manager.
|
||||
and the missing library manager (Ready for embedded development, IDE and
|
||||
Continuous integration, Arduino and MBED compatible).
|
||||
|
||||
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
|
||||
Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed,
|
||||
libOpenCM3, etc.*
|
||||
|
||||
* `Get Started <http://platformio.org/#!/get-started>`_
|
||||
* `Web 2.0 Library Search <http://platformio.org/#!/lib>`_
|
||||
@@ -46,6 +56,7 @@ and the missing library manager.
|
||||
* `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
* `Library Manager <http://docs.platformio.org/en/latest/librarymanager/index.html>`_
|
||||
* `User Guide <http://docs.platformio.org/en/latest/userguide/index.html>`_
|
||||
* `Continuous Integration <http://docs.platformio.org/en/latest/ci/index.html>`_
|
||||
* `IDE Integration <http://docs.platformio.org/en/latest/ide.html>`_
|
||||
* `Articles about us <http://docs.platformio.org/en/latest/articles.html>`_
|
||||
* `FAQ <http://docs.platformio.org/en/latest/faq.html>`_
|
||||
@@ -71,11 +82,13 @@ Embedded Development. *Easier Than Ever.*
|
||||
settings for most popular `Embedded Boards <http://platformio.org/#!/boards>`_.
|
||||
|
||||
* Colourful `command-line output <https://raw.githubusercontent.com/platformio/platformio/develop/examples/platformio-examples.png>`_
|
||||
* Built-in `Serial Port Monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_
|
||||
* Configurable `build -flags/-options <http://docs.platformio.org/en/latest/projectconf.html#build-flags>`_
|
||||
* `IDE Integration <http://docs.platformio.org/en/latest/ide.html>`_ with
|
||||
*Arduino, Eclipse, Energia, Qt Creator, Sublime Text, Vim, Visual Studio*
|
||||
* `Continuous Integration <http://docs.platformio.org/en/latest/ci/index.html>`_
|
||||
with *AppVeyor, Circle CI, Drone, Shippable, Travis CI*
|
||||
* Built-in `Serial Port Monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ and configurable
|
||||
`build -flags/-options <http://docs.platformio.org/en/latest/projectconf.html#build-flags>`_
|
||||
* Automatic **firmware uploading**
|
||||
* Integration with `development environments (IDE) <http://docs.platformio.org/en/latest/ide.html>`_
|
||||
* Ready for **Cloud Compiling** and **Continuous Integration**
|
||||
* Pre-built tool chains, frameworks for the popular `Hardware Platforms <http://platformio.org/#!/platforms>`_
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-embedded-development.png
|
||||
@@ -133,8 +146,9 @@ It has support for the most popular embedded platforms:
|
||||
* `Espressif <http://platformio.org/#!/platforms/espressif>`_
|
||||
* `Freescale Kinetis <http://platformio.org/#!/platforms/freescalekinetis>`_
|
||||
* `Nordic nRF51 <http://platformio.org/#!/platforms/nordicnrf51>`_
|
||||
* `NXP LPC. <http://platformio.org/#!/platforms/nxplpc>`_
|
||||
* `NXP LPC <http://platformio.org/#!/platforms/nxplpc>`_
|
||||
* `ST STM32 <http://platformio.org/#!/platforms/ststm32>`_
|
||||
* `Silicon Labs EFM32 <http://platformio.org/#!/platforms/siliconlabsefm32>`_
|
||||
* `Teensy <http://platformio.org/#!/platforms/teensy>`_
|
||||
* `TI MSP430 <http://platformio.org/#!/platforms/timsp430>`_
|
||||
* `TI TIVA C <http://platformio.org/#!/platforms/titiva>`_
|
||||
|
||||
20
circle.yml
Normal file
@@ -0,0 +1,20 @@
|
||||
machine:
|
||||
python:
|
||||
version: 2.7
|
||||
environment:
|
||||
TOX_ENV: docs
|
||||
TOX_ENV: lint
|
||||
TOX_ENV: py26
|
||||
TOX_ENV: py27
|
||||
|
||||
checkout:
|
||||
post:
|
||||
- git submodule update --init
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
- pip install tox
|
||||
|
||||
test:
|
||||
override:
|
||||
- tox -e $TOX_ENV
|
||||
BIN
docs/_static/droneci-platformio-integration-1.png
vendored
Normal file
|
After Width: | Height: | Size: 22 KiB |
BIN
docs/_static/droneci-platformio-integration-2.png
vendored
Normal file
|
After Width: | Height: | Size: 41 KiB |
BIN
docs/_static/ide-platformio-qtcreator-3.png
vendored
|
Before Width: | Height: | Size: 71 KiB After Width: | Height: | Size: 70 KiB |
BIN
docs/_static/ide-platformio-qtcreator-4.png
vendored
|
Before Width: | Height: | Size: 67 KiB After Width: | Height: | Size: 66 KiB |
BIN
docs/_static/ide-vs-platformio-newproject-2-1.png
vendored
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 17 KiB |
BIN
docs/_static/ide-vs-platformio-newproject-2.png
vendored
|
Before Width: | Height: | Size: 15 KiB After Width: | Height: | Size: 16 KiB |
BIN
docs/_static/platformio-logo.png
vendored
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 13 KiB |
@@ -4,11 +4,14 @@ Articles about us
|
||||
=================
|
||||
|
||||
.. note::
|
||||
If you've writeen article about PlatformIO and would like it listed on
|
||||
If you've written article about PlatformIO and would like it listed on
|
||||
this page, `please edit this page <https://github.com/platformio/platformio/blob/develop/docs/articles.rst>`_.
|
||||
|
||||
Here are recent articles about PlatformIO:
|
||||
|
||||
* Jun 02, 2015 - **Alejandro Guirao Rodriguez** - `Discovering PlatformIO: The RaspberryPi / Arduino combo kit is a winner option when prototyping an IoT-style project <http://lekum.org/posts/discovering-platformio.html>`_
|
||||
* May 11, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part II <http://ithare.com/from-web-developer-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-ii/>`_
|
||||
* May 4, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part I <http://ithare.com/from-web-development-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-i/>`_
|
||||
* April 17, 2015 - **Michael Ball** - `PlatformIO - A Cross-Platform Code Builder and Missing Library Manager <http://arduino-pi.blogspot.com.es/2015/04/platformio-cross-platform-code-builder.html>`_
|
||||
* March 23, 2015 - **Atmel** - `Cross-board and cross-vendor embedded development with PlatformIO <http://blog.atmel.com/2015/03/23/cross-board-and-cross-vendor-embedded-development-with-platformio/>`_
|
||||
* March 22, 2015 - **Mark VandeWettering** - `Discovered a new tool for embedded development: PlatformIO <http://brainwagon.org/2015/03/22/discovered-a-new-tool-for-embedded-development-platformio/>`_
|
||||
|
||||
213
docs/ci/appveyor.rst
Normal file
@@ -0,0 +1,213 @@
|
||||
.. _ci_appveyor:
|
||||
|
||||
AppVeyor
|
||||
========
|
||||
|
||||
`AppVeyor <http://www.appveyor.com/about>`_ is an open-source hosted,
|
||||
distributed continuous integration service used to build and test projects
|
||||
hosted at `GitHub <http://en.wikipedia.org/wiki/GitHub>`_ on Windows family
|
||||
systems.
|
||||
|
||||
AppVeyor is configured by adding a file named ``appveyor.yml``, which is a
|
||||
`YAML <http://en.wikipedia.org/wiki/YAML>`_ format text file, to the root
|
||||
directory of the GitHub repository.
|
||||
|
||||
AppVeyor automatically detects when a commit has been made and pushed to a
|
||||
GitHub repository that is using AppVeyor, and each time this happens, it will
|
||||
try to build the project using :ref:`cmd_ci` command. This includes commits to
|
||||
all branches, not just to the master branch. AppVeyor will also build and run
|
||||
pull requests. When that process has completed, it will notify a developer in
|
||||
the way it has been configured to do so — for example, by sending an email
|
||||
containing the build results (showing success or failure), or by posting a
|
||||
message on an IRC channel. It can be configured to build project on a range of
|
||||
different :ref:`platforms`.
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Put ``appveyor.yml`` to the root directory of the GitHub repository.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
build: off
|
||||
environment:
|
||||
global:
|
||||
WITH_COMPILER: "cmd /E:ON /V:ON /C .\\scripts\\appveyor\\run_with_compiler.cmd"
|
||||
matrix:
|
||||
- PLATFORMIO_CI_SRC: "path\\to\\source\\file.c"
|
||||
PLATFORMIO_CI_SRC: "path\\to\\source\\file.ino"
|
||||
PLATFORMIO_CI_SRC: "path\\to\\source\\directory"
|
||||
WINDOWS_SDK_VERSION: "v7.0"
|
||||
PYTHON_HOME: "C:\\Python27-x64"
|
||||
PYTHON_VERSION: "2.7"
|
||||
PYTHON_ARCH: "64"
|
||||
install:
|
||||
- "git submodule update --init --recursive"
|
||||
- "powershell scripts\\appveyor\\install.ps1"
|
||||
before_test:
|
||||
- cmd: SET PATH=%PATH%;%PYTHON_HOME%;%PYTHON_HOME%\Scripts
|
||||
test_script:
|
||||
- '%WITH_COMPILER% %PYTHON_HOME%\\Scripts\\platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N'
|
||||
|
||||
|
||||
Then create ``scripts/appveyor`` folder and put these 2 scripts (they are the
|
||||
same for the all projects, don't need to modify them):
|
||||
|
||||
1. ``scripts/appveyor/install.ps1``:
|
||||
|
||||
.. code-block:: PowerShell
|
||||
|
||||
$BASE_URL = "https://www.python.org/ftp/python/"
|
||||
$GET_PIP_URL = "https://bootstrap.pypa.io/get-pip.py"
|
||||
$GET_PIP_PATH = "C:\get-pip.py"
|
||||
|
||||
|
||||
function DownloadPython ($python_version, $platform_suffix) {
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
$filename = "python-" + $python_version + $platform_suffix + ".msi"
|
||||
$url = $BASE_URL + $python_version + "/" + $filename
|
||||
|
||||
$basedir = $pwd.Path + "\"
|
||||
$filepath = $basedir + $filename
|
||||
if (Test-Path $filename) {
|
||||
Write-Host "Reusing" $filepath
|
||||
return $filepath
|
||||
}
|
||||
|
||||
# Download and retry up to 5 times in case of network transient errors.
|
||||
Write-Host "Downloading" $filename "from" $url
|
||||
$retry_attempts = 3
|
||||
for($i=0; $i -lt $retry_attempts; $i++){
|
||||
try {
|
||||
$webclient.DownloadFile($url, $filepath)
|
||||
break
|
||||
}
|
||||
Catch [Exception]{
|
||||
Start-Sleep 1
|
||||
}
|
||||
}
|
||||
Write-Host "File saved at" $filepath
|
||||
return $filepath
|
||||
}
|
||||
|
||||
|
||||
function InstallPython ($python_version, $architecture, $python_home) {
|
||||
Write-Host "Installing Python" $python_version "for" $architecture "bit architecture to" $python_home
|
||||
if (Test-Path $python_home) {
|
||||
Write-Host $python_home "already exists, skipping."
|
||||
return $false
|
||||
}
|
||||
if ($architecture -eq "32") {
|
||||
$platform_suffix = ""
|
||||
} else {
|
||||
$platform_suffix = ".amd64"
|
||||
}
|
||||
$filepath = DownloadPython $python_version $platform_suffix
|
||||
Write-Host "Installing" $filepath "to" $python_home
|
||||
$args = "/qn /i $filepath TARGETDIR=$python_home"
|
||||
Write-Host "msiexec.exe" $args
|
||||
Start-Process -FilePath "msiexec.exe" -ArgumentList $args -Wait -Passthru
|
||||
Write-Host "Python $python_version ($architecture) installation complete"
|
||||
return $true
|
||||
}
|
||||
|
||||
|
||||
function InstallPip ($python_home) {
|
||||
$pip_path = $python_home + "/Scripts/pip.exe"
|
||||
$python_path = $python_home + "/python.exe"
|
||||
if (-not(Test-Path $pip_path)) {
|
||||
Write-Host "Installing pip..."
|
||||
$webclient = New-Object System.Net.WebClient
|
||||
$webclient.DownloadFile($GET_PIP_URL, $GET_PIP_PATH)
|
||||
Write-Host "Executing:" $python_path $GET_PIP_PATH
|
||||
Start-Process -FilePath "$python_path" -ArgumentList "$GET_PIP_PATH" -Wait -Passthru
|
||||
} else {
|
||||
Write-Host "pip already installed."
|
||||
}
|
||||
}
|
||||
|
||||
function InstallPackage ($python_home, $pkg) {
|
||||
$pip_path = $python_home + "/Scripts/pip.exe"
|
||||
& $pip_path install -U $pkg
|
||||
}
|
||||
|
||||
function InstallScons ($python_home) {
|
||||
Write-Host "Start installing Scons"
|
||||
$pip_path = $python_home + "/Scripts/pip.exe"
|
||||
& $pip_path install --egg "http://sourceforge.net/projects/scons/files/latest/download"
|
||||
Write-Host "Scons installed"
|
||||
}
|
||||
|
||||
function main () {
|
||||
InstallPython $env:PYTHON_VERSION $env:PYTHON_ARCH $env:PYTHON_HOME
|
||||
InstallPip $env:PYTHON_HOME
|
||||
InstallPackage $env:PYTHON_HOME setuptools
|
||||
InstallPackage $env:PYTHON_HOME platformio
|
||||
InstallScons $env:PYTHON_HOME
|
||||
}
|
||||
|
||||
main
|
||||
|
||||
2. ``scripts/appveyor/run_with_compiler.cmd``:
|
||||
|
||||
.. code-block:: guess
|
||||
|
||||
@ECHO OFF
|
||||
|
||||
SET COMMAND_TO_RUN=%*
|
||||
SET WIN_SDK_ROOT=C:\Program Files\Microsoft SDKs\Windows
|
||||
|
||||
SET MAJOR_PYTHON_VERSION="%PYTHON_VERSION:~0,1%"
|
||||
IF %MAJOR_PYTHON_VERSION% == "2" (
|
||||
SET WINDOWS_SDK_VERSION="v7.0"
|
||||
) ELSE IF %MAJOR_PYTHON_VERSION% == "3" (
|
||||
SET WINDOWS_SDK_VERSION="v7.1"
|
||||
) ELSE (
|
||||
ECHO Unsupported Python version: "%MAJOR_PYTHON_VERSION%"
|
||||
EXIT 1
|
||||
)
|
||||
|
||||
IF "%PYTHON_ARCH%"=="64" (
|
||||
ECHO Configuring Windows SDK %WINDOWS_SDK_VERSION% for Python %MAJOR_PYTHON_VERSION% on a 64 bit architecture
|
||||
SET DISTUTILS_USE_SDK=1
|
||||
SET MSSdk=1
|
||||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Setup\WindowsSdkVer.exe" -q -version:%WINDOWS_SDK_VERSION%
|
||||
"%WIN_SDK_ROOT%\%WINDOWS_SDK_VERSION%\Bin\SetEnv.cmd" /x64 /release
|
||||
ECHO Executing: %COMMAND_TO_RUN%
|
||||
call %COMMAND_TO_RUN% || EXIT 1
|
||||
) ELSE (
|
||||
ECHO Using default MSVC build environment for 32 bit architecture
|
||||
ECHO Executing: %COMMAND_TO_RUN%
|
||||
call %COMMAND_TO_RUN% || EXIT 1
|
||||
)
|
||||
|
||||
For more details as for PlatformIO build process please look into :ref:`cmd_ci`
|
||||
command.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
1. Integration for `USB_Host_Shield_2.0 <https://github.com/felis/USB_Host_Shield_2.0>`_
|
||||
project. The ``appveyor.yml`` configuration file:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
build: off
|
||||
environment:
|
||||
global:
|
||||
WITH_COMPILER: "cmd /E:ON /V:ON /C .\\scripts\\appveyor\\run_with_compiler.cmd"
|
||||
matrix:
|
||||
- PLATFORMIO_CI_SRC: "examples\\Bluetooth\\PS3SPP\\PS3SPP.ino"
|
||||
PLATFORMIO_CI_SRC: "examples\\pl2303\\pl2303_gps\\pl2303_gps.ino"
|
||||
WINDOWS_SDK_VERSION: "v7.0"
|
||||
PYTHON_HOME: "C:\\Python27-x64"
|
||||
PYTHON_VERSION: "2.7"
|
||||
PYTHON_ARCH: "64"
|
||||
install:
|
||||
- "git submodule update --init --recursive"
|
||||
- "powershell scripts\\appveyor\\install.ps1"
|
||||
before_test:
|
||||
- cmd: SET PATH=%PATH%;%PYTHON_HOME%;%PYTHON_HOME%\Scripts
|
||||
- cmd: git clone https://github.com/xxxajk/spi4teensy3.git c:\spi4teensy
|
||||
test_script:
|
||||
- '%WITH_COMPILER% %PYTHON_HOME%\\Scripts\\platformio ci --lib="." --lib="c:\spi4teensy" --board=uno --board=teensy31 --board=due'
|
||||
72
docs/ci/circleci.rst
Normal file
@@ -0,0 +1,72 @@
|
||||
.. _ci_circleci:
|
||||
|
||||
Circle CI
|
||||
=========
|
||||
|
||||
`Circle CI <https://circleci.com/about>`_ is a hosted cloud
|
||||
platform that provides hosted continuous integration, deployment, and testing
|
||||
to `GitHub <http://en.wikipedia.org/wiki/GitHub>`_ repositories.
|
||||
|
||||
Circle CI is configured by adding a file named ``circle.yml``, which is a
|
||||
`YAML <http://en.wikipedia.org/wiki/YAML>`_ format text file, to the root
|
||||
directory of the GitHub repository.
|
||||
|
||||
Circle CI automatically detects when a commit has been made and pushed to a
|
||||
GitHub repository that is using Circle CI, and each time this happens, it will
|
||||
try to build the project using :ref:`cmd_ci` command. This includes commits to
|
||||
all branches, not just to the master branch. Circle CI will also build and run
|
||||
pull requests. When that process has completed, it will notify a developer in
|
||||
the way it has been configured to do so — for example, by sending an email
|
||||
containing the build results (showing success or failure), or by posting a
|
||||
message on an IRC channel. It can be configured to build project on a range of
|
||||
different :ref:`platforms`.
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Put ``circle.yml`` to the root directory of the GitHub repository.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
machine:
|
||||
environment:
|
||||
PLATFORMIO_CI_SRC: path/to/source/file.c
|
||||
PLATFORMIO_CI_SRC: path/to/source/file.ino
|
||||
PLATFORMIO_CI_SRC: path/to/source/directory
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
- sudo apt-get install python2.7-dev
|
||||
- sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
|
||||
test:
|
||||
override:
|
||||
- platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
|
||||
For more details as for PlatformIO build process please look into :ref:`cmd_ci`
|
||||
command.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
1. Integration for `USB_Host_Shield_2.0 <https://github.com/felis/USB_Host_Shield_2.0>`_
|
||||
project. The ``circle.yml`` configuration file:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
machine:
|
||||
environment:
|
||||
PLATFORMIO_CI_SRC: examples/Bluetooth/PS3SPP/PS3SPP.ino
|
||||
PLATFORMIO_CI_SRC: examples/pl2303/pl2303_gps/pl2303_gps.ino
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
- sudo apt-get install python2.7-dev
|
||||
- sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
- wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip
|
||||
- unzip /tmp/spi4teensy3.zip -d /tmp
|
||||
|
||||
test:
|
||||
override:
|
||||
- platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due
|
||||
70
docs/ci/drone.rst
Normal file
@@ -0,0 +1,70 @@
|
||||
.. _ci_drone:
|
||||
|
||||
Drone
|
||||
=====
|
||||
|
||||
`Drone <https://drone.io>`_ is a hosted continuous integration service.
|
||||
It enables you to conveniently set up projects to automatically build, test,
|
||||
and deploy as you make changes to your code to
|
||||
`GitHub <http://en.wikipedia.org/wiki/GitHub>`_ and
|
||||
`BitBucket <http://en.wikipedia.org/wiki/Bitbucket>`_ repositories.
|
||||
|
||||
Drone is configured by modifying settings in your project control panel.
|
||||
|
||||
Drone automatically detects when a commit has been made and pushed to a
|
||||
GitHub repository that is using Drone, and each time this happens, it will
|
||||
try to build the project using :ref:`cmd_ci` command. This includes commits to
|
||||
all branches, not just to the master branch. Drone will also build and run
|
||||
pull requests. When that process has completed, it will notify a developer in
|
||||
the way it has been configured to do so — for example, by sending an email
|
||||
containing the build results (showing success or failure). It can be
|
||||
configured to build project on a range of different :ref:`platforms`.
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Please fill all fields for your project in the Drone control panel:
|
||||
|
||||
`Environment Variables`:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
PLATFORMIO_CI_SRC=path/to/source/file.c
|
||||
PLATFORMIO_CI_SRC=path/to/source/file.ino
|
||||
PLATFORMIO_CI_SRC=path/to/source/directory
|
||||
|
||||
`Commands`:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
.. image:: ../_static/droneci-platformio-integration-1.png
|
||||
|
||||
For more details as for PlatformIO build process please look into :ref:`cmd_ci`
|
||||
command.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
1. Integration for `USB_Host_Shield_2.0 <https://github.com/felis/USB_Host_Shield_2.0>`_
|
||||
project. The ``circle.yml`` configuration file:
|
||||
|
||||
`Environment Variables`:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
PLATFORMIO_CI_SRC=examples/Bluetooth/PS3SPP/PS3SPP.ino
|
||||
PLATFORMIO_CI_SRC=examples/pl2303/pl2303_gps/pl2303_gps.ino
|
||||
|
||||
`Commands`:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip
|
||||
unzip /tmp/spi4teensy3.zip -d /tmp
|
||||
platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due
|
||||
|
||||
.. image:: ../_static/droneci-platformio-integration-2.png
|
||||
24
docs/ci/index.rst
Normal file
@@ -0,0 +1,24 @@
|
||||
.. _ci:
|
||||
|
||||
Continuous Integration
|
||||
======================
|
||||
|
||||
`Continuous Integration (CI, wiki) <http://en.wikipedia.org/wiki/Continuous_integration>`_
|
||||
is the practice, in software engineering, of merging all developer working
|
||||
copies with a shared mainline several times a day.
|
||||
|
||||
:ref:`cmd_ci` command is intended to be used in combination with the build
|
||||
servers and the popular
|
||||
`Continuous Integration Software <http://en.wikipedia.org/wiki/Comparison_of_continuous_integration_software>`_.
|
||||
|
||||
By integrating regularly, you can detect errors quickly, and locate them more
|
||||
easily.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
appveyor
|
||||
circleci
|
||||
drone
|
||||
shippable
|
||||
travis
|
||||
76
docs/ci/shippable.rst
Normal file
@@ -0,0 +1,76 @@
|
||||
.. _ci_shippable:
|
||||
|
||||
Shippable
|
||||
=========
|
||||
|
||||
`Shippable <http://en.wikipedia.org/wiki/Shippable>`_ is a hosted cloud
|
||||
platform that provides hosted continuous integration, deployment, and testing
|
||||
to `GitHub <http://en.wikipedia.org/wiki/GitHub>`_ and
|
||||
`BitBucket <http://en.wikipedia.org/wiki/Bitbucket>`_ repositories.
|
||||
Shippable's continuous integration service is built using Docker.
|
||||
|
||||
Shippable is configured by adding a file named ``shippable.yml``, which is a
|
||||
`YAML <http://en.wikipedia.org/wiki/YAML>`_ format text file, to the root
|
||||
directory of the GitHub repository or you can use your Travis CI configuration
|
||||
file ``.travis.yml``.
|
||||
|
||||
Shippable automatically detects when a commit has been made and pushed to a
|
||||
GitHub repository that is using Shippable, and each time this happens, it will
|
||||
try to build the project using :ref:`cmd_ci` command. This includes commits to
|
||||
all branches, not just to the master branch. Shippable will also build and run
|
||||
pull requests. When that process has completed, it will notify a developer in
|
||||
the way it has been configured to do so — for example, by sending an email
|
||||
containing the build results (showing success or failure), or by posting a
|
||||
message on an IRC channel. It can be configured to build project on a range of
|
||||
different :ref:`platforms`.
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Please put ``shippable.yml`` or ``.travis.yml`` to the root directory of the
|
||||
GitHub repository.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
|
||||
env:
|
||||
- PLATFORMIO_CI_SRC=path/to/source/file.c
|
||||
- PLATFORMIO_CI_SRC=path/to/source/file.ino
|
||||
- PLATFORMIO_CI_SRC=path/to/source/directory
|
||||
|
||||
install:
|
||||
- python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
|
||||
script:
|
||||
- platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
|
||||
For more details as for PlatformIO build process please look into :ref:`cmd_ci`
|
||||
command.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
1. Integration for `USB_Host_Shield_2.0 <https://github.com/felis/USB_Host_Shield_2.0>`_
|
||||
project. The ``shippable.yml`` or ``.travis.yml`` configuration file:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
|
||||
env:
|
||||
- PLATFORMIO_CI_SRC=examples/Bluetooth/PS3SPP/PS3SPP.ino
|
||||
- PLATFORMIO_CI_SRC=examples/pl2303/pl2303_gps/pl2303_gps.ino
|
||||
|
||||
install:
|
||||
- python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
- wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip
|
||||
- unzip /tmp/spi4teensy3.zip -d /tmp
|
||||
|
||||
script:
|
||||
- platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due
|
||||
83
docs/ci/travis.rst
Normal file
@@ -0,0 +1,83 @@
|
||||
.. _ci_travis:
|
||||
|
||||
Travis CI
|
||||
=========
|
||||
|
||||
`Travis CI <http://en.wikipedia.org/wiki/Travis_CI>`_ is an open-source hosted,
|
||||
distributed continuous integration service used to build and test projects
|
||||
hosted at `GitHub <http://en.wikipedia.org/wiki/GitHub>`_.
|
||||
|
||||
Travis CI is configured by adding a file named ``.travis.yml``, which is a
|
||||
`YAML <http://en.wikipedia.org/wiki/YAML>`_ format text file, to the root
|
||||
directory of the GitHub repository.
|
||||
|
||||
Travis CI automatically detects when a commit has been made and pushed to a
|
||||
GitHub repository that is using Travis CI, and each time this happens, it will
|
||||
try to build the project using :ref:`cmd_ci` command. This includes commits to
|
||||
all branches, not just to the master branch. Travis CI will also build and run
|
||||
pull requests. When that process has completed, it will notify a developer in
|
||||
the way it has been configured to do so — for example, by sending an email
|
||||
containing the build results (showing success or failure), or by posting a
|
||||
message on an IRC channel. It can be configured to build project on a range of
|
||||
different :ref:`platforms`.
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Please put ``.travis.yml`` to the root directory of the GitHub repository.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
|
||||
env:
|
||||
- PLATFORMIO_CI_SRC=path/to/source/file.c
|
||||
- PLATFORMIO_CI_SRC=path/to/source/file.ino
|
||||
- PLATFORMIO_CI_SRC=path/to/source/directory
|
||||
|
||||
install:
|
||||
- python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
|
||||
script:
|
||||
- platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
|
||||
Then see step 1, 2, and step 4 here: http://docs.travis-ci.com/user/getting-started/
|
||||
|
||||
For more details as for PlatformIO build process please look into :ref:`cmd_ci`
|
||||
command.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
1. Integration for `USB_Host_Shield_2.0 <https://github.com/felis/USB_Host_Shield_2.0>`_
|
||||
project. The ``.travis.yml`` configuration file:
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
|
||||
env:
|
||||
- PLATFORMIO_CI_SRC=examples/acm/acm_terminal
|
||||
- PLATFORMIO_CI_SRC=examples/Bluetooth/WiiIRCamera PLATFORMIO_BUILD_FLAGS="-DWIICAMERA"
|
||||
- PLATFORMIO_CI_SRC=examples/ftdi/USBFTDILoopback
|
||||
- PLATFORMIO_CI_SRC=examples/Xbox/XBOXUSB
|
||||
# - ...
|
||||
|
||||
install:
|
||||
- python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
|
||||
# Libraries from PlatformIO Library Registry
|
||||
# http://platformio.org/#!/lib/show/416/TinyGPS
|
||||
# http://platformio.org/#!/lib/show/417/SPI4Teensy3
|
||||
- platformio lib install 416 417
|
||||
|
||||
script:
|
||||
- platformio ci --board=uno --board=teensy31 --board=due --lib="."
|
||||
|
||||
* Configuration file: https://github.com/felis/USB_Host_Shield_2.0/blob/master/.travis.yml
|
||||
* Build History: https://travis-ci.org/felis/USB_Host_Shield_2.0
|
||||
@@ -36,44 +36,60 @@ In other words, ``CI=true`` automatically setup
|
||||
PLATFORMIO_HOME_DIR
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to override :ref:`projectconf` option
|
||||
:ref:`projectconf_pio_home_dir`.
|
||||
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_home_dir`.
|
||||
|
||||
.. _envvar_PLATFORMIO_LIB_DIR:
|
||||
|
||||
PLATFORMIO_LIB_DIR
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to override :ref:`projectconf` option
|
||||
:ref:`projectconf_pio_lib_dir`.
|
||||
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_lib_dir`.
|
||||
|
||||
.. _envvar_PLATFORMIO_SRC_DIR:
|
||||
|
||||
PLATFORMIO_SRC_DIR
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to override :ref:`projectconf` option
|
||||
:ref:`projectconf_pio_src_dir`.
|
||||
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_src_dir`.
|
||||
|
||||
.. _envvar_PLATFORMIO_ENVS_DIR:
|
||||
|
||||
PLATFORMIO_ENVS_DIR
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to override :ref:`projectconf` option
|
||||
:ref:`projectconf_pio_envs_dir`.
|
||||
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_envs_dir`.
|
||||
|
||||
|
||||
Builder
|
||||
-------
|
||||
|
||||
.. _envvar_PLATFORMIO_SRCBUILD_FLAGS:
|
||||
.. _envvar_PLATFORMIO_BUILD_FLAGS:
|
||||
|
||||
PLATFORMIO_SRCBUILD_FLAGS
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
PLATFORMIO_BUILD_FLAGS
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to override :ref:`projectconf` option
|
||||
:ref:`projectconf_srcbuild_flags`.
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_build_flags`.
|
||||
|
||||
.. _envvar_PLATFORMIO_SRC_BUILD_FLAGS:
|
||||
|
||||
PLATFORMIO_SRC_BUILD_FLAGS
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_src_build_flags`.
|
||||
|
||||
.. _envvar_PLATFORMIO_SRC_FILTER:
|
||||
|
||||
PLATFORMIO_SRC_FILTER
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_src_filter`.
|
||||
|
||||
.. _envvar_PLATFORMIO_EXTRA_SCRIPT:
|
||||
|
||||
PLATFORMIO_EXTRA_SCRIPT
|
||||
~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_extra_script`.
|
||||
|
||||
Settings
|
||||
--------
|
||||
|
||||
@@ -69,6 +69,7 @@ If you are going to run *PlatformIO* from **subprocess**, you **MUST
|
||||
DISABLE** all prompts. It will allow you to avoid blocking.
|
||||
There are a few options:
|
||||
|
||||
- using :option:`platformio --force` option before each command
|
||||
- using environment variable :ref:`PLATFORMIO_SETTING_ENABLE_PROMPTS=No <envvar_PLATFORMIO_SETTING_ENABLE_PROMPTS>`
|
||||
- disable global setting ``enable_prompts`` via :ref:`cmd_settings` command
|
||||
- masking under Continuous Integration system via environment variable
|
||||
@@ -87,7 +88,7 @@ Answered in `issue #144 <https://github.com/platformio/platformio/issues/144#iss
|
||||
|
||||
|
||||
PlatformIO: command not found || An error ``pkg_resources.DistributionNotFound``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Please upgrade *SetupTools* package:
|
||||
|
||||
@@ -99,3 +100,9 @@ Please upgrade *SetupTools* package:
|
||||
# Then re-install PlatformIO
|
||||
$ [sudo] pip uninstall platformio
|
||||
$ [sudo] pip install platformio
|
||||
|
||||
ARM toolchain: ``cc1plus: error while loading shared libraries``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
See related answers for
|
||||
`error while loading shared libraries <https://github.com/platformio/platformio/issues?utf8=✓&q=error+while+loading+shared+libraries>`_.
|
||||
|
||||
@@ -923,8 +923,8 @@ TinyCircuits
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
WickedDevice
|
||||
~~~~~~~~~~~~
|
||||
Wicked Device
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
@@ -937,14 +937,14 @@ WickedDevice
|
||||
- RAM
|
||||
|
||||
* - ``wildfirev2``
|
||||
- `WickedDevice WildFire v2 [stk500] <http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup>`_
|
||||
- `Wicked Device WildFire V2 <http://shop.wickeddevice.com/resources/wildfire/>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
- 16 Kb
|
||||
|
||||
* - ``wildfirev3``
|
||||
- `WickedDevice WildFire v3 [optiboot] <http://shop.wickeddevice.com/resources/wildfire/>`_
|
||||
- `Wicked Device WildFire V3 <http://shop.wickeddevice.com/resources/wildfire/>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
|
||||
@@ -27,6 +27,40 @@ Boards
|
||||
`PlatformIO Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
* For more detailed ``board`` information please scroll tables below by horizontal.
|
||||
|
||||
Armstrap
|
||||
~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``armstrap_eagle1024``
|
||||
- `Armstrap Eagle 1024 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F417VGT6
|
||||
- 168 MHz
|
||||
- 1024 Kb
|
||||
- 192 Kb
|
||||
|
||||
* - ``armstrap_eagle2048``
|
||||
- `Armstrap Eagle 2048 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F427VIT6
|
||||
- 168 MHz
|
||||
- 2048 Kb
|
||||
- 256 Kb
|
||||
|
||||
* - ``armstrap_eagle512``
|
||||
- `Armstrap Eagle 512 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F407VET6
|
||||
- 168 MHz
|
||||
- 512 Kb
|
||||
- 192 Kb
|
||||
|
||||
ST
|
||||
~~
|
||||
|
||||
|
||||
@@ -25,6 +25,9 @@ Platforms
|
||||
* - :ref:`platform_nxplpc`
|
||||
- The NXP LPC is a family of 32-bit microcontroller integrated circuits by NXP Semiconductors. The LPC chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Internally, each microcontroller consists of the processor core, static RAM memory, flash memory, debugging interface, and various peripherals.
|
||||
|
||||
* - :ref:`platform_siliconlabsefm32`
|
||||
- Silicon Labs EFM32 Gecko 32-bit microcontroller (MCU) family includes devices that offer flash memory configurations up to 256 kB, 32 kB of RAM and CPU speeds up to 48 MHz. Based on the powerful ARM Cortex-M core, the Gecko family features innovative low energy techniques, short wake-up time from energy saving modes and a wide selection of peripherals, making it ideal for battery operated applications and other systems requiring high performance and low-energy consumption.
|
||||
|
||||
* - :ref:`platform_ststm32`
|
||||
- The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development.
|
||||
|
||||
@@ -56,6 +59,26 @@ CQ Publishing
|
||||
- 64 Kb
|
||||
- 10 Kb
|
||||
|
||||
Delta
|
||||
~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``dfcm_nnn40``
|
||||
- `Delta DFCM-NNN40 <https://developer.mbed.org/platforms/Delta-DFCM-NNN40/>`_
|
||||
- NRF51822
|
||||
- 32 MHz
|
||||
- 256 Kb
|
||||
- 32 Kb
|
||||
|
||||
Embedded Artists
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -342,11 +365,11 @@ ST
|
||||
- 48 Kb
|
||||
|
||||
* - ``disco_f334c8``
|
||||
- `ST 32F3348DISCOVERY <http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF260318>`_
|
||||
- `ST 32F3348DISCOVERY <http://www.st.com/web/en/catalog/tools/PF260318>`_
|
||||
- STM32F334C8T6
|
||||
- 72 MHz
|
||||
- 64 Kb
|
||||
- 16 Kb
|
||||
- 12 Kb
|
||||
|
||||
* - ``disco_f401vc``
|
||||
- `ST 32F401CDISCOVERY <http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF259098>`_
|
||||
@@ -369,6 +392,13 @@ ST
|
||||
- 2048 Kb
|
||||
- 256 Kb
|
||||
|
||||
* - ``disco_l053c8``
|
||||
- `ST 32L0538DISCOVERY <http://www.st.com/web/en/catalog/tools/PF260319>`_
|
||||
- STM32L053C8T6
|
||||
- 32 MHz
|
||||
- 64 Kb
|
||||
- 8 Kb
|
||||
|
||||
* - ``nucleo_f030r8``
|
||||
- `ST Nucleo F030R8 <https://developer.mbed.org/platforms/ST-Nucleo-F030R8/>`_
|
||||
- STM32F030R8T6
|
||||
@@ -480,6 +510,54 @@ SeeedStudio
|
||||
- 512 Kb
|
||||
- 32 Kb
|
||||
|
||||
Silicon Labs
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``efm32gg_stk3700``
|
||||
- `Silicon Labs EFM32GG-STK3700 (Giant Gecko) <https://developer.mbed.org/platforms/EFM32-Giant-Gecko/>`_
|
||||
- EFM32GG990F1024
|
||||
- 48 MHz
|
||||
- 1024 Kb
|
||||
- 128 Kb
|
||||
|
||||
* - ``efm32hg_stk3400``
|
||||
- `Silicon Labs SLSTK3400A USB-enabled (Happy Gecko) <https://developer.mbed.org/platforms/EFM32-Happy-Gecko/>`_
|
||||
- EFM32HG322F64
|
||||
- 24 MHz
|
||||
- 64 Kb
|
||||
- 8 Kb
|
||||
|
||||
* - ``efm32lg_stk3600``
|
||||
- `Silicon Labs EFM32LG-STK3600 (Leopard Gecko) <https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/>`_
|
||||
- EFM32LG990F256
|
||||
- 48 MHz
|
||||
- 256 Kb
|
||||
- 32 Kb
|
||||
|
||||
* - ``efm32wg_stk3800``
|
||||
- `Silicon Labs EFM32WG-STK3800 (Wonder Gecko) <https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/>`_
|
||||
- EFM32WG990F256
|
||||
- 48 MHz
|
||||
- 256 Kb
|
||||
- 32 Kb
|
||||
|
||||
* - ``efm32zg_stk3200``
|
||||
- `Silicon Labs EFM32ZG-STK3200 (Zero Gecko) <https://developer.mbed.org/platforms/EFM32-Zero-Gecko/>`_
|
||||
- EFM2ZG222F32
|
||||
- 24 MHz
|
||||
- 32 Kb
|
||||
- 4 Kb
|
||||
|
||||
Solder Splash Labs
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -527,6 +605,26 @@ Switch Science
|
||||
- 32 Kb
|
||||
- 4 Kb
|
||||
|
||||
Teensy
|
||||
~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``teensy31``
|
||||
- `Teensy 3.1 <https://www.pjrc.com/store/teensy31.html>`_
|
||||
- MK20DX256
|
||||
- 72 MHz
|
||||
- 256 Kb
|
||||
- 64 Kb
|
||||
|
||||
u-blox
|
||||
~~~~~~
|
||||
|
||||
|
||||
@@ -27,6 +27,40 @@ Boards
|
||||
`PlatformIO Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
* For more detailed ``board`` information please scroll tables below by horizontal.
|
||||
|
||||
Armstrap
|
||||
~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``armstrap_eagle1024``
|
||||
- `Armstrap Eagle 1024 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F417VGT6
|
||||
- 168 MHz
|
||||
- 1024 Kb
|
||||
- 192 Kb
|
||||
|
||||
* - ``armstrap_eagle2048``
|
||||
- `Armstrap Eagle 2048 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F427VIT6
|
||||
- 168 MHz
|
||||
- 2048 Kb
|
||||
- 256 Kb
|
||||
|
||||
* - ``armstrap_eagle512``
|
||||
- `Armstrap Eagle 512 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F407VET6
|
||||
- 168 MHz
|
||||
- 512 Kb
|
||||
- 192 Kb
|
||||
|
||||
ST
|
||||
~~
|
||||
|
||||
|
||||
@@ -15,15 +15,35 @@ registers, and disassembly viewers.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all availalbe :ref:`platforms`
|
||||
* all availalbe :ref:`frameworks`
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `CDT Documentation <https://eclipse.org/cdt/documentation.php>`_
|
||||
page for more detailed information.
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Project Generator
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Since PlatformIO 2.0 you can generate Eclipse compatible project using
|
||||
:option:`platformio init --ide` command. Please choose board type using
|
||||
:ref:`cmd_boards` command and run:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
platformio init --ide eclipse --board %TYPE%
|
||||
|
||||
Then import this project via ``File > Import... > General > Existing Projects
|
||||
into Workspace > Next`` and specify root directory where is located
|
||||
:ref:`projectconf`.
|
||||
|
||||
Manual Integration
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
More detailed information is located in PlatformIO blog: `Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO <http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio>`_.
|
||||
|
||||
`More examples (TI MSP430, TI TIVA, etc.) <https://github.com/platformio/platformio/tree/develop/examples/ide-eclipse>`_
|
||||
@@ -32,4 +52,4 @@ Screenshot
|
||||
----------
|
||||
|
||||
.. image:: ../_static/ide-platformio-eclipse.png
|
||||
:target: http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using- eclipse-ideplatformio
|
||||
:target: http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio
|
||||
|
||||
@@ -7,10 +7,10 @@ The `Qt Creator <https://github.com/qtproject/qt-creator>`_ is an open source cr
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all availalbe :ref:`platforms`
|
||||
* all availalbe :ref:`frameworks`
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `Sublime Text Documentation <http://doc.qt.io/qtcreator/>`_
|
||||
Refer to the `Qt-creator Manual <http://doc.qt.io/qtcreator/>`_
|
||||
page for more detailed information.
|
||||
|
||||
.. contents::
|
||||
@@ -18,22 +18,46 @@ page for more detailed information.
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Setup New Project
|
||||
Project Generator
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
First of all, let's create new project from Qt Creator Start Page: ``New Project`` or using ``Menu: File → New File or Project``, then select project with ``Empty Qt Project`` type (``Other Project → Empty Qt Project``), fill ``Name``, ``Create in``.
|
||||
Since PlatformIO 2.0 you can generate Qt Creator compatible project using
|
||||
:option:`platformio init --ide` command. Please choose board type using
|
||||
:ref:`cmd_boards` command and run:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
platformio init --ide qtcreator --board %TYPE%
|
||||
|
||||
Then import this project via ``File > New File or Project > Import Project``
|
||||
and specify root directory where is located :ref:`projectconf`.
|
||||
|
||||
After import, we need to delete default build and clean steps and configure project with PlatformIO source code builder (click on Projects label on left menu or ``Ctrl+5`` shortcut):
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-3.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png
|
||||
|
||||
Manual Integration
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Setup New Project
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
First of all, let's create new project from Qt Creator Start Page: ``New Project`` or using ``Menu: File > New File or Project``, then select project with ``Empty Qt Project`` type (``Other Project > Empty Qt Project``), fill ``Name``, ``Create in``.
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-1.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-1.png
|
||||
|
||||
On the next steps select any available kit and click Finish button.
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-2.png
|
||||
|
||||
Secondly, we need to configure project with PlatformIO source code builder (click on Projects label on left menu or ``Ctrl+5`` shortcut):
|
||||
Secondly, we need to delete default build and clean steps and configure project with PlatformIO source code builder (click on Projects label on left menu or ``Ctrl+5`` shortcut):
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-3.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png
|
||||
|
||||
Thirdly, we need to add directories with header files using project file. Please fill this file with the next contents:
|
||||
Thirdly, change project file by adding path to directories with header files. Please edit project file to match the following contents:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
@@ -41,25 +65,25 @@ Thirdly, we need to add directories with header files using project file. Please
|
||||
HOMEDIR += $$(USERPROFILE)
|
||||
}
|
||||
else {
|
||||
HOMEDIR += $$(PWD)
|
||||
HOMEDIR += $$(HOME)
|
||||
}
|
||||
|
||||
INCLUDEPATH += "$$HOMEDIR/.platformio/packages/framework-arduinoavr/cores/arduino"
|
||||
INCLUDEPATH += "$$HOMEDIR/.platformio/packages/toolchain-atmelavr/avr/include"
|
||||
|
||||
win32:INCLUDEPATH ~= s,/,\\,g
|
||||
INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/framework-arduinoavr/cores/arduino"
|
||||
INCLUDEPATH += "$${HOMEDIR}/.platformio/packages/toolchain-atmelavr/avr/include"
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-4.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-4.png
|
||||
|
||||
First program in Qt Creator
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Simple "Blink" project will consist from two files:
|
||||
|
||||
1. Main "C" source file named ``main.c`` must be located in the ``src`` directory.
|
||||
Let's create new text file named ``main.c`` using ``Menu: New File or Project → General → Text File``:
|
||||
1. In the console, navigate to the root of your project folder and initialize platformio project with ``platformio init``
|
||||
2. The main "C" source file named ``main.c`` must be located in the ``src`` directory.
|
||||
Let's create new text file named ``main.c`` using ``Menu: New File or Project > General > Text File``:
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-5.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-5.png
|
||||
|
||||
Copy the source code which is described below to file ``main.c``.
|
||||
|
||||
@@ -81,11 +105,12 @@ Copy the source code which is described below to file ``main.c``.
|
||||
delay(1000); // wait for a second
|
||||
}
|
||||
|
||||
2. Project Configuration File named ``platformio.ini`` must be located in the project root directory.
|
||||
3. Locate the project configuration file named ``platformio.ini`` at the root of the project directory and open it.
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-6.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-6.png
|
||||
|
||||
Copy the source code which is described below to it.
|
||||
Edit the content to match the code described below.
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
@@ -108,6 +133,8 @@ Copy the source code which is described below to it.
|
||||
Conclusion
|
||||
----------
|
||||
|
||||
Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build → Build All``:
|
||||
Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build > Build All``:
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-7.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-7.png
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ The `Sublime Text <http://www.sublimetext.com/>`_ is a cross-platform text and s
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all availalbe :ref:`platforms`
|
||||
* all availalbe :ref:`frameworks`
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `Sublime Text Documentation <http://docs.sublimetext.info/en/latest>`_
|
||||
page for more detailed information.
|
||||
@@ -18,27 +18,44 @@ page for more detailed information.
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Project Generator
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Since PlatformIO 2.0 you can generate Sublime Text compatible project using
|
||||
:option:`platformio init --ide` command. Please choose board type using
|
||||
:ref:`cmd_boards` command and run:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
platformio init --ide sublimetext --board %TYPE%
|
||||
|
||||
Then import this project via ``Project > Open Project...`` and specify root
|
||||
directory where is located :ref:`projectconf`.
|
||||
|
||||
Manual Integration
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Initial configuration
|
||||
^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
First of all, we need to create "New Build System" with name "PlatformIO"
|
||||
from ``Menu: Tools → Build System → New Build System`` and fill it like
|
||||
from ``Menu: Tools > Build System > New Build System`` and fill it like
|
||||
described below:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
{
|
||||
"cmd": ["platformio", "run"],
|
||||
"cmd": ["platformio", "--force", "run"],
|
||||
"working_dir": "${project_path:${folder}}",
|
||||
"variants":
|
||||
[
|
||||
{
|
||||
"name": "Clean",
|
||||
"cmd": ["platformio", "run", "-t", "clean"]
|
||||
"cmd": ["platformio", "--force", "run", "--target", "clean"]
|
||||
},
|
||||
{
|
||||
"name": "Upload",
|
||||
"cmd": ["platformio", "run", "-t", "upload"]
|
||||
"cmd": ["platformio", "--force", "run", "--target", "upload"]
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -48,16 +65,16 @@ Secondly, we need to select "PlatformIO" Build System from a list:
|
||||
.. image:: ../_static/ide-sublime-text-platformio-newproject-2.png
|
||||
|
||||
After that, we can use the necessary commands from
|
||||
``Menu: Tools → Command Palette`` or with ``Ctrl+Shift+P`` (Windows/Linux)
|
||||
``Menu: Tools > Command Palette`` or with ``Ctrl+Shift+P`` (Windows/Linux)
|
||||
``Cmd+Shift+P`` (Mac) shortcut.
|
||||
|
||||
.. image:: ../_static/ide-sublime-text-platformio-newproject-3.png
|
||||
|
||||
Command Hotkeys
|
||||
~~~~~~~~~~~~~~~
|
||||
'''''''''''''''
|
||||
|
||||
Sublime Text allows to bind own hotkey per command. Let's setup them
|
||||
for PlatformIO commands using shortcut ``Menu: Preferences → Key-Bindings - User``:
|
||||
for PlatformIO commands using shortcut ``Menu: Preferences > Key-Bindings - User``:
|
||||
|
||||
.. image:: ../_static/ide-sublime-text-platformio-newproject-4.png
|
||||
|
||||
@@ -76,12 +93,12 @@ In this case, the final code will look like:
|
||||
]
|
||||
|
||||
First program in Sublime Text
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Simple "Blink" project will consist from two files:
|
||||
|
||||
1. Main "C" source file named ``main.c`` must be located in the ``src`` directory.
|
||||
Let's create new file named ``main.c`` using ``Menu: File → New File`` or shortcut ``Ctrl+N`` (Windows/Linux) ``Cmd+N`` (Mac) with the next contents:
|
||||
Let's create new file named ``main.c`` using ``Menu: File > New File`` or shortcut ``Ctrl+N`` (Windows/Linux) ``Cmd+N`` (Mac) with the next contents:
|
||||
|
||||
.. code-block:: c
|
||||
|
||||
@@ -124,6 +141,6 @@ Copy the source code which is described below to it.
|
||||
Conclusion
|
||||
----------
|
||||
|
||||
Taking everything into account, we can open project directory in Sublime Text using ``Menu: File → Open Folder`` and build it with shortcut ``Ctrl+B`` (Windows/Linux) or ``Cmd+B`` (Mac), clean project with shortcut ``F11`` and upload firmware to target with shortcut ``F12``.
|
||||
Taking everything into account, we can open project directory in Sublime Text using ``Menu: File > Open Folder`` and build it with shortcut ``Ctrl+B`` (Windows/Linux) or ``Cmd+B`` (Mac), clean project with shortcut ``F11`` and upload firmware to target with shortcut ``F12``.
|
||||
|
||||
.. image:: ../_static/ide-sublime-text-platformio-newproject-5.png
|
||||
|
||||
@@ -9,8 +9,8 @@ standalone application in a graphical user interface.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all availalbe :ref:`platforms`
|
||||
* all availalbe :ref:`frameworks`
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Integration
|
||||
-----------
|
||||
@@ -30,10 +30,10 @@ Put to the project directory ``Makefile`` wrapper with contents:
|
||||
#PATH := /usr/local/bin:$(PATH)
|
||||
|
||||
all:
|
||||
platformio run -t upload
|
||||
platformio --force run --target upload
|
||||
|
||||
clean:
|
||||
platformio run -t clean
|
||||
platformio --force run --target clean
|
||||
|
||||
|
||||
Now, in VIM ``cd /path/to/this/project`` and press ``Ctrl+B`` or ``Cmd+B``
|
||||
|
||||
@@ -7,8 +7,8 @@ The `Microsoft Visual Studio (Free) <http://visualstudio.com/free>`_ is an integ
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all availalbe :ref:`platforms`
|
||||
* all availalbe :ref:`frameworks`
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `Visual Studio Documentation <https://msdn.microsoft.com/library/vstudio>`_
|
||||
page for more detailed information.
|
||||
@@ -18,10 +18,27 @@ page for more detailed information.
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Setup New Project
|
||||
Project Generator
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
First of all, let's create new project from Visual Studio Start Page: ``Start → New Project`` or using ``Menu: File → New → Project``, then select project with ``Makefile`` type (``Visual C++ → General → Makefile Project``), fill ``Project name``, ``Solution name``, ``Location`` fields and press OK button.
|
||||
Since PlatformIO 2.0 you can generate Visual Studio compatible project using
|
||||
:option:`platformio init --ide` command. Please choose board type using
|
||||
:ref:`cmd_boards` command and run:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
platformio init --ide visualstudio --board %TYPE%
|
||||
|
||||
Then import this project via ``File->Open->Project/Solution`` and specify root
|
||||
directory where is located :ref:`projectconf`.
|
||||
|
||||
Manual Integration
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
Setup New Project
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
First of all, let's create new project from Visual Studio Start Page: ``Start > New Project`` or using ``Menu: File > New > Project``, then select project with ``Makefile`` type (``Visual C++ > General > Makefile Project``), fill ``Project name``, ``Solution name``, ``Location`` fields and press OK button.
|
||||
|
||||
.. image:: ../_static/ide-vs-platformio-newproject.png
|
||||
|
||||
@@ -37,7 +54,7 @@ Release Configuration is the same as Debug, so on the next step we check "Same a
|
||||
|
||||
.. image:: ../_static/ide-vs-platformio-newproject-3.png
|
||||
|
||||
Thirdly, we need to add directories with header files using project properties (right click on the project name or ``Alt-Enter`` shortcut) and add two directories to ``Configuration Properties → NMake → Include Search Path``:
|
||||
Thirdly, we need to add directories with header files using project properties (right click on the project name or ``Alt-Enter`` shortcut) and add two directories to ``Configuration Properties > NMake > Include Search Path``:
|
||||
|
||||
.. code-block:: none
|
||||
|
||||
@@ -47,12 +64,12 @@ Thirdly, we need to add directories with header files using project properties (
|
||||
.. image:: ../_static/ide-vs-platformio-newproject-5.png
|
||||
|
||||
First program in Visual Studio
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Simple "Blink" project will consist from two files:
|
||||
|
||||
1. Main "C" source file named ``main.c`` must be located in the ``src`` directory.
|
||||
Let's create new file named ``main.c`` using ``Menu: File → New File`` or shortcut ``Ctrl+N``:
|
||||
Let's create new file named ``main.c`` using ``Menu: File > New File`` or shortcut ``Ctrl+N``:
|
||||
|
||||
.. image:: ../_static/ide-vs-platformio-newproject-6.png
|
||||
|
||||
@@ -103,6 +120,7 @@ Copy the source code which is described below to it.
|
||||
Conclusion
|
||||
----------
|
||||
|
||||
Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build → Build Solution``:
|
||||
Taking everything into account, we can build project with shortcut ``Ctrl+Shift+B`` or using ``Menu: Build > Build Solution``:
|
||||
|
||||
.. image:: ../_static/ide-vs-platformio-newproject-8.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-vs-platformio-newproject-8.png
|
||||
|
||||
@@ -1,8 +1,12 @@
|
||||
PlatformIO: A cross-platform code builder and the missing library manager
|
||||
=========================================================================
|
||||
PlatformIO is a cross-platform code builder and the missing library manager
|
||||
===========================================================================
|
||||
|
||||
*Atmel AVR & SAM, Freescale Kinetis, Nordic nRF51, NXP LPC, ST STM32,
|
||||
TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc.*
|
||||
**Ready for embedded development, IDE and Continuous integration, Arduino and
|
||||
MBED compatible**
|
||||
|
||||
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
|
||||
Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed,
|
||||
libOpenCM3, etc.*
|
||||
|
||||
.. image:: _static/platformio-logo.png
|
||||
:target: http://platformio.org
|
||||
@@ -26,10 +30,13 @@ Embedded Development. *Easier Than Ever.*
|
||||
-----------------------------------------
|
||||
|
||||
* Colourful command-line output
|
||||
* Built-in :ref:`Serial Port Monitor <cmd_serialports_monitor>`
|
||||
* Configurable build :ref:`-flags/-options <projectconf_build_flags>`
|
||||
* Integration with :ref:`development environments (IDE) <ide>`
|
||||
* Pre-built tool chains, :ref:`frameworks` for the popular Hardware Platforms
|
||||
* :ref:`IDE Integration <ide>` with *Arduino, Eclipse, Energia, Qt Creator,
|
||||
Sublime Text, Vim, Visual Studio*
|
||||
* :ref:`ci` with *AppVeyor, Circle CI, Drone, Shippable, Travis CI*
|
||||
* Built-in :ref:`Serial Port Monitor <cmd_serialports_monitor>` and
|
||||
configurable build :ref:`-flags/-options <projectconf_build_flags>`
|
||||
* Pre-built tool chains, :ref:`frameworks` for the
|
||||
:ref:`Development Platforms <platforms>`
|
||||
|
||||
Smart Code Builder. *Fast and Reliable.*
|
||||
----------------------------------------
|
||||
@@ -63,6 +70,7 @@ Contents
|
||||
frameworks/index
|
||||
librarymanager/index
|
||||
userguide/index
|
||||
ci/index
|
||||
ide
|
||||
articles
|
||||
FAQ <faq>
|
||||
|
||||
@@ -122,18 +122,12 @@ Development Version
|
||||
.. warning::
|
||||
We don't recommend to use ``develop`` version in production.
|
||||
|
||||
1. If you had have already installed PlatformIO, please uninstall it:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ pip uninstall platformio
|
||||
|
||||
2. Install the latest PlatformIO from the ``develop`` branch:
|
||||
Install the latest PlatformIO from the ``develop`` branch:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ pip install https://github.com/platformio/platformio/archive/develop.zip
|
||||
|
||||
If you want to be up-to-date with the latest ``develop`` version of PlatformIO,
|
||||
then you need to perform step #2 each time if you see the new commits in
|
||||
`PlatformIO GitHub repository <https://github.com/platformio/platformio/commits/develop>`_.
|
||||
then you need to re-install PlatformIO each time if you see the new commits in
|
||||
`PlatformIO GitHub repository (branch: develop) <https://github.com/platformio/platformio/commits/develop>`_.
|
||||
|
||||
@@ -249,6 +249,12 @@ patterns.
|
||||
A list with compatible frameworks. The available framework types are defined in
|
||||
the :ref:`platforms` section.
|
||||
|
||||
If the library is compatible with the all frameworks, then you can use ``*``
|
||||
symbol:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
"frameworks": "*"
|
||||
|
||||
.. _libjson_platforms:
|
||||
|
||||
@@ -260,6 +266,13 @@ the :ref:`platforms` section.
|
||||
A list with compatible platforms. The available platform types are
|
||||
defined in :ref:`platforms` section.
|
||||
|
||||
If the library is compatible with the all platforms, then you can use ``*``
|
||||
symbol:
|
||||
|
||||
.. code-block:: javascript
|
||||
|
||||
"platforms": "*"
|
||||
|
||||
|
||||
.. _libjson_dependencies:
|
||||
|
||||
|
||||
@@ -134,3 +134,4 @@ The registration requirements:
|
||||
|
||||
Now, you can :ref:`register <cmd_lib_register>` your library and allow others
|
||||
to :ref:`install <cmd_lib_install>` it.
|
||||
|
||||
|
||||
@@ -8,8 +8,10 @@ Library Manager
|
||||
*"The missing library manager for development platforms"* [#]_
|
||||
|
||||
*PlatformIO Library Manager* allows you to organize external embedded libraries.
|
||||
You can search for new libraries via :ref:`Command Line interface <cmd_lib_search>`
|
||||
or `Web 2.0 Library Search <http://platformio.org/#!/lib>`_.
|
||||
You can search for new libraries via
|
||||
|
||||
* :ref:`Command Line interface <cmd_lib_search>`
|
||||
* `Web 2.0 Library Search <http://platformio.org/#!/lib>`_
|
||||
|
||||
You don't need to bother for finding the latest version of library. Due to
|
||||
:ref:`cmd_lib_update` command you will have up-to-date external libraries.
|
||||
|
||||
@@ -816,8 +816,8 @@ TinyCircuits
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
WickedDevice
|
||||
~~~~~~~~~~~~
|
||||
Wicked Device
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
@@ -830,14 +830,14 @@ WickedDevice
|
||||
- RAM
|
||||
|
||||
* - ``wildfirev2``
|
||||
- `WickedDevice WildFire v2 [stk500] <http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup>`_
|
||||
- `Wicked Device WildFire V2 <http://shop.wickeddevice.com/resources/wildfire/>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
- 16 Kb
|
||||
|
||||
* - ``wildfirev3``
|
||||
- `WickedDevice WildFire v3 [optiboot] <http://shop.wickeddevice.com/resources/wildfire/>`_
|
||||
- `Wicked Device WildFire V3 <http://shop.wickeddevice.com/resources/wildfire/>`_
|
||||
- ATMEGA1284P
|
||||
- 16 MHz
|
||||
- 128 Kb
|
||||
|
||||
62
docs/platforms/creating_board.rst
Normal file
@@ -0,0 +1,62 @@
|
||||
.. _board_creating:
|
||||
|
||||
Creating Board
|
||||
==============
|
||||
|
||||
*PlatformIO* has pre-built settings for the most popular embedded boards. This
|
||||
list is available:
|
||||
|
||||
* `Embedded Boards Explorer <http://platformio.org/#!/boards>`_ (Web)
|
||||
* :ref:`cmd_boards` (CLI command)
|
||||
|
||||
Nevertheless, PlatformIO allows to create own board or override existing
|
||||
board's settings. All data is declared using
|
||||
`JSON-style <http://en.wikipedia.org/wiki/JSON>`_ via
|
||||
`associative array <http://en.wikipedia.org/wiki/Associative_array>`_
|
||||
(name/value pairs).
|
||||
|
||||
.. contents::
|
||||
|
||||
JSON Structure
|
||||
--------------
|
||||
|
||||
The key fields:
|
||||
|
||||
* ``build`` data will be used by :ref:`Platforms <platforms>` and
|
||||
:ref:`frameworks` builders
|
||||
* ``frameworks`` is the list with supported :ref:`frameworks`
|
||||
* ``platform`` main type of :ref:`Platforms <platforms>`
|
||||
* ``upload`` upload settings which depend on the ``platform``
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"myboard": {
|
||||
"build": {},
|
||||
"frameworks": ["%LIST_WITH_SUPPORTED_FRAMEWORKS%"],
|
||||
"name": "My test board",
|
||||
"platform": "%PLATFORM_TYPE_HERE%",
|
||||
"upload": {},
|
||||
"url": "http://example.com",
|
||||
"vendor": "My Company Ltd."
|
||||
}
|
||||
}
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
1. Create ``boards`` directory in :ref:`projectconf_pio_home_dir` if it
|
||||
doesn't exist.
|
||||
2. Create ``my_own_boards.json`` file and put to ``boards`` directory.
|
||||
3. Search available boards via :ref:`cmd_boards` command. You should see
|
||||
``myboard`` board.
|
||||
|
||||
Now, you can use ``myboard`` for the :ref:`projectconf_env_board` option in
|
||||
:ref:`projectconf`.
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
For the examples, please look into built-in ``*.json`` files with boards
|
||||
settings: https://github.com/platformio/platformio/tree/develop/platformio/boards.
|
||||
@@ -292,11 +292,126 @@ Installation
|
||||
------------
|
||||
|
||||
1. Create ``platforms`` directory in :ref:`projectconf_pio_home_dir` if it
|
||||
doesn't exists.
|
||||
doesn't exist.
|
||||
2. Copy ``test.py`` and ``test-builder.py`` files to ``platforms`` directory.
|
||||
3. Search available platforms via :ref:`cmd_search` command. You should see
|
||||
3. Search available platforms via :ref:`cmd_platforms_search` command. You should see
|
||||
``test`` platform.
|
||||
4. Install ``test`` platform via :ref:`cmd_install` command.
|
||||
4. Install ``test`` platform via :ref:`cmd_platforms_install` command.
|
||||
|
||||
Now, you can use ``test`` for the :ref:`projectconf_env_platform` option in
|
||||
:ref:`projectconf`.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
Let's use the real example which was requested by our user in `issue 175 <https://github.com/platformio/platformio/issues/175>`_. Need to add support for uploading firmware using GDB to
|
||||
:ref:`platform_ststm32`.
|
||||
|
||||
First of all, need to create new folder ``platforms`` in :ref:`projectconf_pio_home_dir`
|
||||
and copy there two files:
|
||||
|
||||
1. Platform manifest file ``ststm32gdb.py`` with the next content:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import os
|
||||
|
||||
from platformio.platforms.ststm32 import Ststm32Platform
|
||||
|
||||
|
||||
class Ststm32gdbPlatform(Ststm32Platform):
|
||||
|
||||
"""
|
||||
ST STM32 using GDB as uploader
|
||||
|
||||
http://www.st.com/web/en/catalog/mmc/FM141/SC1169?sc=stm32
|
||||
"""
|
||||
|
||||
def get_build_script(self):
|
||||
|
||||
return os.path.join(
|
||||
os.path.dirname(os.path.realpath(__file__)),
|
||||
"ststm32gdb-builder.py"
|
||||
)
|
||||
|
||||
2. Build script file ``ststm32gdb-builder.py`` with the next content:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
"""
|
||||
Builder for ST STM32 Series ARM microcontrollers with GDB upload.
|
||||
"""
|
||||
|
||||
from os.path import join
|
||||
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
|
||||
DefaultEnvironment, SConscript)
|
||||
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
||||
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
|
||||
|
||||
env.Replace(
|
||||
UPLOADER=join(
|
||||
"$PIOPACKAGES_DIR", "toolchain-gccarmnoneeabi",
|
||||
"bin", "arm-none-eabi-gdb"
|
||||
),
|
||||
UPLOADERFLAGS=[
|
||||
join("$BUILD_DIR", "firmware.elf"),
|
||||
"-batch",
|
||||
"-x", join("$PROJECT_DIR", "upload.gdb")
|
||||
],
|
||||
|
||||
UPLOADCMD="$UPLOADER $UPLOADERFLAGS"
|
||||
)
|
||||
|
||||
env.Append(
|
||||
CPPDEFINES=[
|
||||
"${BOARD_OPTIONS['build']['variant'].upper()}"
|
||||
],
|
||||
|
||||
LINKFLAGS=[
|
||||
"-nostartfiles",
|
||||
"-nostdlib"
|
||||
]
|
||||
)
|
||||
|
||||
#
|
||||
# Target: Build executable and linkable firmware
|
||||
#
|
||||
|
||||
target_elf = env.BuildFirmware()
|
||||
|
||||
#
|
||||
# Target: Build the .bin file
|
||||
#
|
||||
|
||||
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
target_firm = join("$BUILD_DIR", "firmware.bin")
|
||||
else:
|
||||
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
|
||||
|
||||
#
|
||||
# Target: Print binary size
|
||||
#
|
||||
|
||||
target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD")
|
||||
AlwaysBuild(target_size)
|
||||
|
||||
#
|
||||
# Target: Upload by default .bin file
|
||||
#
|
||||
|
||||
upload = env.Alias(
|
||||
["upload", "uploadlazy"], target_firm, "$UPLOADCMD")
|
||||
AlwaysBuild(upload)
|
||||
|
||||
#
|
||||
# Target: Define targets
|
||||
#
|
||||
|
||||
Default([target_firm, target_size])
|
||||
|
||||
Now, we should see ``ststm32gdb`` platform using :ref:`cmd_platforms_search` command output
|
||||
and can install it via :ref:`platformio platforms install ststm32gdb <cmd_platforms_install>` command.
|
||||
|
||||
@@ -20,8 +20,10 @@ MCU, upload protocol or etc. Please use ``board`` option.
|
||||
freescalekinetis
|
||||
nordicnrf51
|
||||
nxplpc
|
||||
siliconlabsefm32
|
||||
ststm32
|
||||
teensy
|
||||
timsp430
|
||||
titiva
|
||||
creating_platform
|
||||
creating_board
|
||||
|
||||
@@ -49,6 +49,26 @@ Boards
|
||||
* For more detailed ``board`` information please scroll tables below by
|
||||
horizontal.
|
||||
|
||||
Delta
|
||||
~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``dfcm_nnn40``
|
||||
- `Delta DFCM-NNN40 <https://developer.mbed.org/platforms/Delta-DFCM-NNN40/>`_
|
||||
- NRF51822
|
||||
- 32 MHz
|
||||
- 256 Kb
|
||||
- 32 Kb
|
||||
|
||||
JKSoft
|
||||
~~~~~~
|
||||
|
||||
|
||||
98
docs/platforms/siliconlabsefm32.rst
Normal file
@@ -0,0 +1,98 @@
|
||||
.. _platform_siliconlabsefm32:
|
||||
|
||||
Platform ``siliconlabsefm32``
|
||||
=============================
|
||||
Silicon Labs EFM32 Gecko 32-bit microcontroller (MCU) family includes devices that offer flash memory configurations up to 256 kB, 32 kB of RAM and CPU speeds up to 48 MHz. Based on the powerful ARM Cortex-M core, the Gecko family features innovative low energy techniques, short wake-up time from energy saving modes and a wide selection of peripherals, making it ideal for battery operated applications and other systems requiring high performance and low-energy consumption.
|
||||
|
||||
For more detailed information please visit `vendor site <http://www.silabs.com/products/mcu/32-bit/efm32-gecko/Pages/efm32-gecko.aspx>`_.
|
||||
|
||||
.. contents::
|
||||
|
||||
Packages
|
||||
--------
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Contents
|
||||
|
||||
* - ``framework-mbed``
|
||||
- `mbed Framework <http://mbed.org>`_
|
||||
|
||||
* - ``toolchain-gccarmnoneeabi``
|
||||
- `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_
|
||||
|
||||
.. warning::
|
||||
**Linux Users:** Don't forget to install "udev" rules file
|
||||
`99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file).
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
----------
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Name
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_mbed`
|
||||
- The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community.
|
||||
|
||||
Boards
|
||||
------
|
||||
|
||||
.. note::
|
||||
* You can list pre-configured boards by :ref:`cmd_boards` command or
|
||||
`PlatformIO Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
* For more detailed ``board`` information please scroll tables below by
|
||||
horizontal.
|
||||
|
||||
Silicon Labs
|
||||
~~~~~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``efm32gg_stk3700``
|
||||
- `Silicon Labs EFM32GG-STK3700 (Giant Gecko) <https://developer.mbed.org/platforms/EFM32-Giant-Gecko/>`_
|
||||
- EFM32GG990F1024
|
||||
- 48 MHz
|
||||
- 1024 Kb
|
||||
- 128 Kb
|
||||
|
||||
* - ``efm32hg_stk3400``
|
||||
- `Silicon Labs SLSTK3400A USB-enabled (Happy Gecko) <https://developer.mbed.org/platforms/EFM32-Happy-Gecko/>`_
|
||||
- EFM32HG322F64
|
||||
- 24 MHz
|
||||
- 64 Kb
|
||||
- 8 Kb
|
||||
|
||||
* - ``efm32lg_stk3600``
|
||||
- `Silicon Labs EFM32LG-STK3600 (Leopard Gecko) <https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/>`_
|
||||
- EFM32LG990F256
|
||||
- 48 MHz
|
||||
- 256 Kb
|
||||
- 32 Kb
|
||||
|
||||
* - ``efm32wg_stk3800``
|
||||
- `Silicon Labs EFM32WG-STK3800 (Wonder Gecko) <https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/>`_
|
||||
- EFM32WG990F256
|
||||
- 48 MHz
|
||||
- 256 Kb
|
||||
- 32 Kb
|
||||
|
||||
* - ``efm32zg_stk3200``
|
||||
- `Silicon Labs EFM32ZG-STK3200 (Zero Gecko) <https://developer.mbed.org/platforms/EFM32-Zero-Gecko/>`_
|
||||
- EFM2ZG222F32
|
||||
- 24 MHz
|
||||
- 32 Kb
|
||||
- 4 Kb
|
||||
@@ -73,6 +73,40 @@ Boards
|
||||
* For more detailed ``board`` information please scroll tables below by
|
||||
horizontal.
|
||||
|
||||
Armstrap
|
||||
~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller
|
||||
- Frequency
|
||||
- Flash
|
||||
- RAM
|
||||
|
||||
* - ``armstrap_eagle1024``
|
||||
- `Armstrap Eagle 1024 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F417VGT6
|
||||
- 168 MHz
|
||||
- 1024 Kb
|
||||
- 192 Kb
|
||||
|
||||
* - ``armstrap_eagle2048``
|
||||
- `Armstrap Eagle 2048 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F427VIT6
|
||||
- 168 MHz
|
||||
- 2048 Kb
|
||||
- 256 Kb
|
||||
|
||||
* - ``armstrap_eagle512``
|
||||
- `Armstrap Eagle 512 <http://docs.armstrap.org/en/latest/hardware-overview.html>`_
|
||||
- STM32F407VET6
|
||||
- 168 MHz
|
||||
- 512 Kb
|
||||
- 192 Kb
|
||||
|
||||
ST
|
||||
~~
|
||||
|
||||
@@ -108,11 +142,11 @@ ST
|
||||
- 48 Kb
|
||||
|
||||
* - ``disco_f334c8``
|
||||
- `ST 32F3348DISCOVERY <http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF260318>`_
|
||||
- `ST 32F3348DISCOVERY <http://www.st.com/web/en/catalog/tools/PF260318>`_
|
||||
- STM32F334C8T6
|
||||
- 72 MHz
|
||||
- 64 Kb
|
||||
- 16 Kb
|
||||
- 12 Kb
|
||||
|
||||
* - ``disco_f401vc``
|
||||
- `ST 32F401CDISCOVERY <http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF259098>`_
|
||||
@@ -135,6 +169,13 @@ ST
|
||||
- 2048 Kb
|
||||
- 256 Kb
|
||||
|
||||
* - ``disco_l053c8``
|
||||
- `ST 32L0538DISCOVERY <http://www.st.com/web/en/catalog/tools/PF260319>`_
|
||||
- STM32L053C8T6
|
||||
- 32 MHz
|
||||
- 64 Kb
|
||||
- 8 Kb
|
||||
|
||||
* - ``disco_l152rb``
|
||||
- `ST STM32LDISCOVERY <http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF258515>`_
|
||||
- STM32L152RBT6
|
||||
|
||||
@@ -145,7 +145,8 @@ need to specify ``board_mcu``, ``board_f_cpu``, ``upload_protocol`` or
|
||||
``upload_speed`` options. Just define a ``board`` type and *PlatformIO* will
|
||||
pre-fill options described above with appropriate values.
|
||||
|
||||
You can find the ``board`` type in *Boards* section of each :ref:`platforms`.
|
||||
You can find the ``board`` type in *Boards* section of each :ref:`platforms` or
|
||||
using `PlatformIO Embedded Boards Explorer <http://platformio.org/#!/boards>`_.
|
||||
|
||||
|
||||
``board_mcu``
|
||||
@@ -198,20 +199,6 @@ A protocol that "uploader" tool uses to talk to the board.
|
||||
A connection speed (`baud rate <http://en.wikipedia.org/wiki/Baud>`_)
|
||||
which "uploader" tool uses when sending firmware to board.
|
||||
|
||||
|
||||
``targets``
|
||||
^^^^^^^^^^^
|
||||
|
||||
A list with targets which will be processed by :ref:`cmd_run` command by
|
||||
default. You can enter more then one target separated with "space".
|
||||
|
||||
When no targets are defined, *PlatformIO* will build only sources by default.
|
||||
|
||||
.. note::
|
||||
This option is useful to enable "auto-uploading" after building operation
|
||||
(``targets = upload``).
|
||||
|
||||
|
||||
.. _projectconf_build_flags:
|
||||
|
||||
``build_flags``
|
||||
@@ -226,10 +213,6 @@ processes:
|
||||
* - Format
|
||||
- Scope
|
||||
- Description
|
||||
* - ``Wp,option``
|
||||
- CPPFLAGS
|
||||
- Bypass the compiler driver and pass *option* directly through to the
|
||||
preprocessor
|
||||
* - ``-D name``
|
||||
- CPPDEFINES
|
||||
- Predefine *name* as a macro, with definition 1.
|
||||
@@ -241,6 +224,10 @@ processes:
|
||||
- CPPDEFINES
|
||||
- Cancel any previous definition of *name*, either built in or provided
|
||||
with a ``-D`` option.
|
||||
* - ``-Wp,option``
|
||||
- CPPFLAGS
|
||||
- Bypass the compiler driver and pass *option* directly through to the
|
||||
preprocessor
|
||||
* - ``-Wall``
|
||||
- CCFLAGS
|
||||
- Turns on all optional warnings which are desirable for normal code.
|
||||
@@ -254,10 +241,18 @@ processes:
|
||||
- CCFLAGS
|
||||
- Process *file* as if ``#include "file"`` appeared as the first line of
|
||||
the primary source file.
|
||||
* - ``-Idir``
|
||||
- CPPPATH
|
||||
- Add the directory *dir* to the list of directories to be searched
|
||||
for header files.
|
||||
* - ``-Wa,option``
|
||||
- ASFLAGS, CCFLAGS
|
||||
- Pass *option* as an option to the assembler. If *option* contains
|
||||
commas, it is split into multiple options at the commas.
|
||||
* - ``-Wl,option``
|
||||
- LINKFLAGS
|
||||
- Pass *option* as an option to the linker. If *option* contains
|
||||
commas, it is split into multiple options at the commas.
|
||||
* - ``-llibrary``
|
||||
- LIBS
|
||||
- Search the *library* named library when linking
|
||||
@@ -265,21 +260,23 @@ processes:
|
||||
- LIBPATH
|
||||
- Add directory *dir* to the list of directories to be searched for
|
||||
``-l``.
|
||||
* - ``-Idir``
|
||||
- CPPPATH
|
||||
- Add the directory *dir* to the list of directories to be searched
|
||||
for header files.
|
||||
|
||||
This option can be set by global environment variable
|
||||
:ref:`envvar_PLATFORMIO_BUILD_FLAGS`.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[env:specific_defines]
|
||||
build_flags = -O2 -Dfoo -Dbar=1
|
||||
build_flags = -Dfoo -Dbar=1
|
||||
|
||||
[env:specific_inclibs]
|
||||
build_flags = -I/opt/include -L/opt/lib -lfoo
|
||||
|
||||
[env:specific_ld_script]
|
||||
build_flags = -Wl,-T/path/to/ld_script.ld
|
||||
|
||||
|
||||
For more detailed information about available flags/options go to:
|
||||
|
||||
@@ -297,30 +294,163 @@ For more detailed information about available flags/options go to:
|
||||
* `Options for Directory Search
|
||||
<https://gcc.gnu.org/onlinedocs/gcc/Directory-Options.html>`_
|
||||
|
||||
.. _projectconf_srcbuild_flags:
|
||||
.. _projectconf_src_build_flags:
|
||||
|
||||
``srcbuild_flags``
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
``src_build_flags``
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
An option ``srcbuild_flags`` has the same behaviour like ``build_flags``
|
||||
An option ``src_build_flags`` has the same behaviour like ``build_flags``
|
||||
but will be applied only for the project source code from
|
||||
:ref:`projectconf_pio_src_dir` directory.
|
||||
|
||||
This option can be overridden by global environment variable
|
||||
:ref:`envvar_PLATFORMIO_SRCBUILD_FLAGS`.
|
||||
This option can be set by global environment variable
|
||||
:ref:`envvar_PLATFORMIO_SRC_BUILD_FLAGS`.
|
||||
|
||||
``ignore_libs``
|
||||
.. _projectconf_src_filter:
|
||||
|
||||
``src_filter``
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
This option allows to specify which source files should be included/excluded
|
||||
from build process. Filter supports 2 templates:
|
||||
|
||||
* ``+<PATH>`` include template
|
||||
* ``-<PATH>`` exclude template
|
||||
|
||||
``PATH`` MAST BE related from :ref:`projectconf_pio_src_dir`. All patterns will
|
||||
be applied in theirs order.
|
||||
`GLOB Patterns <http://en.wikipedia.org/wiki/Glob_(programming)>`_ are allowed.
|
||||
|
||||
By default, ``src_filter`` is predefined to
|
||||
``+<*> -<.git/> -<svn/> -<examples/>``, which means "includes ALL files, then
|
||||
exclude ``.git`` and ``svn`` repository folders and exclude ``examples`` folder.
|
||||
|
||||
This option can be set by global environment variable
|
||||
:ref:`envvar_PLATFORMIO_SRC_FILTER`.
|
||||
|
||||
``lib_install``
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Specify libraries which should be ignored by ``Library Dependency Finder``
|
||||
Specify dependent libraries which should be installed before environment
|
||||
process. The only library IDs are allowed. Multiple libraries can be passed
|
||||
using comma ``,`` sign.
|
||||
|
||||
You can obtain library IDs using :ref:`cmd_lib_search` command.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:depends_on_some_libs]
|
||||
lib_install = 1,13,19
|
||||
|
||||
``lib_use``
|
||||
^^^^^^^^^^^
|
||||
|
||||
Specify libraries which should be used by ``Library Dependency Finder (LDF)`` with
|
||||
the highest priority.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[env:libs_with_highest_priority]
|
||||
lib_use = OneWire_ID1,SPI
|
||||
|
||||
``lib_ignore``
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
Specify libraries which should be ignored by ``Library Dependency Finder (LDF)``
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[env:ignore_some_libs]
|
||||
ignore_libs = SPI,EngduinoV3_ID123
|
||||
lib_ignore = SPI,EngduinoV3_ID123
|
||||
|
||||
``lib_dfcyclic``
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Control cyclic (recursive) behaviour for ``Library Dependency Finder (LDF)``.
|
||||
By default, this option is turned OFF (``lib_dfcyclic=False``) and means, that
|
||||
``LDF`` will find only libraries which are included in source files from the
|
||||
project :ref:`projectconf_pio_src_dir`.
|
||||
|
||||
If you want to enable cyclic (recursive, nested) search, please set this option
|
||||
to ``True``. Founded library will be treated like a new source files and
|
||||
``LDF`` will search dependencies for it.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[env:libs_with_enabled_ldf_cyclic]
|
||||
lib_dfcyclic = True
|
||||
|
||||
.. _projectconf_extra_script:
|
||||
|
||||
``extra_script``
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Allows to launch extra script using `SCons <http://www.scons.org>`_ software
|
||||
construction tool. For more details please follow to "Construction Environments"
|
||||
section of
|
||||
`SCons documentation <http://www.scons.org/doc/production/HTML/scons-user.html#chap-environments>`_.
|
||||
|
||||
This option can be set by global environment variable
|
||||
:ref:`envvar_PLATFORMIO_EXTRA_SCRIPT`.
|
||||
|
||||
Example, specify own upload command for :ref:`platform_atmelavr`:
|
||||
|
||||
``platformio.ini``:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[env:env_with_specific_extra_script]
|
||||
platform = atmelavr
|
||||
extra_script = /path/to/extra_script.py
|
||||
|
||||
``extra_script.py``:
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
from SCons.Script import DefaultEnvironment
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
||||
env.Replace(UPLOADHEXCMD='"$UPLOADER" --uploader --flags')
|
||||
|
||||
# uncomment line below to see environment variables
|
||||
# print env.Dump()
|
||||
|
||||
See built-in examples of `PlatformIO build scripts <https://github.com/platformio/platformio/tree/develop/platformio/builder/scripts>`_.
|
||||
|
||||
``targets``
|
||||
^^^^^^^^^^^
|
||||
|
||||
A list with targets which will be processed by :ref:`cmd_run` command by
|
||||
default. You can enter more then one target separated with "space".
|
||||
|
||||
Pre-built targets:
|
||||
|
||||
* ``clean`` delete compiled object files, libraries and firmware binaries
|
||||
* ``upload`` enable "auto-uploading" for embedded platforms after building
|
||||
operation
|
||||
* ``envdump`` dump current build environment
|
||||
|
||||
**Tip!** You can use these targets like an option to
|
||||
:option:`platformio run --target` command. For example:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# clean project
|
||||
platformio run -t clean
|
||||
|
||||
# dump curent build environment
|
||||
platformio run --target envdump
|
||||
|
||||
When no targets are defined, *PlatformIO* will build only sources by default.
|
||||
|
||||
.. _projectconf_examples:
|
||||
|
||||
|
||||
@@ -9,8 +9,8 @@ Quickstart
|
||||
|
||||
1. :ref:`Install PlatformIO <installation>`.
|
||||
|
||||
2. Find board ``type`` on this :ref:`Embedded Boards <platforms>` page or
|
||||
via :ref:`cmd_boards` command.
|
||||
2. Find board ``type`` using `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
or via :ref:`cmd_boards` command.
|
||||
|
||||
3. Initialize new PlatformIO based project via :ref:`cmd_init` command with the
|
||||
pre-configured environments for your boards:
|
||||
|
||||
110
docs/userguide/cmd_ci.rst
Normal file
@@ -0,0 +1,110 @@
|
||||
.. _cmd_ci:
|
||||
|
||||
platformio ci
|
||||
=============
|
||||
|
||||
.. contents::
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio ci [OPTIONS] [SRC]
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
:ref:`cmd_ci` command is conceived of as "hot key" for building project with
|
||||
arbitrary source code structure. In a nutshell, using ``SRC`` and
|
||||
:option:`platformio ci --lib` contents PlatformIO initialises via
|
||||
:ref:`cmd_init` new project in :option:`platformio ci --build-dir`
|
||||
with the build environments (using :option:`platformio ci --board` or
|
||||
:option:`platformio ci --project-conf`) and processes them via :ref:`cmd_run`
|
||||
command.
|
||||
|
||||
For more details as for integration with the popular Continuous Integration
|
||||
Systems please follow to :ref:`ci` page.
|
||||
|
||||
.. note::
|
||||
:ref:`cmd_ci` command accepts **multiple** ``SRC`` arguments,
|
||||
:option:`platformio ci --lib` and :option:`platformio ci --exclude` options
|
||||
which can be a path to directory, file or
|
||||
`Glob Pattern <http://en.wikipedia.org/wiki/Glob_(programming)>`_.
|
||||
|
||||
.. note::
|
||||
You can omit ``SRC`` argument and set path (multiple paths are allowed
|
||||
denoting with ``:``) to
|
||||
``PLATFORMIO_CI_SRC`` `Environment variable <http://en.wikipedia.org/wiki/Environment_variable>`_
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
.. program:: platformio ci
|
||||
|
||||
.. option::
|
||||
-l, --lib
|
||||
|
||||
Source code which will be copied to ``%build_dir%/lib`` directly.
|
||||
|
||||
If :option:`platformio ci --lib` is a path to file (not to directory), then
|
||||
PlatformIO will create temporary directory within ``%build_dir%/lib`` and copy
|
||||
the rest files into it.
|
||||
|
||||
|
||||
.. option::
|
||||
--exclude
|
||||
|
||||
Exclude directories and/-or files from :option:`platformio ci --build-dir`. The
|
||||
path must be relative to PlatformIO project within
|
||||
:option:`platformio ci --build-dir`.
|
||||
|
||||
For example, exclude from project ``src`` directory:
|
||||
|
||||
* ``examples`` folder
|
||||
* ``*.h`` files from ``foo`` folder
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio ci --exclude=src/examples --exclude=src/foo/*.h [SRC]
|
||||
|
||||
.. option::
|
||||
-b, --board
|
||||
|
||||
Build project with automatically pre-generated environments based on board
|
||||
settings.
|
||||
|
||||
For more details please look into :option:`platformio init --board`.
|
||||
|
||||
.. option::
|
||||
--build-dir
|
||||
|
||||
Path to directory where PlatformIO will initialise new project. By default it's
|
||||
temporary directory within your operation system.
|
||||
|
||||
.. note::
|
||||
|
||||
This directory will be removed at the end of build process. If you want to
|
||||
keep it, please use :option:`platformio ci --keep-build-dir`.
|
||||
|
||||
.. option::
|
||||
--keep-build-dir
|
||||
|
||||
Don't remove :option:`platformio ci --build-dir` after build process.
|
||||
|
||||
.. option::
|
||||
--project-conf
|
||||
|
||||
Buid project using pre-configured :ref:`projectconf`.
|
||||
|
||||
.. option::
|
||||
-v, --verbose
|
||||
|
||||
Shows details about the results of processing environments. More details
|
||||
:option:`platformio run --verbose`
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
For the examples please follow to :ref:`ci` page.
|
||||
@@ -29,13 +29,15 @@ This command will create:
|
||||
Options
|
||||
-------
|
||||
|
||||
.. program:: platformio init
|
||||
|
||||
.. option::
|
||||
--project-dir, -d
|
||||
-d, --project-dir
|
||||
|
||||
A path to the directory where *PlatformIO* will initialise new project.
|
||||
|
||||
.. option::
|
||||
--board, -b
|
||||
-b, --board
|
||||
|
||||
If you specify board ``type`` (you can pass multiple ``--board`` options), then
|
||||
*PlatformIO* will automatically generate environment for :ref:`projectconf` and
|
||||
@@ -47,13 +49,32 @@ pre-fill these data:
|
||||
|
||||
The full list with pre-configured boards is available here :ref:`platforms`.
|
||||
|
||||
.. option::
|
||||
--ide
|
||||
|
||||
Initialise PlatformIO project for the specified IDE which can be imported later
|
||||
via "Import Project" functionality.
|
||||
|
||||
A list with supported IDE is available within ``platformio init --help`` command.
|
||||
Also, please look into :ref:`ide` page.
|
||||
|
||||
.. option::
|
||||
--disable-auto-uploading
|
||||
|
||||
If you initialise project with the specified ``--board``, then *PlatformIO*
|
||||
If you initialise project with the specified
|
||||
:option:`platformio init --board`, then *PlatformIO*
|
||||
will create environment with enabled firmware auto-uploading. This option
|
||||
allows you to disable firmware auto-uploading by default.
|
||||
|
||||
.. option::
|
||||
--env-prefix
|
||||
|
||||
An environment prefix which will be used with pair in board type.
|
||||
|
||||
For example, the default environment name for ``teensy_31`` board will
|
||||
be ``[env:teensy_31]``.
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ Process environments which are defined in :ref:`projectconf` file
|
||||
Options
|
||||
-------
|
||||
|
||||
.. program:: platformio run
|
||||
|
||||
.. option::
|
||||
-e, --environment
|
||||
|
||||
@@ -39,6 +41,27 @@ Process specified targets
|
||||
Upload port of embedded board. To print all available ports use
|
||||
:ref:`cmd_serialports` command
|
||||
|
||||
.. option::
|
||||
--build-dir
|
||||
|
||||
Specify the path to project directory. By default, ``--build-dir`` is equal to
|
||||
current working directory (``CWD``).
|
||||
|
||||
.. option::
|
||||
-v, --verbose
|
||||
|
||||
Shows details about the results of processing environments. Each instance of
|
||||
``--verbose`` on the command line increases the verbosity level by one, so if
|
||||
you need more details on the output, specify it twice.
|
||||
|
||||
There 3 levels of verbosity:
|
||||
|
||||
1. ``-v`` - output errors only
|
||||
2. ``-vv`` - output errors and warnings
|
||||
3. ``-vvv`` - output errors, warnings and additional information
|
||||
|
||||
By default, verbosity level is set to 3 (maximum information).
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
|
||||
@@ -24,6 +24,8 @@ List available `Serial Ports <http://en.wikipedia.org/wiki/Serial_port>`_
|
||||
Options
|
||||
~~~~~~~
|
||||
|
||||
.. program:: platformio serialports list
|
||||
|
||||
.. option::
|
||||
--json-output
|
||||
|
||||
@@ -99,6 +101,8 @@ To control *monitor* please use these "hot keys":
|
||||
Options
|
||||
~~~~~~~
|
||||
|
||||
.. program:: platformio serialports monitor
|
||||
|
||||
.. option::
|
||||
-p, --port
|
||||
|
||||
|
||||
@@ -16,7 +16,8 @@ Usage
|
||||
Description
|
||||
-----------
|
||||
|
||||
Check or update installed :ref:`Platforms <platforms>`
|
||||
Check or update installed :ref:`Platforms <platforms>` and
|
||||
:ref:`Libraries <librarymanager>`
|
||||
|
||||
|
||||
Examples
|
||||
|
||||
@@ -3,7 +3,35 @@
|
||||
User Guide
|
||||
==========
|
||||
|
||||
To print all available commands and options use:
|
||||
.. contents::
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio [OPTIONS] COMMAND
|
||||
|
||||
Options
|
||||
-------
|
||||
|
||||
.. program:: platformio
|
||||
|
||||
.. option::
|
||||
--force, - f
|
||||
|
||||
Force to accept any confirmation prompts. This option allows to avoid an issue
|
||||
with :ref:`faq_troubleshooting_pioblocksprompt`
|
||||
|
||||
.. option::
|
||||
--version
|
||||
|
||||
Show the version of PlatformIO
|
||||
|
||||
.. option::
|
||||
--help
|
||||
|
||||
Show help for the available options and commands
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@@ -11,19 +39,19 @@ To print all available commands and options use:
|
||||
$ platformio COMMAND --help
|
||||
|
||||
|
||||
Commands
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
cmd_boards
|
||||
cmd_ci
|
||||
cmd_init
|
||||
cmd_install
|
||||
platformio lib <lib/index>
|
||||
cmd_list
|
||||
platformio platforms <platforms/index>
|
||||
cmd_run
|
||||
cmd_search
|
||||
cmd_serialports
|
||||
cmd_settings
|
||||
cmd_show
|
||||
cmd_uninstall
|
||||
cmd_update
|
||||
cmd_upgrade
|
||||
|
||||
@@ -22,6 +22,8 @@ Install new library by specified
|
||||
Options
|
||||
-------
|
||||
|
||||
.. program:: platformio lib install
|
||||
|
||||
.. option::
|
||||
-v, --version
|
||||
|
||||
|
||||
@@ -21,6 +21,8 @@ List installed libraries
|
||||
Options
|
||||
~~~~~~~
|
||||
|
||||
.. program:: platformio lib list
|
||||
|
||||
.. option::
|
||||
--json-output
|
||||
|
||||
|
||||
@@ -61,6 +61,8 @@ For more detail information please go to
|
||||
Options
|
||||
-------
|
||||
|
||||
.. program:: platformio lib search
|
||||
|
||||
.. option::
|
||||
-a, --author
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@ Usage
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio lib update
|
||||
platformio lib update [LIBRARY_ID]
|
||||
|
||||
|
||||
Description
|
||||
@@ -22,6 +22,8 @@ Check or update installed libraries
|
||||
Examples
|
||||
--------
|
||||
|
||||
1. Update all installed libraries
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio lib update
|
||||
@@ -36,8 +38,23 @@ Examples
|
||||
# Updating [ 13 ] Adafruit-GFX library:
|
||||
# Versions: Current=a9e5bc4707, Latest=a9e5bc4707 [Up-to-date]
|
||||
# Updating [ 1 ] OneWire library:
|
||||
# Versions: Current=2.2, Latest=2.2 [Up-to-date]
|
||||
# Versions: Current=2.2, Latest=2.2 [Up-to-date]
|
||||
# Updating [ 4 ] IRremote library:
|
||||
# Versions: Current=f2dafe5030, Latest=f2dafe5030 [Up-to-date]
|
||||
# Updating [ 14 ] Adafruit-9DOF-Unified library:
|
||||
# Versions: Current=b2f07242ac, Latest=b2f07242ac [Up-to-date]
|
||||
|
||||
2. Update specified libraries
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio lib update 1 59
|
||||
# Updating [ 1 ] OneWire library:
|
||||
# Versions: Current=2.2, Latest=2.2 [Up-to-date]
|
||||
# Updating [ 59 ] USB-Host-Shield-20 library:
|
||||
# Versions: Current=fcab83dcb3, Latest=c61f9ce1c2 [Out-of-date]
|
||||
# The library #59 'USB-Host-Shield-20' has been successfully uninstalled!
|
||||
# Installing library [ 59 ]:
|
||||
# Downloading [####################################] 100%
|
||||
# Unpacking [####################################] 100%
|
||||
# The library #59 'USB-Host-Shield-20' has been successfully installed!
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
.. _cmd_install:
|
||||
.. _cmd_platforms_install:
|
||||
|
||||
platformio install
|
||||
==================
|
||||
platformio platforms install
|
||||
============================
|
||||
|
||||
.. contents::
|
||||
|
||||
@@ -10,7 +10,7 @@ Usage
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio install [OPTIONS] [PLATFORMS]
|
||||
platformio platforms install [OPTIONS] [PLATFORMS]
|
||||
|
||||
|
||||
Description
|
||||
@@ -27,6 +27,8 @@ There are several predefined aliases for packages, such as:
|
||||
Options
|
||||
-------
|
||||
|
||||
.. program:: platformio platforms install
|
||||
|
||||
.. option::
|
||||
--with-package
|
||||
|
||||
@@ -50,7 +52,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio install timsp430
|
||||
$ platformio platforms install timsp430
|
||||
Installing toolchain-timsp430 package:
|
||||
Downloading [####################################] 100%
|
||||
Unpacking [####################################] 100%
|
||||
@@ -68,7 +70,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio install timsp430 --skip-default-package --with-package=uploader
|
||||
$ platformio platforms install timsp430 --skip-default-package --with-package=uploader
|
||||
Installing tool-mspdebug package:
|
||||
Downloading [####################################] 100%
|
||||
Unpacking [####################################] 100%
|
||||
@@ -1,7 +1,7 @@
|
||||
.. _cmd_list:
|
||||
.. _cmd_platforms_list:
|
||||
|
||||
platformio list
|
||||
===============
|
||||
platformio platforms list
|
||||
=========================
|
||||
|
||||
.. contents::
|
||||
|
||||
@@ -10,7 +10,7 @@ Usage
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio list [OPTIONS]
|
||||
platformio platforms list [OPTIONS]
|
||||
|
||||
|
||||
Description
|
||||
@@ -21,6 +21,8 @@ List installed :ref:`Platforms <platforms>`
|
||||
Options
|
||||
~~~~~~~
|
||||
|
||||
.. program:: platformio platforms list
|
||||
|
||||
.. option::
|
||||
--json-output
|
||||
|
||||
@@ -31,7 +33,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio list
|
||||
$ platformio platforms list
|
||||
atmelavr with packages: toolchain-atmelavr, tool-avrdude, framework-arduinoavr, tool-micronucleus
|
||||
atmelsam with packages: framework-arduinosam, ldscripts, toolchain-gccarmnoneeabi, tool-bossac
|
||||
freescalekinetis with packages: framework-mbed, toolchain-gccarmnoneeabi
|
||||
@@ -1,7 +1,7 @@
|
||||
.. _cmd_search:
|
||||
.. _cmd_platforms_search:
|
||||
|
||||
platformio search
|
||||
=================
|
||||
platformio platforms search
|
||||
===========================
|
||||
|
||||
.. contents::
|
||||
|
||||
@@ -10,7 +10,7 @@ Usage
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio search QUERY [OPTIONS]
|
||||
platformio platforms search QUERY [OPTIONS]
|
||||
|
||||
|
||||
Description
|
||||
@@ -21,6 +21,8 @@ Search for development :ref:`Platforms <platforms>`
|
||||
Options
|
||||
~~~~~~~
|
||||
|
||||
.. program:: platformio platforms search
|
||||
|
||||
.. option::
|
||||
--json-output
|
||||
|
||||
@@ -34,7 +36,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio search
|
||||
$ platformio platforms search
|
||||
atmelavr (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa)
|
||||
--------
|
||||
Atmel AVR 8- and 32-bit MCUs deliver a unique combination of performance...
|
||||
@@ -75,7 +77,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio search ti
|
||||
$ platformio platforms search ti
|
||||
timsp430 (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa)
|
||||
--------
|
||||
MSP430 microcontrollers (MCUs) from Texas Instruments (TI) are ...
|
||||
@@ -88,7 +90,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio search mbed
|
||||
$ platformio platforms search mbed
|
||||
freescalekinetis (available packages: ldscripts, toolchain-gccarmnoneeabi, tool-lm4flash, framework-opencm3, framework-energiativa)
|
||||
----------------
|
||||
Freescale Kinetis Microcontrollers is family of multiple hardware- and ...
|
||||
@@ -1,7 +1,7 @@
|
||||
.. _cmd_show:
|
||||
.. _cmd_platforms_show:
|
||||
|
||||
platformio show
|
||||
===============
|
||||
platformio platforms show
|
||||
=========================
|
||||
|
||||
.. contents::
|
||||
|
||||
@@ -10,7 +10,7 @@ Usage
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio show PLATFORM
|
||||
platformio platforms show PLATFORM
|
||||
|
||||
|
||||
Description
|
||||
@@ -24,7 +24,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio show atmelavr
|
||||
$ platformio platforms show atmelavr
|
||||
atmelavr - An embedded platform for Atmel AVR microcontrollers (with Arduino Framework)
|
||||
----------
|
||||
Package: toolchain-atmelavr
|
||||
@@ -1,7 +1,7 @@
|
||||
.. _cmd_uninstall:
|
||||
.. _cmd_platforms_uninstall:
|
||||
|
||||
platformio uninstall
|
||||
====================
|
||||
platformio platforms uninstall
|
||||
==============================
|
||||
|
||||
.. contents::
|
||||
|
||||
@@ -10,7 +10,7 @@ Usage
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio uninstall PLATFORM
|
||||
platformio platforms uninstall PLATFORM
|
||||
|
||||
|
||||
Description
|
||||
@@ -24,7 +24,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio uninstall timsp430
|
||||
$ platformio platforms uninstall timsp430
|
||||
Uninstalling toolchain-timsp430 package: [OK]
|
||||
Uninstalling tool-mspdebug package: [OK]
|
||||
Uninstalling framework-energiamsp430 package: [OK]
|
||||
99
docs/userguide/platforms/cmd_update.rst
Normal file
@@ -0,0 +1,99 @@
|
||||
.. _cmd_platforms_update:
|
||||
|
||||
platformio platforms update
|
||||
===========================
|
||||
|
||||
.. contents::
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
platformio platforms update
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
Check or update installed :ref:`Platforms <platforms>`
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio platforms update
|
||||
|
||||
Platform atmelavr
|
||||
--------
|
||||
Updating toolchain-atmelavr package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating tool-avrdude package:
|
||||
Versions: Current=2, Latest=2 [Up-to-date]
|
||||
Updating framework-arduinoavr package:
|
||||
Versions: Current=12, Latest=12 [Up-to-date]
|
||||
Updating tool-micronucleus package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
|
||||
Platform atmelsam
|
||||
--------
|
||||
Updating framework-arduinosam package:
|
||||
Versions: Current=3, Latest=3 [Up-to-date]
|
||||
Updating ldscripts package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating toolchain-gccarmnoneeabi package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating tool-bossac package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
|
||||
Platform stm32
|
||||
--------
|
||||
Updating toolchain-gccarmnoneeabi package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating tool-stlink package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating framework-spl package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating framework-cmsis package:
|
||||
Versions: Current=2, Latest=2 [Up-to-date]
|
||||
Updating framework-opencm3 package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating ldscripts package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
|
||||
Platform teensy
|
||||
--------
|
||||
Updating toolchain-atmelavr package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating ldscripts package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating framework-arduinoteensy package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating toolchain-gccarmnoneeabi package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating tool-teensy package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
|
||||
Platform timsp430
|
||||
--------
|
||||
Updating toolchain-timsp430 package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating tool-mspdebug package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating framework-energiamsp430 package:
|
||||
Versions: Current=2, Latest=2 [Up-to-date]
|
||||
|
||||
Platform titiva
|
||||
--------
|
||||
Updating ldscripts package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating toolchain-gccarmnoneeabi package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating tool-lm4flash package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating framework-opencm3 package:
|
||||
Versions: Current=1, Latest=1 [Up-to-date]
|
||||
Updating framework-energiativa package:
|
||||
Versions: Current=4, Latest=4 [Up-to-date]
|
||||
22
docs/userguide/platforms/index.rst
Normal file
@@ -0,0 +1,22 @@
|
||||
.. _userguide_platforms:
|
||||
|
||||
Platforms Manager
|
||||
=================
|
||||
|
||||
To print all available commands and options use:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio platforms --help
|
||||
$ platformio platforms COMMAND --help
|
||||
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
cmd_install
|
||||
cmd_list
|
||||
cmd_search
|
||||
cmd_show
|
||||
cmd_uninstall
|
||||
cmd_update
|
||||
@@ -1,29 +1,43 @@
|
||||
#include <ESP8266WiFi.h>
|
||||
#include <WiFiClient.h>
|
||||
#include <ESP8266WebServer.h>
|
||||
#include <ESP8266mDNS.h>
|
||||
|
||||
const char* ssid = "*****";
|
||||
const char* password = "*****";
|
||||
|
||||
const char* ssid = "******";
|
||||
const char* password = "******";
|
||||
MDNSResponder mdns;
|
||||
|
||||
ESP8266WebServer server(80);
|
||||
|
||||
|
||||
const int led = 13;
|
||||
|
||||
void handle_root() {
|
||||
|
||||
void handleRoot() {
|
||||
digitalWrite(led, 1);
|
||||
server.send(200, "text/plain", "hello from esp8266!");
|
||||
delay(100);
|
||||
digitalWrite(led, 0);
|
||||
}
|
||||
|
||||
void handleNotFound(){
|
||||
digitalWrite(led, 1);
|
||||
String message = "File Not Found\n\n";
|
||||
message += "URI: ";
|
||||
message += server.uri();
|
||||
message += "\nMethod: ";
|
||||
message += (server.method() == HTTP_GET)?"GET":"POST";
|
||||
message += "\nArguments: ";
|
||||
message += server.args();
|
||||
message += "\n";
|
||||
for (uint8_t i=0; i<server.args(); i++){
|
||||
message += " " + server.argName(i) + ": " + server.arg(i) + "\n";
|
||||
}
|
||||
server.send(404, "text/plain", message);
|
||||
digitalWrite(led, 0);
|
||||
}
|
||||
|
||||
void setup(void)
|
||||
{
|
||||
Serial.begin(115200);
|
||||
void setup(void){
|
||||
pinMode(led, OUTPUT);
|
||||
digitalWrite(led, 0);
|
||||
|
||||
// Connect to WiFi network
|
||||
Serial.begin(115200);
|
||||
WiFi.begin(ssid, password);
|
||||
Serial.println("");
|
||||
|
||||
@@ -37,18 +51,23 @@ void setup(void)
|
||||
Serial.println(ssid);
|
||||
Serial.print("IP address: ");
|
||||
Serial.println(WiFi.localIP());
|
||||
|
||||
server.on("/", handle_root);
|
||||
|
||||
if (mdns.begin("esp8266", WiFi.localIP())) {
|
||||
Serial.println("MDNS responder started");
|
||||
}
|
||||
|
||||
server.on("/", handleRoot);
|
||||
|
||||
server.on("/inline", [](){
|
||||
server.send(200, "text/plain", "this works as well");
|
||||
});
|
||||
|
||||
server.onNotFound(handleNotFound);
|
||||
|
||||
server.begin();
|
||||
Serial.println("HTTP server started");
|
||||
}
|
||||
|
||||
void loop(void)
|
||||
{
|
||||
void loop(void){
|
||||
server.handleClient();
|
||||
}
|
||||
}
|
||||
@@ -47,3 +47,9 @@ board = nucleo_f401re
|
||||
platform = teensy
|
||||
framework = mbed
|
||||
board = teensy31
|
||||
|
||||
# Silicon Labs EFM32 Platform
|
||||
[env:siliconlabsefm32]
|
||||
platform = siliconlabsefm32
|
||||
framework = mbed
|
||||
board = efm32hg_stk3400
|
||||
|
||||
@@ -5,22 +5,22 @@
|
||||
; http://docs.platformio.org/en/latest/projectconf.html
|
||||
;
|
||||
|
||||
[env:autogen_uno]
|
||||
[env:uno]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = uno
|
||||
|
||||
[env:autogen_teensy31]
|
||||
[env:teensy31]
|
||||
platform = teensy
|
||||
framework = arduino
|
||||
board = teensy31
|
||||
|
||||
[env:autogen_lpmsp430g2553]
|
||||
[env:lpmsp430g2553]
|
||||
platform = timsp430
|
||||
framework = energia
|
||||
board = lpmsp430g2553
|
||||
|
||||
[env:autogen_lptm4c1230c3pm]
|
||||
[env:lptm4c1230c3pm]
|
||||
platform = titiva
|
||||
framework = energia
|
||||
board = lptm4c1230c3pm
|
||||
|
||||
@@ -1,14 +1,15 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (1, 5, 0)
|
||||
VERSION = (2, 2, 0)
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
__description__ = ("A cross-platform code builder and the missing library "
|
||||
"manager (Atmel AVR & SAM, Espressif, Freescale Kinetis, "
|
||||
"Nordic nRF51, NXP LPC, ST STM32, TI MSP430 & Tiva, "
|
||||
"Teensy, Arduino, mbed, libOpenCM3, etc.)")
|
||||
__description__ = (
|
||||
"Cross-platform code builder and the missing library manager "
|
||||
"(Ready for embedded development, IDE and Continuous integration, "
|
||||
"Arduino and MBED compatible)"
|
||||
)
|
||||
__url__ = "http://platformio.org"
|
||||
|
||||
__author__ = "Ivan Kravets"
|
||||
|
||||
@@ -31,20 +31,38 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904
|
||||
mod = __import__("platformio.commands." + name,
|
||||
None, None, ["cli"])
|
||||
except ImportError:
|
||||
raise exception.UnknownCLICommand(name)
|
||||
try:
|
||||
return self._handle_obsolate_command(name)
|
||||
except AttributeError:
|
||||
raise exception.UnknownCLICommand(name)
|
||||
return mod.cli
|
||||
|
||||
@staticmethod
|
||||
def _handle_obsolate_command(name):
|
||||
if name in ("install", "list", "search", "show", "uninstall"):
|
||||
click.secho(
|
||||
"Warning! `platformio %s` command is deprecated and will be "
|
||||
"removed in the next release! Please use "
|
||||
"`platformio platforms %s` instead." % (name, name),
|
||||
fg="yellow"
|
||||
)
|
||||
from platformio.commands import platforms
|
||||
return getattr(platforms, "platforms_" + name)
|
||||
raise AttributeError()
|
||||
|
||||
|
||||
@click.command(cls=PlatformioCLI)
|
||||
@click.version_option(__version__, prog_name="PlatformIO")
|
||||
@click.option("--force", "-f", is_flag=True,
|
||||
help="Force to accept any confirmation prompts")
|
||||
@click.pass_context
|
||||
def cli(ctx):
|
||||
maintenance.on_platformio_start(ctx)
|
||||
def cli(ctx, force):
|
||||
maintenance.on_platformio_start(ctx, force)
|
||||
|
||||
|
||||
@cli.resultcallback()
|
||||
@click.pass_context
|
||||
def process_result(ctx, result):
|
||||
def process_result(ctx, result, force): # pylint: disable=W0613
|
||||
maintenance.on_platformio_end(ctx, result)
|
||||
|
||||
|
||||
@@ -54,7 +72,7 @@ def main():
|
||||
# /en/latest/security.html#insecureplatformwarning
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
|
||||
cli(None)
|
||||
cli(None, None)
|
||||
except Exception as e: # pylint: disable=W0703
|
||||
if not isinstance(e, exception.ReturnErrorCode):
|
||||
maintenance.on_platformio_exception(e)
|
||||
|
||||
@@ -24,11 +24,11 @@ DEFAULT_SETTINGS = {
|
||||
},
|
||||
"auto_update_platforms": {
|
||||
"description": "Automatically update platforms (Yes/No)",
|
||||
"value": True
|
||||
"value": False
|
||||
},
|
||||
"auto_update_libraries": {
|
||||
"description": "Automatically update libraries (Yes/No)",
|
||||
"value": True
|
||||
"value": False
|
||||
},
|
||||
"enable_telemetry": {
|
||||
"description": ("Shares commands, platforms and libraries usage"
|
||||
@@ -47,6 +47,11 @@ DEFAULT_SETTINGS = {
|
||||
}
|
||||
|
||||
|
||||
SESSION_VARS = {
|
||||
"force_option": False
|
||||
}
|
||||
|
||||
|
||||
class State(object):
|
||||
|
||||
def __init__(self, path=None):
|
||||
@@ -101,9 +106,12 @@ def set_state_item(name, value):
|
||||
|
||||
|
||||
def get_setting(name):
|
||||
# disable prompts for Continuous Integration systems
|
||||
if name == "enable_prompts" and getenv("CI", "").lower() == "true":
|
||||
return False
|
||||
if name == "enable_prompts":
|
||||
# disable prompts for Continuous Integration systems
|
||||
# and when global "--force" option is set
|
||||
if any([getenv("CI", "").lower() == "true",
|
||||
get_session_var("force_option")]):
|
||||
return False
|
||||
|
||||
_env_name = "PLATFORMIO_SETTING_%s" % name.upper()
|
||||
if _env_name in environ:
|
||||
@@ -127,3 +135,12 @@ def reset_settings():
|
||||
with State() as data:
|
||||
if "settings" in data:
|
||||
del data['settings']
|
||||
|
||||
|
||||
def get_session_var(name, default=None):
|
||||
return SESSION_VARS.get(name, default)
|
||||
|
||||
|
||||
def set_session_var(name, value):
|
||||
assert name in SESSION_VARS
|
||||
SESSION_VARS[name] = value
|
||||
|
||||
@@ -2,11 +2,11 @@
|
||||
"esp01": {
|
||||
"build": {
|
||||
"core": "esp8266",
|
||||
"extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266",
|
||||
"extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266",
|
||||
"f_cpu": "80000000L",
|
||||
"ldscript": "esp8266.ld",
|
||||
"ldscript": "esp8266.flash.512k.ld",
|
||||
"mcu": "esp8266",
|
||||
"variant": "esp01"
|
||||
"variant": "generic"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Espressif ESP8266 board",
|
||||
|
||||
@@ -250,50 +250,6 @@
|
||||
"vendor": "TinyCircuits"
|
||||
},
|
||||
|
||||
"wildfirev3": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "wildfirev3"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "WickedDevice WildFire v3 [optiboot]",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 130048,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://shop.wickeddevice.com/resources/wildfire/",
|
||||
"vendor": "WickedDevice"
|
||||
},
|
||||
|
||||
"wildfirev2": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "wildfirev2"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "WickedDevice WildFire v2 [stk500]",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 122878,
|
||||
"protocol": "wiring",
|
||||
"require_upload_port" : true,
|
||||
"speed": 38400
|
||||
},
|
||||
"url": "http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup",
|
||||
"vendor": "WickedDevice"
|
||||
},
|
||||
|
||||
"blend": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
@@ -521,5 +477,49 @@
|
||||
},
|
||||
"url": "http://quirkbot.com",
|
||||
"vendor": "Quirkbot"
|
||||
},
|
||||
|
||||
"wildfirev2": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_MEGA",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "wildfirev2"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Wicked Device WildFire V2",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 122878,
|
||||
"protocol": "wiring",
|
||||
"require_upload_port" : true,
|
||||
"speed": 38400
|
||||
},
|
||||
"url": "http://shop.wickeddevice.com/resources/wildfire/",
|
||||
"vendor": "Wicked Device"
|
||||
},
|
||||
|
||||
"wildfirev3": {
|
||||
"build": {
|
||||
"core": "arduino",
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_MEGA",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "wildfirev3"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Wicked Device WildFire V3",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 130048,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://shop.wickeddevice.com/resources/wildfire/",
|
||||
"vendor": "Wicked Device"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,5 +126,21 @@
|
||||
},
|
||||
"url": "http://developer.mbed.org/platforms/Seeed-Tiny-BLE/",
|
||||
"vendor": "SeeedStudio"
|
||||
},
|
||||
"dfcm_nnn40": {
|
||||
"build": {
|
||||
"f_cpu": "32000000L",
|
||||
"cpu": "cortex-m0",
|
||||
"mcu": "nrf51822"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Delta DFCM-NNN40",
|
||||
"platform": "nordicnrf51",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/Delta-DFCM-NNN40/",
|
||||
"vendor": "Delta"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
86
platformio/boards/siliconlabsefm32.json
Normal file
@@ -0,0 +1,86 @@
|
||||
{
|
||||
"efm32wg_stk3800": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "efm32wg990f256"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs EFM32WG-STK3800 (Wonder Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
},
|
||||
|
||||
"efm32gg_stk3700": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m3",
|
||||
"mcu": "efm32gg990f1024"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs EFM32GG-STK3700 (Giant Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 131072,
|
||||
"maximum_size": 1048576
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Giant-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
},
|
||||
|
||||
"efm32lg_stk3600": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m3",
|
||||
"mcu": "efm32lg990f256"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs EFM32LG-STK3600 (Leopard Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
},
|
||||
|
||||
"efm32zg_stk3200": {
|
||||
"build": {
|
||||
"f_cpu": "24000000L",
|
||||
"cpu": "cortex-m0plus",
|
||||
"mcu": "efm2zg222f32"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs EFM32ZG-STK3200 (Zero Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 4096,
|
||||
"maximum_size": 32768
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Zero-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
},
|
||||
|
||||
"efm32hg_stk3400": {
|
||||
"build": {
|
||||
"f_cpu": "24000000L",
|
||||
"cpu": "cortex-m3",
|
||||
"mcu": "efm32hg322f64"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Silicon Labs SLSTK3400A USB-enabled (Happy Gecko)",
|
||||
"platform": "siliconlabsefm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 8192,
|
||||
"maximum_size": 65536
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/EFM32-Happy-Gecko/",
|
||||
"vendor": "Silicon Labs"
|
||||
}
|
||||
}
|
||||
@@ -330,5 +330,97 @@
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/ST-Nucleo-L152RE/",
|
||||
"vendor": "ST"
|
||||
},
|
||||
"armstrap_eagle512": {
|
||||
"build": {
|
||||
"core": "stm32",
|
||||
"extra_flags": "-DSTM32F40_41xxx",
|
||||
"f_cpu": "168000000L",
|
||||
"ldscript": "armstrap_eagle_512.ld",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32f407vet6",
|
||||
"variant": "stm32f4"
|
||||
},
|
||||
"frameworks": ["cmsis", "spl"],
|
||||
"name": "Armstrap Eagle 512",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 196608,
|
||||
"maximum_size": 524288
|
||||
},
|
||||
"url": "http://docs.armstrap.org/en/latest/hardware-overview.html",
|
||||
"vendor": "Armstrap"
|
||||
},
|
||||
"armstrap_eagle1024": {
|
||||
"build": {
|
||||
"core": "stm32",
|
||||
"extra_flags": "-DSTM32F40_41xxx",
|
||||
"f_cpu": "168000000L",
|
||||
"ldscript": "armstrap_eagle_1024.ld",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32f417vgt6",
|
||||
"variant": "stm32f4"
|
||||
},
|
||||
"frameworks": ["cmsis", "spl"],
|
||||
"name": "Armstrap Eagle 1024",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 196608,
|
||||
"maximum_size": 1048576
|
||||
},
|
||||
"url": "http://docs.armstrap.org/en/latest/hardware-overview.html",
|
||||
"vendor": "Armstrap"
|
||||
},
|
||||
"armstrap_eagle2048": {
|
||||
"build": {
|
||||
"core": "stm32",
|
||||
"extra_flags": "-DSTM32F427_437xx",
|
||||
"f_cpu": "168000000L",
|
||||
"ldscript": "armstrap_eagle_2048.ld",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32f427vit6",
|
||||
"variant": "stm32f4"
|
||||
},
|
||||
"frameworks": ["cmsis", "spl"],
|
||||
"name": "Armstrap Eagle 2048",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 262144,
|
||||
"maximum_size": 2091752
|
||||
},
|
||||
"url": "http://docs.armstrap.org/en/latest/hardware-overview.html",
|
||||
"vendor": "Armstrap"
|
||||
},
|
||||
"disco_l053c8": {
|
||||
"build": {
|
||||
"f_cpu": "32000000L",
|
||||
"cpu": "cortex-m0plus",
|
||||
"mcu": "stm32l053c8t6"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "ST 32L0538DISCOVERY",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 8192,
|
||||
"maximum_size": 65536
|
||||
},
|
||||
"url": "http://www.st.com/web/en/catalog/tools/PF260319",
|
||||
"vendor": "ST"
|
||||
},
|
||||
"disco_f334c8": {
|
||||
"build": {
|
||||
"f_cpu": "72000000L",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32f334c8t6"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "ST 32F3348DISCOVERY",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 12288,
|
||||
"maximum_size": 65536
|
||||
},
|
||||
"url": "http://www.st.com/web/en/catalog/tools/PF260318",
|
||||
"vendor": "ST"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,11 +11,13 @@ except ImportError:
|
||||
break
|
||||
from platformio import util
|
||||
|
||||
from os.path import join
|
||||
import json
|
||||
from os import getenv
|
||||
from os.path import isfile, join
|
||||
from time import time
|
||||
|
||||
from SCons.Script import (DefaultEnvironment, Exit, SConscript,
|
||||
SConscriptChdir, Variables)
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, DefaultEnvironment, Exit,
|
||||
SConscript, SConscriptChdir, Variables)
|
||||
|
||||
from platformio.exception import UnknownBoard
|
||||
|
||||
@@ -25,6 +27,7 @@ from platformio.exception import UnknownBoard
|
||||
commonvars = Variables(None)
|
||||
commonvars.AddVariables(
|
||||
("BUILD_SCRIPT",),
|
||||
("EXTRA_SCRIPT",),
|
||||
("PIOENV",),
|
||||
("PLATFORM",),
|
||||
|
||||
@@ -35,8 +38,11 @@ commonvars.AddVariables(
|
||||
# options
|
||||
("FRAMEWORK",),
|
||||
("BUILD_FLAGS",),
|
||||
("SRCBUILD_FLAGS",),
|
||||
("IGNORE_LIBS",),
|
||||
("SRC_BUILD_FLAGS",),
|
||||
("SRC_FILTER",),
|
||||
("LIB_DFCYCLIC",),
|
||||
("LIB_IGNORE",),
|
||||
("LIB_USE",),
|
||||
|
||||
# board options
|
||||
("BOARD",),
|
||||
@@ -52,7 +58,7 @@ commonvars.AddVariables(
|
||||
DefaultEnvironment(
|
||||
tools=[
|
||||
"gcc", "g++", "as", "ar", "gnulink",
|
||||
"platformio", "pioupload", "pioar"
|
||||
"platformio", "pioupload", "pioar", "piomisc"
|
||||
],
|
||||
toolpath=[join("$PIOBUILDER_DIR", "tools")],
|
||||
variables=commonvars,
|
||||
@@ -61,6 +67,7 @@ DefaultEnvironment(
|
||||
|
||||
PIOHOME_DIR=util.get_home_dir(),
|
||||
PROJECT_DIR=util.get_project_dir(),
|
||||
PROJECTLIB_DIR=util.get_projectlib_dir(),
|
||||
PROJECTSRC_DIR=util.get_projectsrc_dir(),
|
||||
PIOENVS_DIR=util.get_pioenvs_dir(),
|
||||
|
||||
@@ -68,8 +75,9 @@ DefaultEnvironment(
|
||||
PIOPACKAGES_DIR=join("$PIOHOME_DIR", "packages"),
|
||||
|
||||
BUILD_DIR=join("$PIOENVS_DIR", "$PIOENV"),
|
||||
BUILDSRC_DIR=join("$BUILD_DIR", "src"),
|
||||
LIBSOURCE_DIRS=[
|
||||
join("$PROJECT_DIR", "lib"),
|
||||
"$PROJECTLIB_DIR",
|
||||
util.get_lib_dir(),
|
||||
join("$PLATFORMFW_DIR", "libraries")
|
||||
]
|
||||
@@ -95,9 +103,11 @@ if "BOARD" in env:
|
||||
UPLOAD_SPEED="${BOARD_OPTIONS['upload'].get('speed', None)}")
|
||||
if "ldscript" in env.get("BOARD_OPTIONS", {}).get("build", {}):
|
||||
env.Replace(
|
||||
LDSCRIPT_PATH=join(
|
||||
"$PIOHOME_DIR", "packages", "ldscripts",
|
||||
"${BOARD_OPTIONS['build']['ldscript']}"
|
||||
LDSCRIPT_PATH=(
|
||||
env['BOARD_OPTIONS']['build']['ldscript']
|
||||
if isfile(env['BOARD_OPTIONS']['build']['ldscript'])
|
||||
else join("$PIOHOME_DIR", "packages", "ldscripts",
|
||||
"${BOARD_OPTIONS['build']['ldscript']}")
|
||||
)
|
||||
)
|
||||
|
||||
@@ -108,8 +118,10 @@ if "BOARD" in env:
|
||||
env.get("BOARD_OPTIONS", {}).get("platform")))
|
||||
|
||||
|
||||
if "IGNORE_LIBS" in env:
|
||||
env['IGNORE_LIBS'] = [l.strip() for l in env['IGNORE_LIBS'].split(",")]
|
||||
for opt in ("LIB_IGNORE", "LIB_USE"):
|
||||
if opt not in env:
|
||||
continue
|
||||
env[opt] = [l.strip() for l in env[opt].split(",") if l.strip()]
|
||||
|
||||
env.PrependENVPath(
|
||||
"PATH",
|
||||
@@ -118,3 +130,14 @@ env.PrependENVPath(
|
||||
|
||||
SConscriptChdir(0)
|
||||
SConscript(env.subst("$BUILD_SCRIPT"))
|
||||
|
||||
if getenv("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT", None)):
|
||||
SConscript(getenv("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")))
|
||||
|
||||
if "envdump" in COMMAND_LINE_TARGETS:
|
||||
print env.Dump()
|
||||
Exit()
|
||||
|
||||
if "idedata" in COMMAND_LINE_TARGETS:
|
||||
print json.dumps(env.DumpIDEData())
|
||||
Exit()
|
||||
|
||||
@@ -20,14 +20,21 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
||||
with open(path, "w") as f:
|
||||
f.write(str(value))
|
||||
|
||||
upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {})
|
||||
|
||||
if env.subst("$UPLOAD_SPEED"):
|
||||
env.Append(UPLOADERFLAGS=["-b", "$UPLOAD_SPEED"])
|
||||
|
||||
if "micronucleus" in env['UPLOADER']:
|
||||
print "Please unplug/plug device ..."
|
||||
|
||||
upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {})
|
||||
|
||||
if "usb" in env.subst("$UPLOAD_PROTOCOL"):
|
||||
upload_options['require_upload_port'] = False
|
||||
env.Replace(UPLOAD_SPEED=None)
|
||||
|
||||
if env.subst("$UPLOAD_SPEED"):
|
||||
env.Append(UPLOADERFLAGS=[
|
||||
"-b", "$UPLOAD_SPEED",
|
||||
"-D"
|
||||
])
|
||||
|
||||
if not upload_options.get("require_upload_port", False):
|
||||
return
|
||||
|
||||
@@ -74,7 +81,6 @@ else:
|
||||
UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"),
|
||||
UPLOADERFLAGS=[
|
||||
"-v",
|
||||
"-D", # disable auto erase for flash memory
|
||||
"-p", "$BOARD_MCU",
|
||||
"-C",
|
||||
'"%s"' % join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude.conf"),
|
||||
|
||||
@@ -47,8 +47,7 @@ env.Replace(
|
||||
"-Os",
|
||||
"-Wl,--gc-sections,--relax",
|
||||
"-mthumb",
|
||||
"-mcpu=${BOARD_OPTIONS['build']['cpu']}",
|
||||
"--specs=nano.specs"
|
||||
"-mcpu=${BOARD_OPTIONS['build']['cpu']}"
|
||||
],
|
||||
|
||||
LIBS=["c", "gcc", "m"],
|
||||
|
||||
@@ -43,6 +43,8 @@ env.Replace(
|
||||
"-Os", # optimize for size
|
||||
"-mlongcalls",
|
||||
"-mtext-section-literals",
|
||||
"-falign-functions=4",
|
||||
"-U__STRICT_ANSI__",
|
||||
"-MMD" # output dependancy info
|
||||
],
|
||||
|
||||
@@ -70,12 +72,12 @@ env.Replace(
|
||||
UPLOADER=join("$PIOPACKAGES_DIR", "tool-esptool", "esptool"),
|
||||
UPLOADERFLAGS=[
|
||||
"-vv",
|
||||
"-cd", "none",
|
||||
"-cd", "ck",
|
||||
"-cb", "$UPLOAD_SPEED",
|
||||
"-cp", "$UPLOAD_PORT",
|
||||
"-ca", "0x00000",
|
||||
"-cf", "${SOURCES[0]}",
|
||||
"-ca", "0x40000",
|
||||
"-ca", "0x40000" if "FRAMEWORK" not in env else "0x10000",
|
||||
"-cf", "${SOURCES[1]}"
|
||||
],
|
||||
UPLOADCMD='$UPLOADER $UPLOADERFLAGS'
|
||||
@@ -88,6 +90,9 @@ env.Append(
|
||||
"$UPLOADER",
|
||||
"-eo", "$SOURCES",
|
||||
"-bo", "${TARGETS[0]}",
|
||||
"-bm", "qio",
|
||||
"-bf", "40",
|
||||
"-bz", "512K",
|
||||
"-bs", ".text",
|
||||
"-bs", ".data",
|
||||
"-bs", ".rodata",
|
||||
@@ -135,7 +140,8 @@ if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
else:
|
||||
target_firm = env.ElfToBin(
|
||||
[join("$BUILD_DIR", "firmware_00000"),
|
||||
join("$BUILD_DIR", "firmware_40000")], target_elf)
|
||||
join("$BUILD_DIR", "firmware_%s" %
|
||||
("40000" if "FRAMEWORK" not in env else "10000"))], target_elf)
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -46,8 +46,8 @@ elif env.get("PLATFORM") == "espressif":
|
||||
env.Prepend(
|
||||
CPPPATH=[join("$PLATFORMFW_DIR", "sdk", "include")],
|
||||
LIBPATH=[join("$PLATFORMFW_DIR", "sdk", "lib")],
|
||||
LIBS=["hal", "phy", "net80211", "lwip",
|
||||
"wpa", "main", "pp", "c", "gcc"]
|
||||
LIBS=["smartconfig", "pp", "main", "wpa", "lwip",
|
||||
"net80211", "phy", "hal", "gcc", "m"]
|
||||
)
|
||||
|
||||
env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR)
|
||||
@@ -106,20 +106,20 @@ env.Append(
|
||||
#
|
||||
|
||||
if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam":
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkCMSISInc"),
|
||||
join("$PLATFORMFW_DIR", "system", "CMSIS", "CMSIS", "Include")
|
||||
)
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkDeviceInc"),
|
||||
join("$PLATFORMFW_DIR", "system", "CMSIS", "Device", "ATMEL")
|
||||
)
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkLibSam"),
|
||||
join("$PLATFORMFW_DIR", "system", "libsam")
|
||||
)
|
||||
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkArduinoInc"),
|
||||
join("$PLATFORMFW_DIR", "cores", "${BOARD_OPTIONS['build']['core']}")
|
||||
)
|
||||
@@ -161,7 +161,7 @@ if BOARD_BUILDOPTS.get("core", None) == "teensy":
|
||||
# search relative includes in teensy directories
|
||||
core_dir = join(env.get("PIOHOME_DIR"), "packages",
|
||||
"framework-arduinoteensy", "cores", "teensy")
|
||||
for item in listdir(core_dir):
|
||||
for item in sorted(listdir(core_dir)):
|
||||
file_path = join(core_dir, item)
|
||||
if not isfile(file_path):
|
||||
continue
|
||||
|
||||
@@ -25,7 +25,7 @@ env.Replace(
|
||||
PLATFORMFW_DIR=join("$PIOPACKAGES_DIR", "framework-cmsis")
|
||||
)
|
||||
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkCMSIS"),
|
||||
join("$PLATFORMFW_DIR", "cores", "${BOARD_OPTIONS['build']['core']}")
|
||||
)
|
||||
|
||||
@@ -28,7 +28,7 @@ ENERGIA_VERSION = int(
|
||||
"version.txt")).read().replace(".", "").strip())
|
||||
|
||||
# include board variant
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkEnergiaVariant"),
|
||||
join("$PLATFORMFW_DIR", "variants", "${BOARD_OPTIONS['build']['variant']}")
|
||||
)
|
||||
|
||||
@@ -32,7 +32,7 @@ BOARD_BUILDOPTS = env.get("BOARD_OPTIONS", {}).get("build", {})
|
||||
def find_ldscript(src_dir):
|
||||
ldscript = None
|
||||
matches = []
|
||||
for item in listdir(src_dir):
|
||||
for item in sorted(listdir(src_dir)):
|
||||
_path = join(src_dir, item)
|
||||
if not isfile(_path) or not item.endswith(".ld"):
|
||||
continue
|
||||
@@ -138,7 +138,7 @@ if BOARD_BUILDOPTS.get("core") == "lm4f":
|
||||
CPPDEFINES=["LM4F"]
|
||||
)
|
||||
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkLibOpenCM3Variant"),
|
||||
join("$PLATFORMFW_DIR", "include")
|
||||
)
|
||||
@@ -166,7 +166,7 @@ env.Replace(
|
||||
)
|
||||
|
||||
libs = []
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkLibOpenCM3"),
|
||||
"$PLATFORMFW_DIR"
|
||||
)
|
||||
|
||||
@@ -32,9 +32,6 @@ env.Replace(
|
||||
)
|
||||
|
||||
MBED_VARIANTS = {
|
||||
"stm32f3discovery": "DISCO_F303VC",
|
||||
"stm32f4discovery": "DISCO_F407VG",
|
||||
"stm32f429discovery": "DISCO_F429ZI",
|
||||
"blueboard_lpc11u24": "LPC11U24",
|
||||
"dipcortexm0": "LPC11U24",
|
||||
"seeeduinoArchPro": "ARCH_PRO",
|
||||
@@ -54,7 +51,8 @@ MBED_VARIANTS = {
|
||||
"frdm_kl05z": "KL05Z",
|
||||
"frdm_k20d50m": "K20D50M",
|
||||
"frdm_k22f": "K22F",
|
||||
"teensy31": "TEENSY3_1"
|
||||
"teensy31": "TEENSY3_1",
|
||||
"dfcm_nnn40": "DELTA_DFCM_NNN40"
|
||||
}
|
||||
|
||||
MBED_LIBS_MAP = {
|
||||
@@ -134,7 +132,7 @@ def add_mbedlib(libname, libar):
|
||||
(libname.upper(), crc32(root)))
|
||||
if var_dir in env.get("CPPPATH"):
|
||||
continue
|
||||
env.VariantDir(var_dir, root)
|
||||
env.VariantDirWrap(var_dir, root)
|
||||
env.Append(CPPPATH=[var_dir])
|
||||
|
||||
|
||||
@@ -221,7 +219,7 @@ if board_type in ("frdm_k22f", "frdm_k64f"):
|
||||
|
||||
for lib_path in eixdata.get("CPPPATH"):
|
||||
_vdir = join("$BUILD_DIR", "FrameworkMbedInc%d" % crc32(lib_path))
|
||||
env.VariantDir(_vdir, join(variant_dir, lib_path))
|
||||
env.VariantDirWrap(_vdir, join(variant_dir, lib_path))
|
||||
env.Append(CPPPATH=[_vdir])
|
||||
|
||||
env.Append(
|
||||
|
||||
@@ -22,7 +22,7 @@ env.Replace(
|
||||
PLATFORMFW_DIR=join("$PIOPACKAGES_DIR", "framework-spl")
|
||||
)
|
||||
|
||||
env.VariantDir(
|
||||
env.VariantDirWrap(
|
||||
join("$BUILD_DIR", "FrameworkSPLInc"),
|
||||
join("$PLATFORMFW_DIR", "${BOARD_OPTIONS['build']['core']}",
|
||||
"variants", "${BOARD_OPTIONS['build']['variant']}", "inc")
|
||||
@@ -38,10 +38,7 @@ env.Append(
|
||||
envsafe = env.Clone()
|
||||
|
||||
envsafe.Append(
|
||||
CPPPATH=[
|
||||
join("$BUILD_DIR", "src")
|
||||
],
|
||||
|
||||
CPPPATH=["$BUILDSRC_DIR"],
|
||||
CPPDEFINES=[
|
||||
"USE_STDPERIPH_DRIVER"
|
||||
]
|
||||
@@ -52,20 +49,22 @@ envsafe.Append(
|
||||
#
|
||||
|
||||
extra_flags = env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags")
|
||||
ignore_files = []
|
||||
src_filter_patterns = ["+<*>"]
|
||||
if "STM32F40_41xxx" in extra_flags:
|
||||
ignore_files += ["stm32f4xx_fmc.c"]
|
||||
src_filter_patterns += ["-<stm32f4xx_fmc.c>"]
|
||||
if "STM32F427_437xx" in extra_flags:
|
||||
src_filter_patterns += ["-<stm32f4xx_fsmc.c>"]
|
||||
elif "STM32F303xC" in extra_flags:
|
||||
ignore_files += ["stm32f30x_hrtim.c"]
|
||||
src_filter_patterns += ["-<stm32f30x_hrtim.c>"]
|
||||
elif "STM32L1XX_MD" in extra_flags:
|
||||
ignore_files += ["stm32l1xx_flash_ramfunc.c"]
|
||||
src_filter_patterns += ["-<stm32l1xx_flash_ramfunc.c>"]
|
||||
|
||||
libs = []
|
||||
libs.append(envsafe.BuildLibrary(
|
||||
join("$BUILD_DIR", "FrameworkSPL"),
|
||||
join("$PLATFORMFW_DIR", "${BOARD_OPTIONS['build']['core']}", "variants",
|
||||
"${BOARD_OPTIONS['build']['variant']}", "src"),
|
||||
ignore_files
|
||||
src_filter=" ".join(src_filter_patterns)
|
||||
))
|
||||
|
||||
env.Append(LIBS=libs)
|
||||
|
||||
50
platformio/builder/scripts/siliconlabsefm32.py
Normal file
@@ -0,0 +1,50 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
"""
|
||||
Builder for Silicon Labs EFM32 series ARM microcontrollers.
|
||||
"""
|
||||
|
||||
from os.path import join
|
||||
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
|
||||
DefaultEnvironment, SConscript)
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
||||
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
|
||||
|
||||
#
|
||||
# Target: Build executable and linkable firmware
|
||||
#
|
||||
|
||||
target_elf = env.BuildFirmware()
|
||||
|
||||
#
|
||||
# Target: Build the .bin file
|
||||
#
|
||||
|
||||
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
target_firm = join("$BUILD_DIR", "firmware.bin")
|
||||
else:
|
||||
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
|
||||
|
||||
#
|
||||
# Target: Print binary size
|
||||
#
|
||||
|
||||
target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD")
|
||||
AlwaysBuild(target_size)
|
||||
|
||||
#
|
||||
# Target: Upload by default .bin file
|
||||
#
|
||||
|
||||
upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk)
|
||||
AlwaysBuild(upload)
|
||||
|
||||
#
|
||||
# Target: Define targets
|
||||
#
|
||||
|
||||
Default([target_firm, target_size])
|
||||
@@ -53,6 +53,8 @@ env.Append(
|
||||
"${BOARD_OPTIONS['build']['variant'].upper()}"
|
||||
],
|
||||
|
||||
LIBS=["stdc++", "nosys"],
|
||||
|
||||
LINKFLAGS=[
|
||||
"-nostartfiles",
|
||||
"-nostdlib"
|
||||
|
||||
167
platformio/builder/tools/piomisc.py
Normal file
@@ -0,0 +1,167 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import atexit
|
||||
import re
|
||||
from glob import glob
|
||||
from os import remove
|
||||
from os.path import basename, join
|
||||
|
||||
|
||||
class InoToCPPConverter(object):
|
||||
|
||||
PROTOTYPE_RE = re.compile(
|
||||
r"""^(
|
||||
(\s*[a-z_\d]+){1,2} # return type
|
||||
(\s+[a-z_\d]+\s*) # name of prototype
|
||||
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
|
||||
)\s*\{ # must end with {
|
||||
""",
|
||||
re.X | re.M | re.I
|
||||
)
|
||||
|
||||
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
|
||||
|
||||
STRIPCOMMENTS_RE = re.compile(r"(/\*.*?\*/|(^|\s+)//[^\r\n]*$)",
|
||||
re.M | re.S)
|
||||
|
||||
def __init__(self, nodes):
|
||||
self.nodes = nodes
|
||||
|
||||
def is_main_node(self, contents):
|
||||
return self.DETECTMAIN_RE.search(contents)
|
||||
|
||||
@staticmethod
|
||||
def _replace_comments_callback(match):
|
||||
if "\n" in match.group(1):
|
||||
return "\n" * match.group(1).count("\n")
|
||||
else:
|
||||
return " "
|
||||
|
||||
def _parse_prototypes(self, contents):
|
||||
prototypes = []
|
||||
reserved_keywords = set(["if", "else", "while"])
|
||||
for item in self.PROTOTYPE_RE.findall(contents):
|
||||
if set([item[1].strip(), item[2].strip()]) & reserved_keywords:
|
||||
continue
|
||||
prototypes.append(item[0])
|
||||
return prototypes
|
||||
|
||||
def append_prototypes(self, fname, contents, prototypes):
|
||||
contents = self.STRIPCOMMENTS_RE.sub(self._replace_comments_callback,
|
||||
contents)
|
||||
result = []
|
||||
is_appended = False
|
||||
linenum = 0
|
||||
for line in contents.splitlines():
|
||||
linenum += 1
|
||||
line = line.strip()
|
||||
|
||||
if not is_appended and line and not line.startswith("#"):
|
||||
is_appended = True
|
||||
result.append("%s;" % ";\n".join(prototypes))
|
||||
result.append('#line %d "%s"' % (linenum, fname))
|
||||
|
||||
result.append(line)
|
||||
|
||||
return result
|
||||
|
||||
def convert(self):
|
||||
prototypes = []
|
||||
data = []
|
||||
for node in self.nodes:
|
||||
ino_contents = node.get_text_contents()
|
||||
prototypes += self._parse_prototypes(ino_contents)
|
||||
|
||||
item = (basename(node.get_path()), ino_contents)
|
||||
if self.is_main_node(ino_contents):
|
||||
data = [item] + data
|
||||
else:
|
||||
data.append(item)
|
||||
|
||||
if not data:
|
||||
return None
|
||||
|
||||
result = ["#include <Arduino.h>"]
|
||||
is_first = True
|
||||
|
||||
for name, contents in data:
|
||||
if is_first and prototypes:
|
||||
result += self.append_prototypes(name, contents, prototypes)
|
||||
else:
|
||||
result.append('#line 1 "%s"' % name)
|
||||
result.append(contents)
|
||||
is_first = False
|
||||
|
||||
return "\n".join(result)
|
||||
|
||||
|
||||
def ConvertInoToCpp(env):
|
||||
|
||||
def delete_tmpcpp_file(file_):
|
||||
remove(file_)
|
||||
|
||||
ino_nodes = (env.Glob(join("$PROJECTSRC_DIR", "*.ino")) +
|
||||
env.Glob(join("$PROJECTSRC_DIR", "*.pde")))
|
||||
|
||||
c = InoToCPPConverter(ino_nodes)
|
||||
data = c.convert()
|
||||
|
||||
if not data:
|
||||
return
|
||||
|
||||
tmpcpp_file = join(env.subst("$PROJECTSRC_DIR"), "tmp_ino_to.cpp")
|
||||
with open(tmpcpp_file, "w") as f:
|
||||
f.write(data)
|
||||
|
||||
atexit.register(delete_tmpcpp_file, tmpcpp_file)
|
||||
|
||||
|
||||
def DumpIDEData(env):
|
||||
data = {
|
||||
"defines": [],
|
||||
"includes": []
|
||||
}
|
||||
|
||||
# includes from framework and libs
|
||||
for item in env.get("VARIANT_DIRS", []):
|
||||
if "$BUILDSRC_DIR" in item[0]:
|
||||
continue
|
||||
data['includes'].append(env.subst(item[1]))
|
||||
|
||||
# includes from toolchain
|
||||
toolchain_dir = env.subst(
|
||||
join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN"))
|
||||
toolchain_incglobs = [
|
||||
join(toolchain_dir, "*", "include"),
|
||||
join(toolchain_dir, "lib", "gcc", "*", "*", "include")
|
||||
]
|
||||
for g in toolchain_incglobs:
|
||||
data['includes'].extend(glob(g))
|
||||
|
||||
# global symbols
|
||||
for item in env.get("CPPDEFINES", []):
|
||||
if isinstance(item, list):
|
||||
item = "=".join(item)
|
||||
data['defines'].append(env.subst(item))
|
||||
|
||||
# special symbol for Atmel AVR MCU
|
||||
board = env.get("BOARD_OPTIONS", {})
|
||||
if board and board['platform'] == "atmelavr":
|
||||
data['defines'].append(
|
||||
"__AVR_%s__" % board['build']['mcu'].upper()
|
||||
.replace("ATMEGA", "ATmega")
|
||||
.replace("ATTINY", "ATtiny")
|
||||
)
|
||||
|
||||
return data
|
||||
|
||||
|
||||
def exists(_):
|
||||
return True
|
||||
|
||||
|
||||
def generate(env):
|
||||
env.AddMethod(ConvertInoToCpp)
|
||||
env.AddMethod(DumpIDEData)
|
||||
return env
|
||||
@@ -69,18 +69,25 @@ def AutodetectUploadPort(env):
|
||||
if (not item['name'] or
|
||||
not any([l in item['name'].lower() for l in msdlabels])):
|
||||
continue
|
||||
print "Auto-detected UPLOAD_PORT/DISK: %s" % item['disk']
|
||||
env.Replace(UPLOAD_PORT=item['disk'])
|
||||
break
|
||||
else:
|
||||
board_build_opts = env.get("BOARD_OPTIONS", {}).get("build", {})
|
||||
board_hwid = ("%s:%s" % (
|
||||
board_build_opts.get("vid"),
|
||||
board_build_opts.get("pid")
|
||||
)).replace("0x", "")
|
||||
|
||||
for item in get_serialports():
|
||||
if "VID:PID" not in item['hwid']:
|
||||
continue
|
||||
print "Auto-detected UPLOAD_PORT: %s" % item['port']
|
||||
env.Replace(UPLOAD_PORT=item['port'])
|
||||
break
|
||||
if board_hwid in item['hwid']:
|
||||
break
|
||||
|
||||
if "UPLOAD_PORT" not in env:
|
||||
if "UPLOAD_PORT" in env:
|
||||
print "Auto-detected UPLOAD_PORT/DISK: %s" % env['UPLOAD_PORT']
|
||||
else:
|
||||
Exit("Error: Please specify `upload_port` for environment or use "
|
||||
"global `--upload-port` option.\n"
|
||||
"For the some development platforms it can be USB flash drive\n")
|
||||
|
||||
@@ -1,17 +1,24 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import atexit
|
||||
import re
|
||||
from os import getenv, listdir, remove, sep, walk
|
||||
from glob import glob
|
||||
from os import getenv, listdir, sep, walk
|
||||
from os.path import basename, dirname, isdir, isfile, join, normpath
|
||||
|
||||
from SCons.Script import Exit, SConscript, SConscriptChdir
|
||||
from SCons.Script import DefaultEnvironment, Exit, SConscript
|
||||
from SCons.Util import case_sensitive_suffixes
|
||||
|
||||
from platformio.util import pioversion_to_intstr
|
||||
|
||||
|
||||
SRC_BUILD_EXT = ["c", "cpp", "S", "spp", "SPP", "sx", "s", "asm", "ASM"]
|
||||
SRC_HEADER_EXT = ["h", "hpp"]
|
||||
SRC_DEFAULT_FILTER = " ".join([
|
||||
"+<*>", "-<.git%s>" % sep, "-<svn%s>" % sep, "-<examples%s>" % sep
|
||||
])
|
||||
|
||||
|
||||
def BuildFirmware(env):
|
||||
|
||||
# fix ASM handling under non-casitive OS
|
||||
@@ -24,41 +31,42 @@ def BuildFirmware(env):
|
||||
env.ProcessFlags()
|
||||
env.BuildFramework()
|
||||
|
||||
firmenv = env.Clone()
|
||||
vdirs = firmenv.VariantDirRecursive(
|
||||
join("$BUILD_DIR", "src"), "$PROJECTSRC_DIR")
|
||||
|
||||
# build dependent libs
|
||||
deplibs = firmenv.BuildDependentLibraries("$PROJECTSRC_DIR")
|
||||
deplibs = env.BuildDependentLibraries("$PROJECTSRC_DIR")
|
||||
|
||||
# append specified LD_SCRIPT
|
||||
if "LDSCRIPT_PATH" in firmenv:
|
||||
firmenv.Append(
|
||||
LINKFLAGS=["-T", "$LDSCRIPT_PATH"]
|
||||
if ("LDSCRIPT_PATH" in env and
|
||||
not any(["-Wl,-T" in f for f in env['LINKFLAGS']])):
|
||||
env.Append(
|
||||
LINKFLAGS=["-Wl,-T", "$LDSCRIPT_PATH"]
|
||||
)
|
||||
|
||||
# enable "cyclic reference" for linker
|
||||
firmenv.Prepend(
|
||||
env.Prepend(
|
||||
_LIBFLAGS="-Wl,--start-group "
|
||||
)
|
||||
firmenv.Append(
|
||||
env.Append(
|
||||
_LIBFLAGS=" -Wl,--end-group"
|
||||
)
|
||||
|
||||
_srcbuild_flags = getenv("PLATFORMIO_SRCBUILD_FLAGS",
|
||||
env.subst("$SRCBUILD_FLAGS"))
|
||||
if _srcbuild_flags:
|
||||
firmenv.MergeFlags(_srcbuild_flags)
|
||||
# Handle SRC_BUILD_FLAGS
|
||||
if getenv("PLATFORMIO_SRC_BUILD_FLAGS", None):
|
||||
env.MergeFlags(getenv("PLATFORMIO_SRC_BUILD_FLAGS"))
|
||||
if "SRC_BUILD_FLAGS" in env:
|
||||
env.MergeFlags(env['SRC_BUILD_FLAGS'])
|
||||
|
||||
firmenv.Append(
|
||||
env.Append(
|
||||
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
|
||||
*pioversion_to_intstr())]
|
||||
)
|
||||
|
||||
return firmenv.Program(
|
||||
return env.Program(
|
||||
join("$BUILD_DIR", "firmware"),
|
||||
[firmenv.GlobCXXFiles(vdir) for vdir in vdirs],
|
||||
LIBS=list(env.get("LIBS", []) + deplibs)[::-1],
|
||||
env.LookupSources(
|
||||
"$BUILDSRC_DIR", "$PROJECTSRC_DIR", duplicate=False,
|
||||
src_filter=getenv("PLATFORMIO_SRC_FILTER",
|
||||
env.get("SRC_FILTER", None))),
|
||||
LIBS=env.get("LIBS", []) + deplibs,
|
||||
LIBPATH=env.get("LIBPATH", []) + ["$BUILD_DIR"],
|
||||
PROGSUFFIX=".elf"
|
||||
)
|
||||
@@ -68,6 +76,9 @@ def ProcessFlags(env):
|
||||
if "extra_flags" in env.get("BOARD_OPTIONS", {}).get("build", {}):
|
||||
env.MergeFlags(env.subst("${BOARD_OPTIONS['build']['extra_flags']}"))
|
||||
|
||||
# Handle BUILD_FLAGS
|
||||
if getenv("PLATFORMIO_BUILD_FLAGS", None):
|
||||
env.MergeFlags(getenv("PLATFORMIO_BUILD_FLAGS"))
|
||||
if "BUILD_FLAGS" in env:
|
||||
env.MergeFlags(env['BUILD_FLAGS'])
|
||||
|
||||
@@ -80,29 +91,67 @@ def ProcessFlags(env):
|
||||
env.Append(_CPPDEFFLAGS=" %s" % " ".join(undefines))
|
||||
|
||||
|
||||
def GlobCXXFiles(env, path):
|
||||
files = []
|
||||
for suff in ["*.c", "*.cpp", "*.S"]:
|
||||
_list = env.Glob(join(path, suff))
|
||||
if _list:
|
||||
files += _list
|
||||
return files
|
||||
def IsFileWithExt(env, file_, ext): # pylint: disable=W0613
|
||||
if basename(file_).startswith("."):
|
||||
return False
|
||||
for e in ext:
|
||||
if file_.endswith(".%s" % e):
|
||||
return True
|
||||
return False
|
||||
|
||||
|
||||
def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True,
|
||||
ignore_pattern=None):
|
||||
if not ignore_pattern:
|
||||
ignore_pattern = (".git", ".svn")
|
||||
def VariantDirWrap(env, variant_dir, src_dir, duplicate=True):
|
||||
DefaultEnvironment().Append(VARIANT_DIRS=[(variant_dir, src_dir)])
|
||||
env.VariantDir(variant_dir, src_dir, duplicate)
|
||||
|
||||
|
||||
def LookupSources(env, variant_dir, src_dir, duplicate=True, src_filter=None):
|
||||
|
||||
SRC_FILTER_PATTERNS_RE = re.compile(r"(\+|\-)<([^>]+)>")
|
||||
|
||||
def _append_build_item(items, item, src_dir):
|
||||
if env.IsFileWithExt(item, SRC_BUILD_EXT + SRC_HEADER_EXT):
|
||||
items.add(item.replace(src_dir + sep, ""))
|
||||
|
||||
def _match_sources(src_dir, src_filter):
|
||||
matches = set()
|
||||
# correct fs directory separator
|
||||
src_filter = src_filter.replace("/", sep).replace("\\", sep)
|
||||
for (action, pattern) in SRC_FILTER_PATTERNS_RE.findall(src_filter):
|
||||
items = set()
|
||||
for item in glob(join(src_dir, pattern)):
|
||||
if isdir(item):
|
||||
for root, _, files in walk(item, followlinks=True):
|
||||
for f in files:
|
||||
_append_build_item(items, join(root, f), src_dir)
|
||||
else:
|
||||
_append_build_item(items, item, src_dir)
|
||||
if action == "+":
|
||||
matches |= items
|
||||
else:
|
||||
matches -= items
|
||||
return sorted(list(matches))
|
||||
|
||||
sources = []
|
||||
variants = []
|
||||
|
||||
src_dir = env.subst(src_dir)
|
||||
for root, _, _ in walk(src_dir, followlinks=True):
|
||||
_src_dir = root
|
||||
_var_dir = variant_dir + root.replace(src_dir, "")
|
||||
if any([s in _var_dir.lower() for s in ignore_pattern]):
|
||||
continue
|
||||
env.VariantDir(_var_dir, _src_dir, duplicate)
|
||||
variants.append(_var_dir)
|
||||
return variants
|
||||
if src_dir.endswith(sep):
|
||||
src_dir = src_dir[:-1]
|
||||
|
||||
for item in _match_sources(src_dir, src_filter or SRC_DEFAULT_FILTER):
|
||||
_reldir = dirname(item)
|
||||
_src_dir = join(src_dir, _reldir) if _reldir else src_dir
|
||||
_var_dir = join(variant_dir, _reldir) if _reldir else variant_dir
|
||||
|
||||
if _var_dir not in variants:
|
||||
variants.append(_var_dir)
|
||||
env.VariantDirWrap(_var_dir, _src_dir, duplicate)
|
||||
|
||||
if env.IsFileWithExt(item, SRC_BUILD_EXT):
|
||||
sources.append(env.File(join(_var_dir, basename(item))))
|
||||
|
||||
return sources
|
||||
|
||||
|
||||
def BuildFramework(env):
|
||||
@@ -115,7 +164,6 @@ def BuildFramework(env):
|
||||
for f in env['FRAMEWORK'].split(","):
|
||||
framework = f.strip().lower()
|
||||
if framework in env.get("BOARD_OPTIONS", {}).get("frameworks"):
|
||||
SConscriptChdir(0)
|
||||
SConscript(
|
||||
env.subst(join("$PIOBUILDER_DIR", "scripts", "frameworks",
|
||||
"%s.py" % framework))
|
||||
@@ -125,25 +173,18 @@ def BuildFramework(env):
|
||||
framework)
|
||||
|
||||
|
||||
def BuildLibrary(env, variant_dir, library_dir, ignore_files=None):
|
||||
def BuildLibrary(env, variant_dir, src_dir, src_filter=None):
|
||||
lib = env.Clone()
|
||||
vdirs = lib.VariantDirRecursive(
|
||||
variant_dir, library_dir, ignore_pattern=(".git", ".svn", "examples"))
|
||||
srcfiles = []
|
||||
for vdir in vdirs:
|
||||
for item in lib.GlobCXXFiles(vdir):
|
||||
if not ignore_files or item.name not in ignore_files:
|
||||
srcfiles.append(item)
|
||||
return lib.Library(
|
||||
lib.subst(variant_dir),
|
||||
srcfiles
|
||||
lib.LookupSources(variant_dir, src_dir, src_filter=src_filter)
|
||||
)
|
||||
|
||||
|
||||
def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
|
||||
INCLUDES_RE = re.compile(r"^\s*#include\s+(\<|\")([^\>\"\']+)(?:\>|\")",
|
||||
re.M)
|
||||
INCLUDES_RE = re.compile(
|
||||
r"^\s*#include\s+(\<|\")([^\>\"\']+)(?:\>|\")", re.M)
|
||||
LIBSOURCE_DIRS = [env.subst(d) for d in env.get("LIBSOURCE_DIRS", [])]
|
||||
|
||||
# start internal prototypes
|
||||
@@ -185,7 +226,10 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
if not isdir(lsd_dir):
|
||||
continue
|
||||
|
||||
for ld in listdir(lsd_dir):
|
||||
for ld in env.get("LIB_USE", []) + sorted(listdir(lsd_dir)):
|
||||
if not isdir(join(lsd_dir, ld)):
|
||||
continue
|
||||
|
||||
inc_path = normpath(join(lsd_dir, ld, self.name))
|
||||
try:
|
||||
lib_dir = inc_path[:inc_path.index(
|
||||
@@ -195,7 +239,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
lib_name = basename(lib_dir)
|
||||
|
||||
# ignore user's specified libs
|
||||
if "IGNORE_LIBS" in env and lib_name in env['IGNORE_LIBS']:
|
||||
if lib_name in env.get("LIB_IGNORE", []):
|
||||
continue
|
||||
|
||||
if not isfile(inc_path):
|
||||
@@ -216,6 +260,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
"libs": set(),
|
||||
"ordered": set()
|
||||
}
|
||||
|
||||
state = _process_src_dir(state, env.subst(src_dir))
|
||||
|
||||
result = []
|
||||
@@ -224,10 +269,10 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
return result
|
||||
|
||||
def _process_src_dir(state, src_dir):
|
||||
for root, _, _ in walk(src_dir, followlinks=True):
|
||||
for node in (env.GlobCXXFiles(root) +
|
||||
env.Glob(join(root, "*.h"))):
|
||||
state = _parse_includes(state, node)
|
||||
for root, _, files in walk(src_dir, followlinks=True):
|
||||
for f in files:
|
||||
if env.IsFileWithExt(f, SRC_BUILD_EXT + SRC_HEADER_EXT):
|
||||
state = _parse_includes(state, env.File(join(root, f)))
|
||||
return state
|
||||
|
||||
def _parse_includes(state, node):
|
||||
@@ -252,23 +297,23 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
len(state['ordered']) + 1, finder.getLibName(),
|
||||
_lib_dir))
|
||||
state['libs'].add(_lib_dir)
|
||||
state = _process_src_dir(state, _lib_dir)
|
||||
|
||||
if env.subst("$LIB_DFCYCLIC").lower() == "true":
|
||||
state = _process_src_dir(state, _lib_dir)
|
||||
return state
|
||||
|
||||
# end internal prototypes
|
||||
|
||||
deplibs = _get_dep_libs(src_dir)
|
||||
env.Prepend(
|
||||
CPPPATH=[join("$BUILD_DIR", l) for (l, _) in deplibs]
|
||||
)
|
||||
|
||||
# add automatically "utility" dir from the lib (Arduino issue)
|
||||
env.Prepend(
|
||||
CPPPATH=[
|
||||
join("$BUILD_DIR", l, "utility") for (l, ld) in deplibs
|
||||
if isdir(join(ld, "utility"))
|
||||
]
|
||||
)
|
||||
for l, ld in deplibs:
|
||||
env.Append(
|
||||
CPPPATH=[join("$BUILD_DIR", l)]
|
||||
)
|
||||
# add automatically "utility" dir from the lib (Arduino issue)
|
||||
if isdir(join(ld, "utility")):
|
||||
env.Append(
|
||||
CPPPATH=[join("$BUILD_DIR", l, "utility")]
|
||||
)
|
||||
|
||||
libs = []
|
||||
for (libname, inc_dir) in deplibs:
|
||||
@@ -279,105 +324,6 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
return libs
|
||||
|
||||
|
||||
class InoToCPPConverter(object):
|
||||
|
||||
PROTOTYPE_RE = re.compile(
|
||||
r"""^(
|
||||
(?:\s*[a-z_\d]+){1,2} # return type
|
||||
\s+[a-z_\d]+\s* # name of prototype
|
||||
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
|
||||
)\s*\{ # must end with {
|
||||
""",
|
||||
re.X | re.M | re.I
|
||||
)
|
||||
|
||||
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
|
||||
|
||||
STRIPCOMMENTS_RE = re.compile(r"(/\*.*?\*/|//[^\r\n]*$)", re.M | re.S)
|
||||
|
||||
def __init__(self, nodes):
|
||||
self.nodes = nodes
|
||||
|
||||
def is_main_node(self, contents):
|
||||
return self.DETECTMAIN_RE.search(contents)
|
||||
|
||||
@staticmethod
|
||||
def _replace_comments_callback(match):
|
||||
if "\n" in match.group(1):
|
||||
return "\n" * match.group(1).count("\n")
|
||||
else:
|
||||
return " "
|
||||
|
||||
def append_prototypes(self, fname, contents, prototypes):
|
||||
contents = self.STRIPCOMMENTS_RE.sub(self._replace_comments_callback,
|
||||
contents)
|
||||
result = []
|
||||
is_appended = False
|
||||
linenum = 0
|
||||
for line in contents.splitlines():
|
||||
linenum += 1
|
||||
line = line.strip()
|
||||
|
||||
if not is_appended and line and not line.startswith("#"):
|
||||
is_appended = True
|
||||
result.append("%s;" % ";\n".join(prototypes))
|
||||
result.append('#line %d "%s"' % (linenum, fname))
|
||||
|
||||
result.append(line)
|
||||
|
||||
return result
|
||||
|
||||
def convert(self):
|
||||
prototypes = []
|
||||
data = []
|
||||
for node in self.nodes:
|
||||
ino_contents = node.get_text_contents()
|
||||
prototypes += self.PROTOTYPE_RE.findall(ino_contents)
|
||||
|
||||
item = (basename(node.get_path()), ino_contents)
|
||||
if self.is_main_node(ino_contents):
|
||||
data = [item] + data
|
||||
else:
|
||||
data.append(item)
|
||||
|
||||
if not data:
|
||||
return None
|
||||
|
||||
result = ["#include <Arduino.h>"]
|
||||
is_first = True
|
||||
|
||||
for name, contents in data:
|
||||
if is_first and prototypes:
|
||||
result += self.append_prototypes(name, contents, prototypes)
|
||||
else:
|
||||
result.append('#line 1 "%s"' % name)
|
||||
result.append(contents)
|
||||
is_first = False
|
||||
|
||||
return "\n".join(result)
|
||||
|
||||
|
||||
def ConvertInoToCpp(env):
|
||||
|
||||
def delete_tmpcpp_file(file_):
|
||||
remove(file_)
|
||||
|
||||
ino_nodes = (env.Glob(join("$PROJECTSRC_DIR", "*.ino")) +
|
||||
env.Glob(join("$PROJECTSRC_DIR", "*.pde")))
|
||||
|
||||
c = InoToCPPConverter(ino_nodes)
|
||||
data = c.convert()
|
||||
|
||||
if not data:
|
||||
return
|
||||
|
||||
tmpcpp_file = join(env.subst("$PROJECTSRC_DIR"), "piomain.cpp")
|
||||
with open(tmpcpp_file, "w") as f:
|
||||
f.write(data)
|
||||
|
||||
atexit.register(delete_tmpcpp_file, tmpcpp_file)
|
||||
|
||||
|
||||
def exists(_):
|
||||
return True
|
||||
|
||||
@@ -385,10 +331,10 @@ def exists(_):
|
||||
def generate(env):
|
||||
env.AddMethod(BuildFirmware)
|
||||
env.AddMethod(ProcessFlags)
|
||||
env.AddMethod(GlobCXXFiles)
|
||||
env.AddMethod(VariantDirRecursive)
|
||||
env.AddMethod(IsFileWithExt)
|
||||
env.AddMethod(VariantDirWrap)
|
||||
env.AddMethod(LookupSources)
|
||||
env.AddMethod(BuildFramework)
|
||||
env.AddMethod(BuildLibrary)
|
||||
env.AddMethod(BuildDependentLibraries)
|
||||
env.AddMethod(ConvertInoToCpp)
|
||||
return env
|
||||
|
||||
@@ -18,6 +18,7 @@ def cli(query, json_output): # pylint: disable=R0912
|
||||
|
||||
BOARDLIST_TPL = ("{type:<30} {mcu:<14} {frequency:<8} "
|
||||
" {flash:<7} {ram:<6} {name}")
|
||||
terminal_width, _ = click.get_terminal_size()
|
||||
|
||||
grpboards = {}
|
||||
for type_, data in get_boards().items():
|
||||
@@ -31,12 +32,14 @@ def cli(query, json_output): # pylint: disable=R0912
|
||||
if query.lower() not in search_data.lower():
|
||||
continue
|
||||
|
||||
click.echo("\nPlatform: %s" % platform)
|
||||
click.echo("-" * 75)
|
||||
click.echo("")
|
||||
click.echo("Platform: ", nl=False)
|
||||
click.secho(platform, bold=True)
|
||||
click.echo("-" * terminal_width)
|
||||
click.echo(BOARDLIST_TPL.format(
|
||||
type=click.style("Type", fg="cyan"), mcu="MCU",
|
||||
frequency="Frequency", flash="Flash", ram="RAM", name="Name"))
|
||||
click.echo("-" * 75)
|
||||
click.echo("-" * terminal_width)
|
||||
|
||||
for type_, data in sorted(boards.items(), key=lambda b: b[1]['name']):
|
||||
if query:
|
||||
|
||||
149
platformio/commands/ci.py
Normal file
@@ -0,0 +1,149 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import stat
|
||||
from glob import glob
|
||||
from os import chmod, getenv, makedirs, remove
|
||||
from os.path import abspath, basename, expanduser, isdir, isfile, join
|
||||
from shutil import copyfile, copytree, rmtree
|
||||
from tempfile import mkdtemp
|
||||
|
||||
import click
|
||||
|
||||
from platformio import app
|
||||
from platformio.commands.init import cli as cmd_init
|
||||
from platformio.commands.run import cli as cmd_run
|
||||
from platformio.exception import CIBuildEnvsEmpty
|
||||
from platformio.util import get_boards
|
||||
|
||||
|
||||
def validate_path(ctx, param, value): # pylint: disable=W0613
|
||||
invalid_path = None
|
||||
value = list(value)
|
||||
for i, p in enumerate(value):
|
||||
if p.startswith("~"):
|
||||
value[i] = expanduser(p)
|
||||
value[i] = abspath(value[i])
|
||||
if not glob(value[i]):
|
||||
invalid_path = p
|
||||
break
|
||||
try:
|
||||
assert invalid_path is None
|
||||
return value
|
||||
except AssertionError:
|
||||
raise click.BadParameter("Found invalid path: %s" % invalid_path)
|
||||
|
||||
|
||||
def validate_boards(ctx, param, value): # pylint: disable=W0613
|
||||
unknown_boards = set(value) - set(get_boards().keys())
|
||||
try:
|
||||
assert not unknown_boards
|
||||
return value
|
||||
except AssertionError:
|
||||
raise click.BadParameter(
|
||||
"%s. Please search for the board types using "
|
||||
"`platformio boards` command" % ", ".join(unknown_boards))
|
||||
|
||||
|
||||
@click.command("ci", short_help="Continuous Integration")
|
||||
@click.argument("src", nargs=-1, callback=validate_path)
|
||||
@click.option("--lib", "-l", multiple=True, callback=validate_path)
|
||||
@click.option("--exclude", multiple=True)
|
||||
@click.option("--board", "-b", multiple=True, callback=validate_boards)
|
||||
@click.option("--build-dir", default=mkdtemp,
|
||||
type=click.Path(exists=True, file_okay=False, dir_okay=True,
|
||||
writable=True, resolve_path=True))
|
||||
@click.option("--keep-build-dir", is_flag=True)
|
||||
@click.option("--project-conf",
|
||||
type=click.Path(exists=True, file_okay=True, dir_okay=False,
|
||||
readable=True, resolve_path=True))
|
||||
@click.option("--verbose", "-v", count=True, default=3)
|
||||
@click.pass_context
|
||||
def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913
|
||||
build_dir, keep_build_dir, project_conf, verbose):
|
||||
|
||||
if not src:
|
||||
src = getenv("PLATFORMIO_CI_SRC", "").split(":")
|
||||
if not src:
|
||||
raise click.BadParameter("Missing argument 'src'")
|
||||
|
||||
try:
|
||||
app.set_session_var("force_option", True)
|
||||
_clean_dir(build_dir)
|
||||
|
||||
for dir_name, patterns in dict(lib=lib, src=src).iteritems():
|
||||
if not patterns:
|
||||
continue
|
||||
contents = []
|
||||
for p in patterns:
|
||||
contents += glob(p)
|
||||
_copy_contents(join(build_dir, dir_name), contents)
|
||||
|
||||
if project_conf and isfile(project_conf):
|
||||
copyfile(project_conf, join(build_dir, "platformio.ini"))
|
||||
elif not board:
|
||||
raise CIBuildEnvsEmpty()
|
||||
|
||||
if exclude:
|
||||
_exclude_contents(build_dir, exclude)
|
||||
|
||||
# initialise project
|
||||
ctx.invoke(cmd_init, project_dir=build_dir, board=board,
|
||||
disable_auto_uploading=True)
|
||||
|
||||
# process project
|
||||
ctx.invoke(cmd_run, project_dir=build_dir, verbose=verbose)
|
||||
finally:
|
||||
if not keep_build_dir:
|
||||
rmtree(
|
||||
build_dir, onerror=lambda action, name, exc:
|
||||
(chmod(name, stat.S_IWRITE), remove(name))
|
||||
)
|
||||
|
||||
|
||||
def _clean_dir(dirpath):
|
||||
rmtree(dirpath)
|
||||
makedirs(dirpath)
|
||||
|
||||
|
||||
def _copy_contents(dst_dir, contents):
|
||||
items = {
|
||||
"dirs": set(),
|
||||
"files": set()
|
||||
}
|
||||
|
||||
for path in contents:
|
||||
if isdir(path):
|
||||
items['dirs'].add(path)
|
||||
elif isfile(path):
|
||||
items['files'].add(path)
|
||||
|
||||
dst_dir_name = basename(dst_dir)
|
||||
|
||||
if dst_dir_name == "src" and len(items['dirs']) == 1:
|
||||
copytree(list(items['dirs']).pop(), dst_dir)
|
||||
else:
|
||||
makedirs(dst_dir)
|
||||
for d in items['dirs']:
|
||||
copytree(d, join(dst_dir, basename(d)))
|
||||
|
||||
if not items['files']:
|
||||
return
|
||||
|
||||
if dst_dir_name == "lib":
|
||||
dst_dir = join(dst_dir, mkdtemp(dir=dst_dir))
|
||||
|
||||
for f in items['files']:
|
||||
copyfile(f, join(dst_dir, basename(f)))
|
||||
|
||||
|
||||
def _exclude_contents(dst_dir, patterns):
|
||||
contents = []
|
||||
for p in patterns:
|
||||
contents += glob(join(dst_dir, p))
|
||||
for path in contents:
|
||||
path = abspath(path)
|
||||
if isdir(path):
|
||||
rmtree(path)
|
||||
elif isfile(path):
|
||||
remove(path)
|
||||
@@ -8,46 +8,53 @@ from shutil import copyfile
|
||||
import click
|
||||
|
||||
from platformio import app, exception
|
||||
from platformio.ide.projectgenerator import ProjectGenerator
|
||||
from platformio.util import get_boards, get_source_dir
|
||||
|
||||
|
||||
def validate_boards(ctx, param, value): # pylint: disable=W0613
|
||||
unknown_boards = set(value) - set(get_boards().keys())
|
||||
try:
|
||||
assert not unknown_boards
|
||||
return value
|
||||
except AssertionError:
|
||||
raise click.BadParameter(
|
||||
"%s. Please search for the board types using "
|
||||
"`platformio boards` command" % ", ".join(unknown_boards))
|
||||
|
||||
|
||||
@click.command("init", short_help="Initialize new PlatformIO based project")
|
||||
@click.option("--project-dir", "-d", default=getcwd,
|
||||
type=click.Path(exists=True, file_okay=False, dir_okay=True,
|
||||
writable=True, resolve_path=True))
|
||||
@click.option("--board", "-b", multiple=True, metavar="TYPE")
|
||||
@click.option("--board", "-b", multiple=True, metavar="TYPE",
|
||||
callback=validate_boards)
|
||||
@click.option("--ide",
|
||||
type=click.Choice(ProjectGenerator.get_supported_ides()))
|
||||
@click.option("--disable-auto-uploading", is_flag=True)
|
||||
def cli(project_dir, board, disable_auto_uploading):
|
||||
|
||||
project_file = join(project_dir, "platformio.ini")
|
||||
src_dir = join(project_dir, "src")
|
||||
lib_dir = join(project_dir, "lib")
|
||||
if all([isfile(project_file), isdir(src_dir), isdir(lib_dir)]):
|
||||
raise exception.ProjectInitialized()
|
||||
|
||||
builtin_boards = set(get_boards().keys())
|
||||
if board and not set(board).issubset(builtin_boards):
|
||||
raise exception.UnknownBoard(
|
||||
", ".join(set(board).difference(builtin_boards)))
|
||||
@click.option("--env-prefix", default="")
|
||||
def cli(project_dir, board, ide, disable_auto_uploading, env_prefix):
|
||||
|
||||
# ask about auto-uploading
|
||||
if board and app.get_setting("enable_prompts"):
|
||||
disable_auto_uploading = not click.confirm(
|
||||
"\nWould you like to enable firmware auto-uploading when project "
|
||||
"Would you like to enable firmware auto-uploading when project "
|
||||
"is successfully built using `platformio run` command? \n"
|
||||
"Don't forget that you can upload firmware manually using "
|
||||
"`platformio run --target upload` command."
|
||||
)
|
||||
click.echo("")
|
||||
|
||||
if project_dir == getcwd():
|
||||
click.secho("\nThe current working directory", fg="yellow", nl=False)
|
||||
click.secho(" %s " % project_dir, fg="cyan", nl=False)
|
||||
click.secho(
|
||||
"will be used for the new project.\n"
|
||||
"will be used for project.\n"
|
||||
"You can specify another project directory via\n"
|
||||
"`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.\n",
|
||||
"`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.",
|
||||
fg="yellow"
|
||||
)
|
||||
click.echo("")
|
||||
|
||||
click.echo("The next files/directories will be created in %s" %
|
||||
click.style(project_dir, fg="cyan"))
|
||||
@@ -58,51 +65,75 @@ def cli(project_dir, board, disable_auto_uploading):
|
||||
click.echo("%s - Put here project specific or 3-rd party libraries" %
|
||||
click.style("lib", fg="cyan"))
|
||||
|
||||
if (not app.get_setting("enable_prompts") or
|
||||
click.confirm("Do you want to continue?")):
|
||||
|
||||
for d in (src_dir, lib_dir):
|
||||
if not isdir(d):
|
||||
makedirs(d)
|
||||
if not isfile(project_file):
|
||||
copyfile(join(get_source_dir(), "projectconftpl.ini"),
|
||||
project_file)
|
||||
if board:
|
||||
fill_project_envs(project_file, board, disable_auto_uploading)
|
||||
click.secho(
|
||||
"Project has been successfully initialized!\nUseful commands:\n"
|
||||
"`platformio run` - process/build project from the current "
|
||||
"directory\n"
|
||||
"`platformio run --target upload` or `platformio run -t upload` "
|
||||
"- upload firmware to embedded board\n"
|
||||
"`platformio run --target clean` - clean project (remove compiled "
|
||||
"files)",
|
||||
fg="green"
|
||||
)
|
||||
else:
|
||||
if (app.get_setting("enable_prompts") and
|
||||
not click.confirm("Do you want to continue?")):
|
||||
raise exception.AbortedByUser()
|
||||
|
||||
project_file = join(project_dir, "platformio.ini")
|
||||
src_dir = join(project_dir, "src")
|
||||
lib_dir = join(project_dir, "lib")
|
||||
|
||||
def fill_project_envs(project_file, board_types, disable_auto_uploading):
|
||||
for d in (src_dir, lib_dir):
|
||||
if not isdir(d):
|
||||
makedirs(d)
|
||||
|
||||
if not isfile(project_file):
|
||||
copyfile(join(get_source_dir(), "projectconftpl.ini"),
|
||||
project_file)
|
||||
|
||||
if board:
|
||||
fill_project_envs(
|
||||
project_file, board, disable_auto_uploading, env_prefix)
|
||||
|
||||
if ide:
|
||||
pg = ProjectGenerator(project_dir, ide, board[0] if board else None)
|
||||
pg.generate()
|
||||
|
||||
click.secho(
|
||||
"\nProject has been successfully initialized!\nUseful commands:\n"
|
||||
"`platformio run` - process/build project from the current "
|
||||
"directory\n"
|
||||
"`platformio run --target upload` or `platformio run -t upload` "
|
||||
"- upload firmware to embedded board\n"
|
||||
"`platformio run --target clean` - clean project (remove compiled "
|
||||
"files)",
|
||||
fg="green"
|
||||
)
|
||||
|
||||
|
||||
def fill_project_envs(project_file, board_types, disable_auto_uploading,
|
||||
env_prefix):
|
||||
builtin_boards = get_boards()
|
||||
content = []
|
||||
for type_ in board_types:
|
||||
if type_ not in builtin_boards:
|
||||
continue
|
||||
else:
|
||||
content.append("")
|
||||
used_envs = []
|
||||
|
||||
with open(project_file) as f:
|
||||
used_envs = [l.strip() for l in f.read().splitlines() if
|
||||
l.strip().startswith("[env:")]
|
||||
|
||||
for type_ in board_types:
|
||||
data = builtin_boards[type_]
|
||||
env_name = "[env:%s%s]" % (env_prefix, type_)
|
||||
|
||||
if env_name in used_envs:
|
||||
continue
|
||||
|
||||
content.append("")
|
||||
content.append(env_name)
|
||||
content.append("platform = %s" % data['platform'])
|
||||
|
||||
# find default framework for board
|
||||
frameworks = data.get("frameworks")
|
||||
content.append("[env:autogen_%s]" % type_)
|
||||
content.append("platform = %s" % data['platform'])
|
||||
if frameworks:
|
||||
content.append("framework = %s" % frameworks[0])
|
||||
content.append("board = %s" % type_)
|
||||
|
||||
content.append("board = %s" % type_)
|
||||
content.append("%stargets = upload" % ("# " if disable_auto_uploading
|
||||
else ""))
|
||||
|
||||
if not content:
|
||||
return
|
||||
|
||||
with open(project_file, "a") as f:
|
||||
content.append("")
|
||||
f.write("\n".join(content))
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import click
|
||||
|
||||
from platformio.platforms.base import PlatformFactory
|
||||
|
||||
|
||||
@click.command("install", short_help="Install new platforms")
|
||||
@click.argument("platforms", nargs=-1)
|
||||
@click.option("--with-package", multiple=True, metavar="<package>")
|
||||
@click.option("--without-package", multiple=True, metavar="<package>")
|
||||
@click.option("--skip-default-package", is_flag=True)
|
||||
def cli(platforms, with_package, without_package, skip_default_package):
|
||||
|
||||
for platform in platforms:
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
if p.install(with_package, without_package, skip_default_package):
|
||||
click.secho("The platform '%s' has been successfully installed!" %
|
||||
platform, fg="green")
|
||||
@@ -7,7 +7,7 @@ import click
|
||||
|
||||
from platformio import app, exception
|
||||
from platformio.libmanager import LibraryManager
|
||||
from platformio.util import get_api_result, get_lib_dir
|
||||
from platformio.util import get_api_result
|
||||
|
||||
LIBLIST_TPL = ("[{id:^14}] {name:<25} {compatibility:<30} "
|
||||
"\"{authornames}\": {description}")
|
||||
@@ -21,7 +21,9 @@ def echo_liblist_header():
|
||||
authornames="Authors",
|
||||
description="Description"
|
||||
))
|
||||
click.echo("-" * 85)
|
||||
|
||||
terminal_width, _ = click.get_terminal_size()
|
||||
click.echo("-" * terminal_width)
|
||||
|
||||
|
||||
def echo_liblist_item(item):
|
||||
@@ -98,7 +100,7 @@ def lib_search(query, **filters):
|
||||
@click.option("-v", "--version")
|
||||
@click.pass_context
|
||||
def lib_install(ctx, libid, version):
|
||||
lm = LibraryManager(get_lib_dir())
|
||||
lm = LibraryManager()
|
||||
for id_ in libid:
|
||||
click.echo(
|
||||
"Installing library [ %s ]:" % click.style(str(id_), fg="green"))
|
||||
@@ -140,14 +142,29 @@ def lib_install_dependency(ctx, data):
|
||||
query.append('+"%s"' % data[key])
|
||||
|
||||
result = get_api_result("/lib/search", dict(query=" ".join(query)))
|
||||
assert result['total'] == 1
|
||||
ctx.invoke(lib_install, libid=[result['items'][0]['id']])
|
||||
assert result['total'] > 0
|
||||
|
||||
if result['total'] == 1 or not app.get_setting("enable_prompts"):
|
||||
ctx.invoke(lib_install, libid=[result['items'][0]['id']])
|
||||
else:
|
||||
click.secho(
|
||||
"Conflict: More then one dependent libraries have been found "
|
||||
"by request %s:" % json.dumps(data), fg="red")
|
||||
|
||||
echo_liblist_header()
|
||||
for item in result['items']:
|
||||
echo_liblist_item(item)
|
||||
|
||||
deplib_id = click.prompt(
|
||||
"Please choose one dependent library ID",
|
||||
type=click.Choice([str(i['id']) for i in result['items']]))
|
||||
ctx.invoke(lib_install, libid=[int(deplib_id)])
|
||||
|
||||
|
||||
@cli.command("uninstall", short_help="Uninstall libraries")
|
||||
@click.argument("libid", type=click.INT, nargs=-1)
|
||||
def lib_uninstall(libid):
|
||||
lm = LibraryManager(get_lib_dir())
|
||||
lm = LibraryManager()
|
||||
for id_ in libid:
|
||||
info = lm.get_info(id_)
|
||||
if lm.uninstall(id_):
|
||||
@@ -158,7 +175,7 @@ def lib_uninstall(libid):
|
||||
@cli.command("list", short_help="List installed libraries")
|
||||
@click.option("--json-output", is_flag=True)
|
||||
def lib_list(json_output):
|
||||
lm = LibraryManager(get_lib_dir())
|
||||
lm = LibraryManager()
|
||||
items = lm.get_installed().values()
|
||||
|
||||
if json_output:
|
||||
@@ -177,7 +194,7 @@ def lib_list(json_output):
|
||||
@cli.command("show", short_help="Show details about installed library")
|
||||
@click.argument("libid", type=click.INT)
|
||||
def lib_show(libid):
|
||||
lm = LibraryManager(get_lib_dir())
|
||||
lm = LibraryManager()
|
||||
info = lm.get_info(libid)
|
||||
click.secho(info['name'], fg="cyan")
|
||||
click.echo("-" * len(info['name']))
|
||||
@@ -209,13 +226,18 @@ def lib_show(libid):
|
||||
|
||||
|
||||
@cli.command("update", short_help="Update installed libraries")
|
||||
@click.argument("libid", type=click.INT, nargs=-1, required=False,
|
||||
metavar="[LIBRARY_ID]")
|
||||
@click.pass_context
|
||||
def lib_update(ctx):
|
||||
lm = LibraryManager(get_lib_dir())
|
||||
def lib_update(ctx, libid):
|
||||
lm = LibraryManager()
|
||||
for id_, latest_version in (lm.get_latest_versions() or {}).items():
|
||||
if libid and int(id_) not in libid:
|
||||
continue
|
||||
|
||||
info = lm.get_info(int(id_))
|
||||
|
||||
click.echo("Updating [ %s ] %s library:" % (
|
||||
click.echo("Updating [ %s ] %s library:" % (
|
||||
click.style(id_, fg="yellow"),
|
||||
click.style(info['name'], fg="cyan")))
|
||||
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import json
|
||||
|
||||
import click
|
||||
|
||||
from platformio.platforms.base import PlatformFactory
|
||||
|
||||
|
||||
@click.command("list", short_help="List installed platforms")
|
||||
@click.option("--json-output", is_flag=True)
|
||||
def cli(json_output):
|
||||
|
||||
installed_platforms = PlatformFactory.get_platforms(
|
||||
installed=True).keys()
|
||||
installed_platforms.sort()
|
||||
|
||||
data = []
|
||||
for platform in installed_platforms:
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
data.append({
|
||||
"name": platform,
|
||||
"packages": p.get_installed_packages()
|
||||
})
|
||||
|
||||
if json_output:
|
||||
click.echo(json.dumps(data))
|
||||
else:
|
||||
for item in data:
|
||||
click.echo("{name:<20} with packages: {pkgs}".format(
|
||||
name=click.style(item['name'], fg="cyan"),
|
||||
pkgs=", ".join(item['packages'])
|
||||
))
|
||||
155
platformio/commands/platforms.py
Normal file
@@ -0,0 +1,155 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import json
|
||||
from datetime import datetime
|
||||
|
||||
import click
|
||||
|
||||
from platformio import app
|
||||
from platformio.exception import PlatformNotInstalledYet
|
||||
from platformio.pkgmanager import PackageManager
|
||||
from platformio.platforms.base import PlatformFactory
|
||||
|
||||
|
||||
@click.group(short_help="Platforms and Packages Manager")
|
||||
def cli():
|
||||
pass
|
||||
|
||||
|
||||
@cli.command("install", short_help="Install new platforms")
|
||||
@click.argument("platforms", nargs=-1, required=True)
|
||||
@click.option("--with-package", multiple=True, metavar="<package>")
|
||||
@click.option("--without-package", multiple=True, metavar="<package>")
|
||||
@click.option("--skip-default-package", is_flag=True)
|
||||
def platforms_install(platforms, with_package, without_package,
|
||||
skip_default_package):
|
||||
for platform in platforms:
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
if p.install(with_package, without_package, skip_default_package):
|
||||
click.secho("The platform '%s' has been successfully installed!" %
|
||||
platform, fg="green")
|
||||
|
||||
|
||||
@cli.command("list", short_help="List installed platforms")
|
||||
@click.option("--json-output", is_flag=True)
|
||||
def platforms_list(json_output):
|
||||
|
||||
installed_platforms = PlatformFactory.get_platforms(
|
||||
installed=True).keys()
|
||||
installed_platforms.sort()
|
||||
|
||||
data = []
|
||||
for platform in installed_platforms:
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
data.append({
|
||||
"name": platform,
|
||||
"packages": p.get_installed_packages()
|
||||
})
|
||||
|
||||
if json_output:
|
||||
click.echo(json.dumps(data))
|
||||
else:
|
||||
for item in data:
|
||||
click.echo("{name:<20} with packages: {pkgs}".format(
|
||||
name=click.style(item['name'], fg="cyan"),
|
||||
pkgs=", ".join(item['packages'])
|
||||
))
|
||||
|
||||
|
||||
@cli.command("search", short_help="Search for development platforms")
|
||||
@click.argument("query", required=False)
|
||||
@click.option("--json-output", is_flag=True)
|
||||
def platforms_search(query, json_output):
|
||||
|
||||
data = []
|
||||
platforms = PlatformFactory.get_platforms().keys()
|
||||
platforms.sort()
|
||||
for platform in platforms:
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
type_ = p.get_type()
|
||||
description = p.get_description()
|
||||
|
||||
if query == "all":
|
||||
query = ""
|
||||
|
||||
search_data = "%s %s %s" % (type_, description, p.get_packages())
|
||||
if query and query.lower() not in search_data.lower():
|
||||
continue
|
||||
|
||||
data.append({
|
||||
"type": type_,
|
||||
"description": description,
|
||||
"packages": p.get_packages()
|
||||
})
|
||||
|
||||
if json_output:
|
||||
click.echo(json.dumps(data))
|
||||
else:
|
||||
terminal_width, _ = click.get_terminal_size()
|
||||
for item in data:
|
||||
click.secho(item['type'], fg="cyan", nl=False)
|
||||
click.echo(" (available packages: %s)" % ", ".join(
|
||||
item.get("packages").keys()))
|
||||
click.echo("-" * terminal_width)
|
||||
click.echo(item['description'])
|
||||
click.echo()
|
||||
|
||||
|
||||
@cli.command("show", short_help="Show details about installed platform")
|
||||
@click.argument("platform")
|
||||
@click.pass_context
|
||||
def platforms_show(ctx, platform):
|
||||
|
||||
installed_platforms = PlatformFactory.get_platforms(
|
||||
installed=True).keys()
|
||||
|
||||
if platform not in installed_platforms:
|
||||
if (not app.get_setting("enable_prompts") or
|
||||
click.confirm("The platform '%s' has not been installed yet. "
|
||||
"Would you like to install it now?" % platform)):
|
||||
ctx.invoke(platforms_install, platforms=[platform])
|
||||
else:
|
||||
raise PlatformNotInstalledYet(platform)
|
||||
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
click.echo("{name:<20} - {description} [ {url} ]".format(
|
||||
name=click.style(p.get_type(), fg="cyan"),
|
||||
description=p.get_description(), url=p.get_vendor_url()))
|
||||
|
||||
installed_packages = PackageManager.get_installed()
|
||||
for name in p.get_installed_packages():
|
||||
data = installed_packages[name]
|
||||
pkgalias = p.get_pkg_alias(name)
|
||||
click.echo("----------")
|
||||
click.echo("Package: %s" % click.style(name, fg="yellow"))
|
||||
if pkgalias:
|
||||
click.echo("Alias: %s" % pkgalias)
|
||||
click.echo("Version: %d" % int(data['version']))
|
||||
click.echo("Installed: %s" % datetime.fromtimestamp(
|
||||
data['time']).strftime("%Y-%m-%d %H:%M:%S"))
|
||||
|
||||
|
||||
@cli.command("uninstall", short_help="Uninstall platforms")
|
||||
@click.argument("platforms", nargs=-1, required=True)
|
||||
def platforms_uninstall(platforms):
|
||||
|
||||
for platform in platforms:
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
if p.uninstall():
|
||||
click.secho("The platform '%s' has been successfully "
|
||||
"uninstalled!" % platform, fg="green")
|
||||
|
||||
|
||||
@cli.command("update", short_help="Update installed Platforms and Packages")
|
||||
def platforms_update():
|
||||
|
||||
installed_platforms = PlatformFactory.get_platforms(
|
||||
installed=True).keys()
|
||||
installed_platforms.sort()
|
||||
|
||||
for platform in installed_platforms:
|
||||
click.echo("\nPlatform %s" % click.style(platform, fg="cyan"))
|
||||
click.echo("--------")
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
p.update()
|
||||
@@ -2,14 +2,19 @@
|
||||
# See LICENSE for details.
|
||||
|
||||
from datetime import datetime
|
||||
from os.path import getmtime, isdir, join
|
||||
from hashlib import sha1
|
||||
from os import getcwd, makedirs, walk
|
||||
from os.path import getmtime, isdir, isfile, join
|
||||
from shutil import rmtree
|
||||
from time import time
|
||||
|
||||
import click
|
||||
|
||||
from platformio import app, exception, telemetry, util
|
||||
from platformio.commands.install import cli as cmd_install
|
||||
from platformio.commands.lib import lib_install as cmd_lib_install
|
||||
from platformio.commands.platforms import \
|
||||
platforms_install as cmd_platforms_install
|
||||
from platformio.libmanager import LibraryManager
|
||||
from platformio.platforms.base import PlatformFactory
|
||||
|
||||
|
||||
@@ -17,110 +22,217 @@ from platformio.platforms.base import PlatformFactory
|
||||
@click.option("--environment", "-e", multiple=True, metavar="<environment>")
|
||||
@click.option("--target", "-t", multiple=True, metavar="<target>")
|
||||
@click.option("--upload-port", metavar="<upload port>")
|
||||
@click.option("--project-dir", default=getcwd,
|
||||
type=click.Path(exists=True, file_okay=False, dir_okay=True,
|
||||
writable=True, resolve_path=True))
|
||||
@click.option("--verbose", "-v", count=True, default=3)
|
||||
@click.pass_context
|
||||
def cli(ctx, environment, target, upload_port):
|
||||
def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
|
||||
project_dir, verbose):
|
||||
with util.cd(project_dir):
|
||||
config = util.get_project_config()
|
||||
|
||||
config = util.get_project_config()
|
||||
if not config.sections():
|
||||
raise exception.ProjectEnvsNotAvailable()
|
||||
|
||||
if not config.sections():
|
||||
raise exception.ProjectEnvsNotAvailable()
|
||||
unknown = set(environment) - set([s[4:] for s in config.sections()])
|
||||
if unknown:
|
||||
raise exception.UnknownEnvNames(", ".join(unknown))
|
||||
|
||||
unknown = set(environment) - set([s[4:] for s in config.sections()])
|
||||
if unknown:
|
||||
raise exception.UnknownEnvNames(", ".join(unknown))
|
||||
# clean obsolete .pioenvs dir
|
||||
_clean_pioenvs_dir()
|
||||
|
||||
# remove ".pioenvs" if project config is modified
|
||||
_pioenvs_dir = util.get_pioenvs_dir()
|
||||
if (isdir(_pioenvs_dir) and
|
||||
getmtime(join(util.get_project_dir(), "platformio.ini")) >
|
||||
getmtime(_pioenvs_dir)):
|
||||
rmtree(_pioenvs_dir)
|
||||
results = []
|
||||
for section in config.sections():
|
||||
# skip main configuration section
|
||||
if section == "platformio":
|
||||
continue
|
||||
|
||||
found_error = False
|
||||
_first_done = False
|
||||
for section in config.sections():
|
||||
# skip main configuration section
|
||||
if section == "platformio":
|
||||
continue
|
||||
elif section[:4] != "env:":
|
||||
raise exception.InvalidEnvName(section)
|
||||
if not section.startswith("env:"):
|
||||
raise exception.InvalidEnvName(section)
|
||||
|
||||
envname = section[4:]
|
||||
if environment and envname not in environment:
|
||||
# echo("Skipped %s environment" % style(envname, fg="yellow"))
|
||||
continue
|
||||
envname = section[4:]
|
||||
if environment and envname not in environment:
|
||||
# echo("Skipped %s environment" % style(envname, fg="yellow"))
|
||||
continue
|
||||
|
||||
options = {}
|
||||
for k, v in config.items(section):
|
||||
options[k] = v
|
||||
if results:
|
||||
click.echo()
|
||||
|
||||
if _first_done:
|
||||
click.echo()
|
||||
options = {}
|
||||
for k, v in config.items(section):
|
||||
options[k] = v
|
||||
|
||||
if not process_environment(ctx, envname, options, target, upload_port):
|
||||
found_error = True
|
||||
_first_done = True
|
||||
ep = EnvironmentProcessor(
|
||||
ctx, envname, options, target, upload_port, verbose)
|
||||
results.append(ep.process())
|
||||
|
||||
if found_error:
|
||||
raise exception.ReturnErrorCode()
|
||||
if not all(results):
|
||||
raise exception.ReturnErrorCode()
|
||||
|
||||
|
||||
def process_environment(ctx, name, options, targets, upload_port):
|
||||
terminal_width, _ = click.get_terminal_size()
|
||||
start_time = time()
|
||||
class EnvironmentProcessor(object):
|
||||
|
||||
click.echo("[%s] Processing %s (%s)" % (
|
||||
datetime.now().strftime("%c"),
|
||||
click.style(name, fg="cyan", bold=True),
|
||||
", ".join(["%s: %s" % (k, v) for k, v in options.iteritems()])
|
||||
))
|
||||
click.secho("-" * terminal_width, bold=True)
|
||||
RENAMED_OPTIONS = {
|
||||
"INSTALL_LIBS": "LIB_INSTALL",
|
||||
"IGNORE_LIBS": "LIB_IGNORE",
|
||||
"USE_LIBS": "LIB_USE",
|
||||
"LDF_CYCLIC": "LIB_DFCYCLIC",
|
||||
"SRCBUILD_FLAGS": "SRC_BUILD_FLAGS"
|
||||
}
|
||||
|
||||
result = _run_environment(ctx, name, options, targets, upload_port)
|
||||
def __init__(self, cmd_ctx, name, options, # pylint: disable=R0913
|
||||
targets, upload_port, verbose):
|
||||
self.cmd_ctx = cmd_ctx
|
||||
self.name = name
|
||||
self.options = self._validate_options(options)
|
||||
self.targets = targets
|
||||
self.upload_port = upload_port
|
||||
self.verbose_level = int(verbose)
|
||||
|
||||
is_error = result['returncode'] != 0
|
||||
summary_text = " Took %.2f seconds " % (time() - start_time)
|
||||
half_line = "=" * ((terminal_width - len(summary_text) - 10) / 2)
|
||||
click.echo("%s [%s]%s%s" % (
|
||||
half_line,
|
||||
(click.style(" ERROR ", fg="red", bold=True)
|
||||
if is_error else click.style("SUCCESS", fg="green", bold=True)),
|
||||
summary_text,
|
||||
half_line
|
||||
), err=is_error)
|
||||
def process(self):
|
||||
terminal_width, _ = click.get_terminal_size()
|
||||
start_time = time()
|
||||
|
||||
return not is_error
|
||||
click.echo("[%s] Processing %s (%s)" % (
|
||||
datetime.now().strftime("%c"),
|
||||
click.style(self.name, fg="cyan", bold=True),
|
||||
", ".join(["%s: %s" % (k, v) for k, v in self.options.iteritems()])
|
||||
))
|
||||
click.secho("-" * terminal_width, bold=True)
|
||||
|
||||
result = self._run()
|
||||
|
||||
is_error = result['returncode'] != 0
|
||||
summary_text = " Took %.2f seconds " % (time() - start_time)
|
||||
half_line = "=" * ((terminal_width - len(summary_text) - 10) / 2)
|
||||
click.echo("%s [%s]%s%s" % (
|
||||
half_line,
|
||||
(click.style(" ERROR ", fg="red", bold=True)
|
||||
if is_error else click.style("SUCCESS", fg="green", bold=True)),
|
||||
summary_text,
|
||||
half_line
|
||||
), err=is_error)
|
||||
|
||||
return not is_error
|
||||
|
||||
def _validate_options(self, options):
|
||||
result = {}
|
||||
for k, v in options.items():
|
||||
_k = k.upper()
|
||||
# process obsolete options
|
||||
if _k in self.RENAMED_OPTIONS:
|
||||
click.secho(
|
||||
"Warning! `%s` option is deprecated and will be "
|
||||
"removed in the next release! Please use "
|
||||
"`%s` instead." % (
|
||||
k, self.RENAMED_OPTIONS[_k].lower()),
|
||||
fg="yellow"
|
||||
)
|
||||
k = self.RENAMED_OPTIONS[_k].lower()
|
||||
result[k] = v
|
||||
return result
|
||||
|
||||
def _get_build_variables(self):
|
||||
variables = ["PIOENV=" + self.name]
|
||||
if self.upload_port:
|
||||
variables.append("UPLOAD_PORT=%s" % self.upload_port)
|
||||
for k, v in self.options.items():
|
||||
k = k.upper()
|
||||
if k == "TARGETS" or (k == "UPLOAD_PORT" and self.upload_port):
|
||||
continue
|
||||
variables.append("%s=%s" % (k, v))
|
||||
return variables
|
||||
|
||||
def _get_build_targets(self):
|
||||
targets = []
|
||||
if self.targets:
|
||||
targets = [t for t in self.targets]
|
||||
elif "targets" in self.options:
|
||||
targets = self.options['targets'].split()
|
||||
return targets
|
||||
|
||||
def _run(self):
|
||||
if "platform" not in self.options:
|
||||
raise exception.UndefinedEnvPlatform(self.name)
|
||||
|
||||
platform = self.options['platform']
|
||||
build_vars = self._get_build_variables()
|
||||
build_targets = self._get_build_targets()
|
||||
|
||||
telemetry.on_run_environment(self.options, build_targets)
|
||||
|
||||
# install platform and libs dependencies
|
||||
_autoinstall_platform(self.cmd_ctx, platform)
|
||||
if "lib_install" in self.options:
|
||||
_autoinstall_libs(self.cmd_ctx, self.options['lib_install'])
|
||||
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
return p.run(build_vars, build_targets, self.verbose_level)
|
||||
|
||||
|
||||
def _run_environment(ctx, name, options, targets, upload_port):
|
||||
variables = ["PIOENV=" + name]
|
||||
if upload_port:
|
||||
variables.append("UPLOAD_PORT=%s" % upload_port)
|
||||
for k, v in options.items():
|
||||
k = k.upper()
|
||||
if k == "TARGETS" or (k == "UPLOAD_PORT" and upload_port):
|
||||
continue
|
||||
variables.append("%s=%s" % (k.upper(), v))
|
||||
|
||||
envtargets = []
|
||||
if targets:
|
||||
envtargets = [t for t in targets]
|
||||
elif "targets" in options:
|
||||
envtargets = options['targets'].split()
|
||||
|
||||
if "platform" not in options:
|
||||
raise exception.UndefinedEnvPlatform(name)
|
||||
platform = options['platform']
|
||||
|
||||
telemetry.on_run_environment(options, envtargets)
|
||||
|
||||
def _autoinstall_platform(ctx, platform):
|
||||
installed_platforms = PlatformFactory.get_platforms(
|
||||
installed=True).keys()
|
||||
if (platform not in installed_platforms and (
|
||||
not app.get_setting("enable_prompts") or
|
||||
click.confirm("The platform '%s' has not been installed yet. "
|
||||
"Would you like to install it now?" % platform))):
|
||||
ctx.invoke(cmd_install, platforms=[platform])
|
||||
ctx.invoke(cmd_platforms_install, platforms=[platform])
|
||||
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
return p.run(variables, envtargets)
|
||||
|
||||
def _autoinstall_libs(ctx, libids_list):
|
||||
require_libs = [int(l.strip()) for l in libids_list.split(",")]
|
||||
installed_libs = [
|
||||
l['id'] for l in LibraryManager().get_installed().values()
|
||||
]
|
||||
|
||||
not_intalled_libs = set(require_libs) - set(installed_libs)
|
||||
if not require_libs or not not_intalled_libs:
|
||||
return
|
||||
|
||||
if (not app.get_setting("enable_prompts") or
|
||||
click.confirm(
|
||||
"The libraries with IDs '%s' have not been installed yet. "
|
||||
"Would you like to install them now?" %
|
||||
", ".join([str(i) for i in not_intalled_libs])
|
||||
)):
|
||||
ctx.invoke(cmd_lib_install, libid=not_intalled_libs)
|
||||
|
||||
|
||||
def _clean_pioenvs_dir():
|
||||
pioenvs_dir = util.get_pioenvs_dir()
|
||||
structhash_file = join(pioenvs_dir, "structure.hash")
|
||||
proj_hash = calculate_project_hash()
|
||||
|
||||
# if project's config is modified
|
||||
if (isdir(pioenvs_dir) and
|
||||
getmtime(join(util.get_project_dir(), "platformio.ini")) >
|
||||
getmtime(pioenvs_dir)):
|
||||
rmtree(pioenvs_dir)
|
||||
|
||||
# check project structure
|
||||
if isdir(pioenvs_dir) and isfile(structhash_file):
|
||||
with open(structhash_file) as f:
|
||||
if f.read() == proj_hash:
|
||||
return
|
||||
rmtree(pioenvs_dir)
|
||||
|
||||
if not isdir(pioenvs_dir):
|
||||
makedirs(pioenvs_dir)
|
||||
|
||||
with open(structhash_file, "w") as f:
|
||||
f.write(proj_hash)
|
||||
|
||||
|
||||
def calculate_project_hash():
|
||||
structure = []
|
||||
for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()):
|
||||
if not isdir(d):
|
||||
continue
|
||||
for root, _, files in walk(d):
|
||||
for f in files:
|
||||
path = join(root, f)
|
||||
if not any([s in path for s in (".git", ".svn")]):
|
||||
structure.append(path)
|
||||
return sha1(",".join(sorted(structure))).hexdigest() if structure else ""
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import json
|
||||
|
||||
import click
|
||||
|
||||
from platformio.platforms.base import PlatformFactory
|
||||
|
||||
|
||||
@click.command("search", short_help="Search for development platforms")
|
||||
@click.argument("query", required=False)
|
||||
@click.option("--json-output", is_flag=True)
|
||||
def cli(query, json_output):
|
||||
|
||||
data = []
|
||||
platforms = PlatformFactory.get_platforms().keys()
|
||||
platforms.sort()
|
||||
for platform in platforms:
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
type_ = p.get_type()
|
||||
description = p.get_description()
|
||||
|
||||
if query == "all":
|
||||
query = ""
|
||||
|
||||
search_data = "%s %s %s" % (type_, description, p.get_packages())
|
||||
if query and query.lower() not in search_data.lower():
|
||||
continue
|
||||
|
||||
data.append({
|
||||
"type": type_,
|
||||
"description": description,
|
||||
"packages": p.get_packages()
|
||||
})
|
||||
|
||||
if json_output:
|
||||
click.echo(json.dumps(data))
|
||||
else:
|
||||
for item in data:
|
||||
click.secho(item['type'], fg="cyan", nl=False)
|
||||
click.echo(" (available packages: %s)" % ", ".join(
|
||||
item.get("packages").keys()))
|
||||
click.secho("-" * len(item['type']), fg="cyan")
|
||||
click.echo(item['description'])
|
||||
click.echo()
|
||||
@@ -25,7 +25,7 @@ def serialports_list(json_output):
|
||||
|
||||
for item in get_serialports():
|
||||
click.secho(item['port'], fg="cyan")
|
||||
click.echo("----------")
|
||||
click.echo("-" * len(item['port']))
|
||||
click.echo("Hardware ID: %s" % item['hwid'])
|
||||
click.echo("Description: %s" % item['description'])
|
||||
click.echo("")
|
||||
|
||||
@@ -16,6 +16,7 @@ def cli():
|
||||
def settings_get(name):
|
||||
|
||||
list_tpl = "{name:<40} {value:<35} {description}"
|
||||
terminal_width, _ = click.get_terminal_size()
|
||||
|
||||
click.echo(list_tpl.format(
|
||||
name=click.style("Name", fg="cyan"),
|
||||
@@ -23,7 +24,7 @@ def settings_get(name):
|
||||
click.style(" [Default]", fg="yellow")),
|
||||
description="Description"
|
||||
))
|
||||
click.echo("-" * 90)
|
||||
click.echo("-" * terminal_width)
|
||||
|
||||
for _name, _data in sorted(app.DEFAULT_SETTINGS.items()):
|
||||
if name and name != _name:
|
||||
|
||||
@@ -1,46 +0,0 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
import click
|
||||
|
||||
from platformio import app
|
||||
from platformio.commands.install import cli as cmd_install
|
||||
from platformio.exception import PlatformNotInstalledYet
|
||||
from platformio.pkgmanager import PackageManager
|
||||
from platformio.platforms.base import PlatformFactory
|
||||
|
||||
|
||||
@click.command("show", short_help="Show details about installed platform")
|
||||
@click.argument("platform")
|
||||
@click.pass_context
|
||||
def cli(ctx, platform):
|
||||
|
||||
installed_platforms = PlatformFactory.get_platforms(
|
||||
installed=True).keys()
|
||||
|
||||
if platform not in installed_platforms:
|
||||
if (not app.get_setting("enable_prompts") or
|
||||
click.confirm("The platform '%s' has not been installed yet. "
|
||||
"Would you like to install it now?" % platform)):
|
||||
ctx.invoke(cmd_install, platforms=[platform])
|
||||
else:
|
||||
raise PlatformNotInstalledYet(platform)
|
||||
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
click.echo("{name:<20} - {description} [ {url} ]".format(
|
||||
name=click.style(p.get_type(), fg="cyan"),
|
||||
description=p.get_description(), url=p.get_vendor_url()))
|
||||
|
||||
installed_packages = PackageManager.get_installed()
|
||||
for name in p.get_installed_packages():
|
||||
data = installed_packages[name]
|
||||
pkgalias = p.get_pkg_alias(name)
|
||||
click.echo("----------")
|
||||
click.echo("Package: %s" % click.style(name, fg="yellow"))
|
||||
if pkgalias:
|
||||
click.echo("Alias: %s" % pkgalias)
|
||||
click.echo("Version: %d" % int(data['version']))
|
||||
click.echo("Installed: %s" % datetime.fromtimestamp(
|
||||
data['time']).strftime("%Y-%m-%d %H:%M:%S"))
|
||||