Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
49d5994628 | ||
|
|
e488d53950 | ||
|
|
e6be7ab3b5 | ||
|
|
59505cb8f3 | ||
|
|
5761cea47e | ||
|
|
d27f9a9d09 | ||
|
|
e43635bf9b | ||
|
|
3813614d31 | ||
|
|
9a6189d7cd | ||
|
|
132f2d20fd | ||
|
|
c96ae1f773 | ||
|
|
45905d0992 | ||
|
|
076696cde1 | ||
|
|
25781c7631 | ||
|
|
99649614c5 | ||
|
|
7a6e8279e4 | ||
|
|
b79a79d423 | ||
|
|
5a91d0bf1b | ||
|
|
b9d14918f3 | ||
|
|
5d6b2e0eb6 | ||
|
|
3d7c3a0c7a | ||
|
|
2f7f7dcd6a | ||
|
|
5b8c6c4d56 | ||
|
|
6af7fd8007 | ||
|
|
bfb801acef | ||
|
|
9379c3cb39 | ||
|
|
d66e8fe7af | ||
|
|
b85303c12a | ||
|
|
60e3d7450f | ||
|
|
4cd294ef57 | ||
|
|
890acbc80e | ||
|
|
de1cce41b0 | ||
|
|
e20f6abef4 | ||
|
|
fa11f5d613 | ||
|
|
1e0adcfdc4 | ||
|
|
d5c852d329 | ||
|
|
c4e42c88fe | ||
|
|
4b93ec0b0b | ||
|
|
21b01c8949 | ||
|
|
76415b930f | ||
|
|
88ad2a1626 | ||
|
|
94c459258c | ||
|
|
e1b7810465 | ||
|
|
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 | ||
|
|
50875ff74b |
76
HISTORY.rst
@@ -1,6 +1,69 @@
|
||||
Release History
|
||||
===============
|
||||
|
||||
2.2.2 (2015-07-30)
|
||||
------------------
|
||||
|
||||
* Integration with `Atom IDE <http://docs.platformio.org/en/latest/ide/atom.html>`__
|
||||
* Support for off-line/unpublished/private libraries
|
||||
(`issue #260 <https://github.com/platformio/platformio/issues/260>`_)
|
||||
* Disable project auto-clean while building/uploading firmware using
|
||||
`platformio run --disable-auto-clean <http://docs.platformio.org/en/latest/userguide/cmd_run.html#cmdoption--disable-auto-clean>`_ option
|
||||
(`issue #255 <https://github.com/platformio/platformio/issues/255>`_)
|
||||
* Show internal errors from "Miniterm" using `platformio serialports monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`__ command
|
||||
(`issue #257 <https://github.com/platformio/platformio/issues/257>`_)
|
||||
* Fixed `platformio serialports monitor --help <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`__ information with HEX char for hotkeys
|
||||
(`issue #253 <https://github.com/platformio/platformio/issues/253>`_)
|
||||
* Handle "OSError: [Errno 13] Permission denied" for PlatformIO installer script
|
||||
(`issue #254 <https://github.com/platformio/platformio/issues/254>`_)
|
||||
|
||||
2.2.1 (2015-07-17)
|
||||
------------------
|
||||
|
||||
* Project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__
|
||||
(`issue #132 <https://github.com/platformio/platformio/issues/132>`_)
|
||||
* Updated ``tool-bossac`` package to 1.5 version for `atmelsam <http://docs.platformio.org/en/latest/platforms/atmelsam.html>`__ platform
|
||||
(`issue #251 <https://github.com/platformio/platformio/issues/251>`_)
|
||||
* Updated ``sdk-esp8266`` package for `espressif <http://docs.platformio.org/en/latest/platforms/espressif.html>`__ platform
|
||||
* Fixed incorrect arguments handling for `platformio serialports monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ command
|
||||
(`issue #248 <https://github.com/platformio/platformio/issues/248>`_)
|
||||
|
||||
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)
|
||||
------------------
|
||||
|
||||
@@ -37,9 +100,8 @@ Release History
|
||||
2.0.1 (2015-05-27)
|
||||
------------------
|
||||
|
||||
* Handle new environment variables
|
||||
* Handle new environment variable
|
||||
`PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`_
|
||||
and `PLATFORMIO_LDF_CYCLIC <http://docs.platformio.org/en/latest/envvars.html#platformio-ldf-cyclic>`_
|
||||
* 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
|
||||
@@ -79,11 +141,11 @@ Release History
|
||||
(`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
|
||||
`install_libs <http://docs.platformio.org/en/latest/projectconf.html#install-libs>`_
|
||||
`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
|
||||
`use_libs <http://docs.platformio.org/en/latest/projectconf.html#use-libs>`_
|
||||
`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
|
||||
@@ -271,7 +333,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
|
||||
@@ -439,10 +501,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>`_
|
||||
|
||||
24
README.rst
@@ -7,9 +7,6 @@ PlatformIO
|
||||
.. 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
|
||||
@@ -38,15 +35,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,
|
||||
Silicon Labs EFM32, 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>`_
|
||||
@@ -81,11 +79,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 <http://docs.platformio.org/en/latest/ci/index.html>`_
|
||||
* 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
|
||||
|
||||
BIN
docs/_static/ide-platformio-atom-1.gif
vendored
Normal file
|
After Width: | Height: | Size: 237 KiB |
BIN
docs/_static/ide-platformio-atom-2.gif
vendored
Normal file
|
After Width: | Height: | Size: 157 KiB |
BIN
docs/_static/ide-platformio-clion.png
vendored
Normal file
|
After Width: | Height: | Size: 57 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/platformio-logo.png
vendored
|
Before Width: | Height: | Size: 10 KiB After Width: | Height: | Size: 13 KiB |
@@ -9,6 +9,7 @@ Articles about us
|
||||
|
||||
Here are recent articles about PlatformIO:
|
||||
|
||||
* Jul 20, 2015 - **Eli Fatsi** - `Arduino Development in Atom Editor <http://viget.com/extend/arduino-development-in-atom-editor>`_
|
||||
* 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/>`_
|
||||
|
||||
@@ -134,7 +134,7 @@ same for the all projects, don't need to modify them):
|
||||
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"
|
||||
& $pip_path install --egg "http://dl.platformio.org/scons.zip"
|
||||
Write-Host "Scons installed"
|
||||
}
|
||||
|
||||
|
||||
@@ -70,19 +70,26 @@ PLATFORMIO_BUILD_FLAGS
|
||||
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_build_flags`.
|
||||
|
||||
.. _envvar_PLATFORMIO_SRCBUILD_FLAGS:
|
||||
.. _envvar_PLATFORMIO_SRC_BUILD_FLAGS:
|
||||
|
||||
PLATFORMIO_SRCBUILD_FLAGS
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
PLATFORMIO_SRC_BUILD_FLAGS
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_srcbuild_flags`.
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_src_build_flags`.
|
||||
|
||||
.. _envvar_PLATFORMIO_LDF_CYCLIC:
|
||||
.. _envvar_PLATFORMIO_SRC_FILTER:
|
||||
|
||||
PLATFORMIO_LDF_CYCLIC
|
||||
PLATFORMIO_SRC_FILTER
|
||||
~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_ldf_cyclic`.
|
||||
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
|
||||
--------
|
||||
|
||||
@@ -100,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>`_.
|
||||
|
||||
@@ -59,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
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -345,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>`_
|
||||
@@ -372,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
|
||||
|
||||
@@ -7,6 +7,8 @@ IDE Integration
|
||||
:maxdepth: 2
|
||||
|
||||
ide/arduino
|
||||
ide/atom
|
||||
ide/clion
|
||||
ide/eclipse
|
||||
ide/energia
|
||||
ide/qtcreator
|
||||
|
||||
39
docs/ide/atom.rst
Normal file
@@ -0,0 +1,39 @@
|
||||
.. _ide_atom:
|
||||
|
||||
Atom
|
||||
====
|
||||
|
||||
`Atom <https://atom.io>`_ is a text editor that's modern, approachable,
|
||||
yet hackable to the core—a tool you can customize to do anything but also use
|
||||
productively without ever touching a config file.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `Atom Documentation <https://atom.io/docs>`_
|
||||
page for more detailed information.
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Using `Atom Packages <https://atom.io/docs/v1.0.2/using-atom-atom-packages>`_
|
||||
please install `platomformio <https://atom.io/packages/platomformio>`_ package.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
Building
|
||||
^^^^^^^^
|
||||
|
||||
.. image:: ../_static/ide-platformio-atom-1.gif
|
||||
:target: https://atom.io/packages/platomformio
|
||||
|
||||
Uploading
|
||||
^^^^^^^^^
|
||||
|
||||
.. image:: ../_static/ide-platformio-atom-2.gif
|
||||
:target: https://atom.io/packages/platomformio
|
||||
51
docs/ide/clion.rst
Normal file
@@ -0,0 +1,51 @@
|
||||
.. _ide_clion:
|
||||
|
||||
CLion
|
||||
=====
|
||||
|
||||
The `CLion <https://www.jetbrains.com/clion/>`_ is a cross-platform C/C++ IDE
|
||||
for Linux, OS X, and Windows integrated with the CMake build system. The
|
||||
initial version will support the GCC and Clang compilers and GDB debugger.
|
||||
Clion includes such features as a smart editor, code quality assurance,
|
||||
automated refactorings, project manager, integrated version control systems.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `CDT Documentation <https://www.jetbrains.com/clion/documentation/>`_
|
||||
page for more detailed information.
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Project Generator
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Since PlatformIO 2.0 you can generate CLion 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 clion --board %TYPE%
|
||||
|
||||
Then import this project from start menu or via ``File > Import Project>`` and
|
||||
specify root directory where is located :ref:`projectconf`.
|
||||
|
||||
.. warning::
|
||||
CLion is still in the development stage, so some of the features (like,
|
||||
auto-complete) probably will not work with PlatformIO. See
|
||||
`CLion issue #CPP-3977 <https://youtrack.jetbrains.com/issue/CPP-3977>`_.
|
||||
|
||||
Active discussion located in
|
||||
`PlatformIO issue #132 <https://github.com/platformio/platformio/issues/132>`_.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
.. image:: ../_static/ide-platformio-clion.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-clion.png
|
||||
@@ -29,7 +29,7 @@ Integration
|
||||
Project Generator
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
SSince PlatformIO 2.0 you can generate Eclipse compatible project using
|
||||
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:
|
||||
|
||||
@@ -52,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
|
||||
|
||||
@@ -32,6 +32,11 @@ Since PlatformIO 2.0 you can generate Qt Creator compatible project using
|
||||
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
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
@@ -41,14 +46,16 @@ 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, change project file by adding path to directories with header files. Please edit project file to match the following contents:
|
||||
|
||||
@@ -58,15 +65,14 @@ Thirdly, change project file by adding path to directories with header files. Pl
|
||||
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
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@@ -77,6 +83,7 @@ Simple "Blink" project will consist from two files:
|
||||
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``.
|
||||
|
||||
@@ -101,6 +108,7 @@ Copy the source code which is described below to file ``main.c``.
|
||||
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
|
||||
|
||||
Edit the content to match the code described below.
|
||||
|
||||
@@ -128,3 +136,5 @@ Conclusion
|
||||
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
|
||||
|
||||
|
||||
@@ -123,3 +123,4 @@ Conclusion
|
||||
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,5 +1,8 @@
|
||||
PlatformIO: A cross-platform code builder and the missing library manager
|
||||
=========================================================================
|
||||
PlatformIO is a cross-platform code builder 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,
|
||||
@@ -27,11 +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>`
|
||||
* Ready for Cloud Compiling and :ref:`ci`
|
||||
* 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.*
|
||||
----------------------------------------
|
||||
|
||||
@@ -34,6 +34,12 @@ application:
|
||||
:ref:`MUST DISABLE <faq_troubleshooting_pioblocksprompt>` all prompts.
|
||||
It will allow you to avoid blocking.
|
||||
|
||||
.. note::
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
Troubleshooting
|
||||
---------------
|
||||
@@ -49,11 +55,11 @@ Super-Quick (Mac / Linux)
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To install or upgrade *PlatformIO* paste that at a *Terminal* prompt
|
||||
(**you might need** to run ``sudo`` first):
|
||||
(**you MIGHT need** to run ``sudo`` first, just for installation):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
[sudo] python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
|
||||
|
||||
Installer Script (Mac / Linux / Windows)
|
||||
@@ -61,10 +67,15 @@ Installer Script (Mac / Linux / Windows)
|
||||
|
||||
To install or upgrade *PlatformIO*, download
|
||||
`get-platformio.py <https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py>`_
|
||||
script. Then run the following (you might need to run ``sudo`` first):
|
||||
script. Then run the following (**you MIGHT need** to run ``sudo`` first,
|
||||
just for installation):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# change directory to folder where is located downloaded "get-platformio.py"
|
||||
cd /path/to/dir/where/is/located/get-platformio.py/script
|
||||
|
||||
# run it
|
||||
python get-platformio.py
|
||||
|
||||
|
||||
@@ -72,6 +83,10 @@ On *Windows OS* it may look like:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# change directory to folder where is located downloaded "get-platformio.py"
|
||||
cd C:\path\to\dir\where\is\located\get-platformio.py\script
|
||||
|
||||
# run it
|
||||
C:\Python27\python.exe get-platformio.py
|
||||
|
||||
Full Guide
|
||||
@@ -122,18 +137,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:
|
||||
|
||||
|
||||
@@ -33,6 +33,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -33,6 +33,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -145,6 +145,8 @@ Example of the **test** platform (``test.py``):
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
import os
|
||||
|
||||
from platformio.platforms.base import BasePlatform
|
||||
|
||||
class TestPlatform(BasePlatform):
|
||||
|
||||
@@ -36,6 +36,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -27,6 +27,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -27,6 +27,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
@@ -49,6 +52,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
|
||||
~~~~~~
|
||||
|
||||
|
||||
@@ -27,6 +27,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -27,6 +27,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -42,6 +42,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
@@ -142,11 +145,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>`_
|
||||
@@ -169,6 +172,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
|
||||
|
||||
@@ -36,6 +36,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -33,6 +33,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -36,6 +36,9 @@ Packages
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
|
||||
|
||||
Frameworks
|
||||
|
||||
@@ -57,6 +57,11 @@ A default value is ``%home_dir%/lib``.
|
||||
This option can be overridden by global environment variable
|
||||
:ref:`envvar_PLATFORMIO_LIB_DIR`.
|
||||
|
||||
.. note::
|
||||
You can put here your own/private libraries. The source code of each
|
||||
library should be placed in separate directory. For example,
|
||||
``%lib_dir%/private_lib/[here are source files]``.
|
||||
|
||||
.. _projectconf_pio_src_dir:
|
||||
|
||||
``src_dir``
|
||||
@@ -145,7 +150,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 +204,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 +218,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 +229,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 +246,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,10 +265,6 @@ 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`.
|
||||
@@ -278,11 +274,14 @@ 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:
|
||||
|
||||
@@ -300,20 +299,42 @@ 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 set by global environment variable
|
||||
:ref:`envvar_PLATFORMIO_SRCBUILD_FLAGS`.
|
||||
:ref:`envvar_PLATFORMIO_SRC_BUILD_FLAGS`.
|
||||
|
||||
``install_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 dependent libraries which should be installed before environment
|
||||
process. The only library IDs are allowed. Multiple libraries can be passed
|
||||
@@ -323,43 +344,41 @@ You can obtain library IDs using :ref:`cmd_lib_search` command.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:depends_on_some_libs]
|
||||
install_libs = 1,13,19
|
||||
lib_install = 1,13,19
|
||||
|
||||
``use_libs``
|
||||
^^^^^^^^^^^^
|
||||
``lib_use``
|
||||
^^^^^^^^^^^
|
||||
|
||||
Specify libraries which should be used by ``Library Dependency Finder (LDF)`` with
|
||||
the highest priority.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:libs_with_highest_priority]
|
||||
use_libs = OneWire_ID1
|
||||
lib_use = OneWire_ID1,SPI
|
||||
|
||||
``ignore_libs``
|
||||
^^^^^^^^^^^^^^^
|
||||
``lib_ignore``
|
||||
^^^^^^^^^^^^^^
|
||||
|
||||
Specify libraries which should be ignored by ``Library Dependency Finder (LDF)``
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:ignore_some_libs]
|
||||
ignore_libs = SPI,EngduinoV3_ID123
|
||||
lib_ignore = SPI,EngduinoV3_ID123
|
||||
|
||||
.. _projectconf_ldf_cyclic:
|
||||
|
||||
``ldf_cyclic``
|
||||
^^^^^^^^^^^^^^
|
||||
``lib_dfcyclic``
|
||||
^^^^^^^^^^^^^^^^
|
||||
|
||||
Control cyclic (recursive) behaviour for ``Library Dependency Finder (LDF)``.
|
||||
By default, this option is turned OFF (``ldf_cyclic=False``) and means, that
|
||||
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`.
|
||||
|
||||
@@ -367,16 +386,76 @@ 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.
|
||||
|
||||
This option can be set by global environment variable
|
||||
:ref:`envvar_PLATFORMIO_LDF_CYCLIC`.
|
||||
|
||||
Example:
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:libs_with_enabled_ldf_cyclic]
|
||||
ldf_cyclic = True
|
||||
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:
|
||||
|
||||
|
||||
@@ -62,6 +62,12 @@ There 3 levels of verbosity:
|
||||
|
||||
By default, verbosity level is set to 3 (maximum information).
|
||||
|
||||
.. option::
|
||||
--disable-auto-clean
|
||||
|
||||
Disable auto-clean of :ref:`projectconf_pio_envs_dir` when :ref:`projectconf`
|
||||
or :ref:`projectconf_pio_src_dir` (project structure) have been modified.
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
|
||||
@@ -15,19 +15,54 @@
|
||||
#include "smartconfig.h"
|
||||
|
||||
void ICACHE_FLASH_ATTR
|
||||
smartconfig_done(void *data)
|
||||
smartconfig_done(sc_status status, void *pdata)
|
||||
{
|
||||
struct station_config *sta_conf = data;
|
||||
switch(status) {
|
||||
case SC_STATUS_WAIT:
|
||||
os_printf("SC_STATUS_WAIT\n");
|
||||
break;
|
||||
case SC_STATUS_FIND_CHANNEL:
|
||||
os_printf("SC_STATUS_FIND_CHANNEL\n");
|
||||
break;
|
||||
case SC_STATUS_GETTING_SSID_PSWD:
|
||||
os_printf("SC_STATUS_GETTING_SSID_PSWD\n");
|
||||
sc_type *type = pdata;
|
||||
if (*type == SC_TYPE_ESPTOUCH) {
|
||||
os_printf("SC_TYPE:SC_TYPE_ESPTOUCH\n");
|
||||
} else {
|
||||
os_printf("SC_TYPE:SC_TYPE_AIRKISS\n");
|
||||
}
|
||||
break;
|
||||
case SC_STATUS_LINK:
|
||||
os_printf("SC_STATUS_LINK\n");
|
||||
struct station_config *sta_conf = pdata;
|
||||
|
||||
wifi_station_set_config(sta_conf);
|
||||
wifi_station_disconnect();
|
||||
wifi_station_connect();
|
||||
break;
|
||||
case SC_STATUS_LINK_OVER:
|
||||
os_printf("SC_STATUS_LINK_OVER\n");
|
||||
if (pdata != NULL) {
|
||||
uint8 phone_ip[4] = {0};
|
||||
|
||||
wifi_station_set_config(sta_conf);
|
||||
wifi_station_disconnect();
|
||||
wifi_station_connect();
|
||||
os_memcpy(phone_ip, (uint8*)pdata, 4);
|
||||
os_printf("Phone ip: %d.%d.%d.%d\n",phone_ip[0],phone_ip[1],phone_ip[2],phone_ip[3]);
|
||||
}
|
||||
smartconfig_stop();
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void user_rf_pre_init(void)
|
||||
{
|
||||
}
|
||||
|
||||
void user_init(void)
|
||||
{
|
||||
os_printf("SDK version:%s\n", system_get_sdk_version());
|
||||
|
||||
|
||||
wifi_set_opmode(STATION_MODE);
|
||||
smartconfig_start(SC_TYPE_AIRKISS, smartconfig_done);
|
||||
smartconfig_start(smartconfig_done);
|
||||
}
|
||||
|
||||
21
examples/teensy/teensy-hid-usb-mouse/README.rst
Normal file
@@ -0,0 +1,21 @@
|
||||
How to build PlatformIO based project
|
||||
=====================================
|
||||
|
||||
1. `Install PlatformIO <http://docs.platformio.org/en/latest/installation.html>`_
|
||||
2. Download `source code with examples <https://github.com/platformio/platformio/archive/develop.zip>`_
|
||||
3. Extract ZIP archive
|
||||
4. Run these commands:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Change directory to example
|
||||
> cd platformio-develop/examples/teensy/teensy-hid-usb-mouse
|
||||
|
||||
# Process example project
|
||||
> platformio run
|
||||
|
||||
# Upload firmware
|
||||
> platformio run --target upload
|
||||
|
||||
# Clean build files
|
||||
> platformio run --target clean
|
||||
24
examples/teensy/teensy-hid-usb-mouse/platformio.ini
Normal file
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:teensy31]
|
||||
platform = teensy
|
||||
framework = arduino
|
||||
board = teensy31
|
||||
build_flags = -DTEENSY31 -UUSB_SERIAL -DUSB_SERIAL_HID
|
||||
24
examples/teensy/teensy-hid-usb-mouse/src/TriangleMove.ino
Normal file
@@ -0,0 +1,24 @@
|
||||
/* Simple USB Mouse Example
|
||||
Teensy becomes a USB mouse and moves the cursor in a triangle
|
||||
|
||||
You must select Mouse from the "Tools > USB Type" menu
|
||||
|
||||
This example code is in the public domain.
|
||||
*/
|
||||
|
||||
void setup() { } // no setup needed
|
||||
void loop() {
|
||||
int i;
|
||||
for (i=0; i<40; i++) {
|
||||
Mouse.move(2, -1);
|
||||
delay(25);
|
||||
}
|
||||
for (i=0; i<40; i++) {
|
||||
Mouse.move(2, 2);
|
||||
delay(25);
|
||||
}
|
||||
for (i=0; i<40; i++) {
|
||||
Mouse.move(-4, -1);
|
||||
delay(25);
|
||||
}
|
||||
}
|
||||
@@ -1,14 +1,15 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (2, 1, 1)
|
||||
VERSION = (2, 2, 2)
|
||||
__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, Silicon Labs EFM32, 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"
|
||||
|
||||
@@ -41,10 +41,10 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904
|
||||
def _handle_obsolate_command(name):
|
||||
if name in ("install", "list", "search", "show", "uninstall"):
|
||||
click.secho(
|
||||
"Warning! `platformio %s` command is obsoleted and will be "
|
||||
"Warning! `platformio %s` command is deprecated and will be "
|
||||
"removed in the next release! Please use "
|
||||
"`platformio platforms %s` instead." % (name, name),
|
||||
fg="red"
|
||||
fg="yellow"
|
||||
)
|
||||
from platformio.commands import platforms
|
||||
return getattr(platforms, "platforms_" + name)
|
||||
@@ -82,7 +82,8 @@ def main():
|
||||
else:
|
||||
error_str += format_exc()
|
||||
click.secho(error_str, fg="red", err=True)
|
||||
sys_exit(1)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
@@ -7,7 +7,7 @@ from os.path import isfile, join
|
||||
|
||||
from platformio import __version__
|
||||
from platformio.exception import InvalidSettingName, InvalidSettingValue
|
||||
from platformio.util import get_home_dir
|
||||
from platformio.util import get_home_dir, is_ci
|
||||
|
||||
DEFAULT_SETTINGS = {
|
||||
"check_platformio_interval": {
|
||||
@@ -109,8 +109,7 @@ def get_setting(name):
|
||||
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")]):
|
||||
if any([is_ci(), get_session_var("force_option")]):
|
||||
return False
|
||||
|
||||
_env_name = "PLATFORMIO_SETTING_%s" % name.upper()
|
||||
|
||||
@@ -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"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -390,5 +390,37 @@
|
||||
},
|
||||
"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
|
||||
|
||||
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,10 +38,11 @@ commonvars.AddVariables(
|
||||
# options
|
||||
("FRAMEWORK",),
|
||||
("BUILD_FLAGS",),
|
||||
("SRCBUILD_FLAGS",),
|
||||
("IGNORE_LIBS",),
|
||||
("USE_LIBS",),
|
||||
("LDF_CYCLIC",),
|
||||
("SRC_BUILD_FLAGS",),
|
||||
("SRC_FILTER",),
|
||||
("LIB_DFCYCLIC",),
|
||||
("LIB_IGNORE",),
|
||||
("LIB_USE",),
|
||||
|
||||
# board options
|
||||
("BOARD",),
|
||||
@@ -54,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,
|
||||
@@ -71,6 +75,7 @@ DefaultEnvironment(
|
||||
PIOPACKAGES_DIR=join("$PIOHOME_DIR", "packages"),
|
||||
|
||||
BUILD_DIR=join("$PIOENVS_DIR", "$PIOENV"),
|
||||
BUILDSRC_DIR=join("$BUILD_DIR", "src"),
|
||||
LIBSOURCE_DIRS=[
|
||||
"$PROJECTLIB_DIR",
|
||||
util.get_lib_dir(),
|
||||
@@ -113,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",
|
||||
@@ -123,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()
|
||||
|
||||
@@ -30,7 +30,10 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
|
||||
env.Replace(UPLOAD_SPEED=None)
|
||||
|
||||
if env.subst("$UPLOAD_SPEED"):
|
||||
env.Append(UPLOADERFLAGS=["-b", "$UPLOAD_SPEED"])
|
||||
env.Append(UPLOADERFLAGS=[
|
||||
"-b", "$UPLOAD_SPEED",
|
||||
"-D"
|
||||
])
|
||||
|
||||
if not upload_options.get("require_upload_port", False):
|
||||
return
|
||||
|
||||
@@ -77,7 +77,7 @@ env.Replace(
|
||||
"-cp", "$UPLOAD_PORT",
|
||||
"-ca", "0x00000",
|
||||
"-cf", "${SOURCES[0]}",
|
||||
"-ca", "0x10000",
|
||||
"-ca", "0x40000" if "FRAMEWORK" not in env else "0x10000",
|
||||
"-cf", "${SOURCES[1]}"
|
||||
],
|
||||
UPLOADCMD='$UPLOADER $UPLOADERFLAGS'
|
||||
@@ -122,7 +122,7 @@ if "FRAMEWORK" not in env:
|
||||
LDSCRIPT_PATH=join(
|
||||
"$PIOPACKAGES_DIR", "sdk-esp8266", "ld", "eagle.app.v6.ld"),
|
||||
LIBS=["c", "gcc", "phy", "pp", "net80211", "lwip", "wpa", "main",
|
||||
"json", "upgrade", "smartconfig", "at", "ssl"]
|
||||
"json", "upgrade", "smartconfig", "pwm", "at", "ssl"]
|
||||
)
|
||||
|
||||
#
|
||||
@@ -136,11 +136,16 @@ target_elf = env.BuildFirmware()
|
||||
#
|
||||
|
||||
if "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
target_firm = join("$BUILD_DIR", "firmware.bin")
|
||||
target_firm = [
|
||||
join("$BUILD_DIR", "firmware_00000.bin"),
|
||||
join("$BUILD_DIR", "firmware_%s.bin" %
|
||||
("40000" if "FRAMEWORK" not in env else "10000"))
|
||||
]
|
||||
else:
|
||||
target_firm = env.ElfToBin(
|
||||
[join("$BUILD_DIR", "firmware_00000"),
|
||||
join("$BUILD_DIR", "firmware_10000")], target_elf)
|
||||
join("$BUILD_DIR", "firmware_%s" %
|
||||
("40000" if "FRAMEWORK" not in env else "10000"))], target_elf)
|
||||
|
||||
|
||||
#
|
||||
|
||||
@@ -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 = {
|
||||
|
||||
@@ -38,10 +38,7 @@ env.Append(
|
||||
envsafe = env.Clone()
|
||||
|
||||
envsafe.Append(
|
||||
CPPPATH=[
|
||||
join("$BUILD_DIR", "src")
|
||||
],
|
||||
|
||||
CPPPATH=["$BUILDSRC_DIR"],
|
||||
CPPDEFINES=[
|
||||
"USE_STDPERIPH_DRIVER"
|
||||
]
|
||||
@@ -52,22 +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:
|
||||
ignore_files += ["stm32f4xx_fsmc.c"]
|
||||
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)
|
||||
|
||||
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
|
||||
@@ -1,20 +1,25 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import atexit
|
||||
import json
|
||||
import re
|
||||
from glob import glob
|
||||
from os import getenv, listdir, remove, sep, walk
|
||||
from os import getenv, listdir, sep, walk
|
||||
from os.path import basename, dirname, isdir, isfile, join, normpath
|
||||
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, DefaultEnvironment, Exit,
|
||||
SConscript, SConscriptChdir)
|
||||
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
|
||||
@@ -27,49 +32,42 @@ def BuildFirmware(env):
|
||||
env.ProcessFlags()
|
||||
env.BuildFramework()
|
||||
|
||||
firmenv = env.Clone()
|
||||
vdirs = firmenv.VariantDirRecursive(
|
||||
join("$BUILD_DIR", "src"), "$PROJECTSRC_DIR", duplicate=False)
|
||||
|
||||
# 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(
|
||||
_LIBFLAGS="-Wl,--start-group "
|
||||
)
|
||||
firmenv.Append(
|
||||
_LIBFLAGS=" -Wl,--end-group"
|
||||
)
|
||||
if env.get("LIBS", deplibs):
|
||||
env.Prepend(
|
||||
_LIBFLAGS="-Wl,--start-group "
|
||||
)
|
||||
env.Append(
|
||||
_LIBFLAGS=" -Wl,--end-group"
|
||||
)
|
||||
|
||||
# Handle SRCBUILD_FLAGS
|
||||
if getenv("PLATFORMIO_SRCBUILD_FLAGS", None):
|
||||
firmenv.MergeFlags(getenv("PLATFORMIO_SRCBUILD_FLAGS"))
|
||||
if "SRCBUILD_FLAGS" in env:
|
||||
firmenv.MergeFlags(env['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())]
|
||||
)
|
||||
|
||||
if "envdump" in COMMAND_LINE_TARGETS:
|
||||
print env.Dump()
|
||||
Exit()
|
||||
|
||||
if "idedata" in COMMAND_LINE_TARGETS:
|
||||
print json.dumps(env.DumpIDEData())
|
||||
Exit()
|
||||
|
||||
return firmenv.Program(
|
||||
return env.Program(
|
||||
join("$BUILD_DIR", "firmware"),
|
||||
[firmenv.GlobCXXFiles(vdir) for vdir in vdirs],
|
||||
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"
|
||||
@@ -95,13 +93,13 @@ def ProcessFlags(env):
|
||||
env.Append(_CPPDEFFLAGS=" %s" % " ".join(undefines))
|
||||
|
||||
|
||||
def GlobCXXFiles(env, path):
|
||||
files = []
|
||||
for suff in ["c", "cpp", "S", "spp", "SPP", "sx", "s", "asm", "ASM"]:
|
||||
_list = env.Glob(join(path, "*.%s" % 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 VariantDirWrap(env, variant_dir, src_dir, duplicate=True):
|
||||
@@ -109,24 +107,57 @@ def VariantDirWrap(env, variant_dir, src_dir, duplicate=True):
|
||||
env.VariantDir(variant_dir, src_dir, duplicate)
|
||||
|
||||
|
||||
def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True,
|
||||
ignore_pattern=None):
|
||||
if not ignore_pattern:
|
||||
ignore_pattern = (".git", ".svn")
|
||||
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.VariantDirWrap(_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):
|
||||
if "FRAMEWORK" not in env:
|
||||
if "FRAMEWORK" not in env or "uploadlazy" in COMMAND_LINE_TARGETS:
|
||||
return
|
||||
|
||||
if env['FRAMEWORK'].lower() in ("arduino", "energia"):
|
||||
@@ -135,7 +166,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))
|
||||
@@ -145,18 +175,11 @@ 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)
|
||||
)
|
||||
|
||||
|
||||
@@ -165,8 +188,6 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
INCLUDES_RE = re.compile(
|
||||
r"^\s*#include\s+(\<|\")([^\>\"\']+)(?:\>|\")", re.M)
|
||||
LIBSOURCE_DIRS = [env.subst(d) for d in env.get("LIBSOURCE_DIRS", [])]
|
||||
USE_LIBS = [l.strip() for l in env.get("USE_LIBS", "").split(",")
|
||||
if l.strip()]
|
||||
|
||||
# start internal prototypes
|
||||
|
||||
@@ -207,7 +228,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
if not isdir(lsd_dir):
|
||||
continue
|
||||
|
||||
for ld in USE_LIBS + sorted(listdir(lsd_dir)):
|
||||
for ld in env.get("LIB_USE", []) + sorted(listdir(lsd_dir)):
|
||||
if not isdir(join(lsd_dir, ld)):
|
||||
continue
|
||||
|
||||
@@ -220,7 +241,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):
|
||||
@@ -250,10 +271,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):
|
||||
@@ -279,8 +300,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
|
||||
_lib_dir))
|
||||
state['libs'].add(_lib_dir)
|
||||
|
||||
if getenv("PLATFORMIO_LDF_CYCLIC",
|
||||
env.subst("$LDF_CYCLIC")).lower() == "true":
|
||||
if env.subst("$LIB_DFCYCLIC").lower() == "true":
|
||||
state = _process_src_dir(state, _lib_dir)
|
||||
return state
|
||||
|
||||
@@ -306,151 +326,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"(/\*.*?\*/|(^|\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", []):
|
||||
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", []):
|
||||
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
|
||||
|
||||
@@ -458,12 +333,10 @@ def exists(_):
|
||||
def generate(env):
|
||||
env.AddMethod(BuildFirmware)
|
||||
env.AddMethod(ProcessFlags)
|
||||
env.AddMethod(GlobCXXFiles)
|
||||
env.AddMethod(IsFileWithExt)
|
||||
env.AddMethod(VariantDirWrap)
|
||||
env.AddMethod(VariantDirRecursive)
|
||||
env.AddMethod(LookupSources)
|
||||
env.AddMethod(BuildFramework)
|
||||
env.AddMethod(BuildLibrary)
|
||||
env.AddMethod(BuildDependentLibraries)
|
||||
env.AddMethod(ConvertInoToCpp)
|
||||
env.AddMethod(DumpIDEData)
|
||||
return env
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
import stat
|
||||
from glob import glob
|
||||
from os import chmod, getenv, makedirs, remove
|
||||
from os.path import abspath, basename, isdir, isfile, join
|
||||
from os.path import abspath, basename, expanduser, isdir, isfile, join
|
||||
from shutil import copyfile, copytree, rmtree
|
||||
from tempfile import mkdtemp
|
||||
|
||||
@@ -19,8 +19,12 @@ from platformio.util import get_boards
|
||||
|
||||
def validate_path(ctx, param, value): # pylint: disable=W0613
|
||||
invalid_path = None
|
||||
for p in value:
|
||||
if not glob(p):
|
||||
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:
|
||||
@@ -109,7 +113,6 @@ def _copy_contents(dst_dir, contents):
|
||||
}
|
||||
|
||||
for path in contents:
|
||||
path = abspath(path)
|
||||
if isdir(path):
|
||||
items['dirs'].add(path)
|
||||
elif isfile(path):
|
||||
|
||||
@@ -86,7 +86,7 @@ def cli(project_dir, board, ide, disable_auto_uploading, env_prefix):
|
||||
project_file, board, disable_auto_uploading, env_prefix)
|
||||
|
||||
if ide:
|
||||
pg = ProjectGenerator(project_dir, ide)
|
||||
pg = ProjectGenerator(project_dir, ide, board[0] if board else None)
|
||||
pg.generate()
|
||||
|
||||
click.secho(
|
||||
|
||||
@@ -26,9 +26,10 @@ from platformio.platforms.base import PlatformFactory
|
||||
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.option("--disable-auto-clean", is_flag=True)
|
||||
@click.pass_context
|
||||
def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
|
||||
project_dir, verbose):
|
||||
project_dir, verbose, disable_auto_clean):
|
||||
with util.cd(project_dir):
|
||||
config = util.get_project_config()
|
||||
|
||||
@@ -40,7 +41,8 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
|
||||
raise exception.UnknownEnvNames(", ".join(unknown))
|
||||
|
||||
# clean obsolete .pioenvs dir
|
||||
_clean_pioenvs_dir()
|
||||
if not disable_auto_clean:
|
||||
_clean_pioenvs_dir()
|
||||
|
||||
results = []
|
||||
for section in config.sections():
|
||||
@@ -73,11 +75,19 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
|
||||
|
||||
class EnvironmentProcessor(object):
|
||||
|
||||
RENAMED_OPTIONS = {
|
||||
"INSTALL_LIBS": "LIB_INSTALL",
|
||||
"IGNORE_LIBS": "LIB_IGNORE",
|
||||
"USE_LIBS": "LIB_USE",
|
||||
"LDF_CYCLIC": "LIB_DFCYCLIC",
|
||||
"SRCBUILD_FLAGS": "SRC_BUILD_FLAGS"
|
||||
}
|
||||
|
||||
def __init__(self, cmd_ctx, name, options, # pylint: disable=R0913
|
||||
targets, upload_port, verbose):
|
||||
self.cmd_ctx = cmd_ctx
|
||||
self.name = name
|
||||
self.options = options
|
||||
self.options = self._validate_options(options)
|
||||
self.targets = targets
|
||||
self.upload_port = upload_port
|
||||
self.verbose_level = int(verbose)
|
||||
@@ -108,6 +118,23 @@ class EnvironmentProcessor(object):
|
||||
|
||||
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:
|
||||
@@ -116,7 +143,7 @@ class EnvironmentProcessor(object):
|
||||
k = k.upper()
|
||||
if k == "TARGETS" or (k == "UPLOAD_PORT" and self.upload_port):
|
||||
continue
|
||||
variables.append("%s=%s" % (k.upper(), v))
|
||||
variables.append("%s=%s" % (k, v))
|
||||
return variables
|
||||
|
||||
def _get_build_targets(self):
|
||||
@@ -138,22 +165,42 @@ class EnvironmentProcessor(object):
|
||||
telemetry.on_run_environment(self.options, build_targets)
|
||||
|
||||
# install platform and libs dependencies
|
||||
_autoinstall_platform(self.cmd_ctx, platform)
|
||||
if "install_libs" in self.options:
|
||||
_autoinstall_libs(self.cmd_ctx, self.options['install_libs'])
|
||||
_autoinstall_platform(self.cmd_ctx, platform, build_targets)
|
||||
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 _autoinstall_platform(ctx, platform):
|
||||
def _autoinstall_platform(ctx, platform, targets):
|
||||
installed_platforms = PlatformFactory.get_platforms(
|
||||
installed=True).keys()
|
||||
if (platform not in installed_platforms and (
|
||||
not app.get_setting("enable_prompts") or
|
||||
cmd_options = {}
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
|
||||
if "uploadlazy" in targets:
|
||||
upload_tools = p.pkg_aliases_to_names(["uploader"])
|
||||
|
||||
# platform without uploaders
|
||||
if not upload_tools and platform in installed_platforms:
|
||||
return
|
||||
# uploaders are already installed
|
||||
if set(upload_tools) <= set(p.get_installed_packages()):
|
||||
return
|
||||
|
||||
cmd_options['skip_default_package'] = True
|
||||
if upload_tools:
|
||||
cmd_options['with_package'] = ["uploader"]
|
||||
|
||||
elif (platform in installed_platforms and
|
||||
set(p.get_default_packages()) <= set(p.get_installed_packages())):
|
||||
return
|
||||
|
||||
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_platforms_install, platforms=[platform])
|
||||
"Would you like to install it now?" % platform)):
|
||||
ctx.invoke(cmd_platforms_install, platforms=[platform], **cmd_options)
|
||||
|
||||
|
||||
def _autoinstall_libs(ctx, libids_list):
|
||||
|
||||
@@ -7,6 +7,7 @@ import sys
|
||||
import click
|
||||
from serial.tools import miniterm
|
||||
|
||||
from platformio.exception import PlatformioException
|
||||
from platformio.util import get_serialports
|
||||
|
||||
|
||||
@@ -59,16 +60,16 @@ def serialports_list(json_output):
|
||||
# 1: escape non-printable characters, do newlines as unusual
|
||||
# 2: escape non-printable characters, newlines too
|
||||
# 3: hex dump everything""")
|
||||
@click.option("--exit-char", type=int, default=0x1d,
|
||||
@click.option("--exit-char", type=int, default=29,
|
||||
help="ASCII code of special character that is used to exit the "
|
||||
"application, default=0x1d")
|
||||
@click.option("--menu-char", type=int, default=0x14,
|
||||
"application, default=19 (DEC)")
|
||||
@click.option("--menu-char", type=int, default=20,
|
||||
help="ASCII code of special character that is used to control "
|
||||
"miniterm (menu), default=0x14")
|
||||
"miniterm (menu), default=20 (DEC)")
|
||||
@click.option("--quiet", is_flag=True,
|
||||
help="Diagnostics: suppress non-error messages, default=Off")
|
||||
def serialports_monitor(**kwargs):
|
||||
sys.argv = sys.argv[3:]
|
||||
sys.argv = sys.argv[2:]
|
||||
|
||||
if not kwargs['port']:
|
||||
for item in get_serialports():
|
||||
@@ -78,5 +79,5 @@ def serialports_monitor(**kwargs):
|
||||
|
||||
try:
|
||||
miniterm.main()
|
||||
except: # pylint: disable=W0702
|
||||
pass
|
||||
except Exception as e: # pylint: disable=W0702
|
||||
raise PlatformioException(str(e))
|
||||
|
||||
@@ -30,7 +30,7 @@ class UnknownPlatform(PlatformioException):
|
||||
class PlatformNotInstalledYet(PlatformioException):
|
||||
|
||||
MESSAGE = ("The platform '%s' has not been installed yet. "
|
||||
"Use `platformio install` command")
|
||||
"Use `platformio platforms install` command")
|
||||
|
||||
|
||||
class UnknownCLICommand(PlatformioException):
|
||||
|
||||
@@ -2,9 +2,8 @@
|
||||
# See LICENSE for details.
|
||||
|
||||
import json
|
||||
from glob import glob
|
||||
from os import listdir, walk
|
||||
from os.path import basename, isdir, join
|
||||
from os import listdir, makedirs, walk
|
||||
from os.path import abspath, basename, expanduser, isdir, join, relpath
|
||||
|
||||
import bottle
|
||||
|
||||
@@ -13,9 +12,10 @@ from platformio import util
|
||||
|
||||
class ProjectGenerator(object):
|
||||
|
||||
def __init__(self, project_dir, ide):
|
||||
def __init__(self, project_dir, ide, board=None):
|
||||
self.project_dir = project_dir
|
||||
self.ide = ide
|
||||
self.board = board
|
||||
self._tplvars = {}
|
||||
|
||||
self._gather_tplvars()
|
||||
@@ -26,6 +26,7 @@ class ProjectGenerator(object):
|
||||
return sorted([d for d in listdir(tpls_dir)
|
||||
if isdir(join(tpls_dir, d))])
|
||||
|
||||
@util.memoized
|
||||
def get_project_env(self):
|
||||
data = {"env_name": "PlatformIO"}
|
||||
with util.cd(self.project_dir):
|
||||
@@ -33,9 +34,11 @@ class ProjectGenerator(object):
|
||||
for section in config.sections():
|
||||
if not section.startswith("env:"):
|
||||
continue
|
||||
data['env_name'] = section[4:]
|
||||
data = {"env_name": section[4:]}
|
||||
for k, v in config.items(section):
|
||||
data[k] = v
|
||||
if self.board and self.board == data.get("board"):
|
||||
break
|
||||
return data
|
||||
|
||||
@util.memoized
|
||||
@@ -63,23 +66,35 @@ class ProjectGenerator(object):
|
||||
def get_project_name(self):
|
||||
return basename(self.project_dir)
|
||||
|
||||
@staticmethod
|
||||
def get_srcfiles():
|
||||
def get_srcfiles(self):
|
||||
result = []
|
||||
for root, _, files in walk(util.get_projectsrc_dir()):
|
||||
for f in files:
|
||||
result.append(join(root, f))
|
||||
with util.cd(self.project_dir):
|
||||
for root, _, files in walk(util.get_projectsrc_dir()):
|
||||
for f in files:
|
||||
result.append(relpath(join(root, f)))
|
||||
return result
|
||||
|
||||
def get_tpls(self):
|
||||
tpls = []
|
||||
tpls_dir = join(util.get_source_dir(), "ide", "tpls", self.ide)
|
||||
return glob(join(tpls_dir, ".*.tpl")) + glob(join(tpls_dir, "*.tpl"))
|
||||
for root, _, files in walk(tpls_dir):
|
||||
for f in files:
|
||||
if f.endswith(".tpl"):
|
||||
tpls.append((
|
||||
root.replace(tpls_dir, ""), join(root, f)))
|
||||
return tpls
|
||||
|
||||
def generate(self):
|
||||
for tpl_path in self.get_tpls():
|
||||
file_name = basename(tpl_path)[:-4]
|
||||
with open(join(self.project_dir, file_name), "w") as f:
|
||||
f.write(self._render_tpl(tpl_path).encode("utf8"))
|
||||
for _relpath, _path in self.get_tpls():
|
||||
tpl_dir = self.project_dir
|
||||
if _relpath:
|
||||
tpl_dir = join(self.project_dir, _relpath)[1:]
|
||||
if not isdir(tpl_dir):
|
||||
makedirs(tpl_dir)
|
||||
|
||||
file_name = basename(_path)[:-4]
|
||||
with open(join(tpl_dir, file_name), "w") as f:
|
||||
f.write(self._render_tpl(_path).encode("utf8"))
|
||||
|
||||
def _render_tpl(self, tpl_path):
|
||||
content = ""
|
||||
@@ -99,5 +114,6 @@ class ProjectGenerator(object):
|
||||
"defines": (build_data['defines']
|
||||
if build_data and "defines" in build_data else []),
|
||||
"srcfiles": self.get_srcfiles(),
|
||||
"user_home_dir": abspath(expanduser("~")),
|
||||
"project_dir": self.project_dir
|
||||
})
|
||||
|
||||
8
platformio/ide/tpls/clion/.idea/clion.iml.tpl
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="CPP_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
9
platformio/ide/tpls/clion/.idea/modules.xml.tpl
generated
Normal file
@@ -0,0 +1,9 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/clion.iml" filepath="$PROJECT_DIR$/.idea/clion.iml" />
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/platformio.iml" filepath="$PROJECT_DIR$/.idea/platformio.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
||||
8
platformio/ide/tpls/clion/.idea/platformio.iml.tpl
generated
Normal file
@@ -0,0 +1,8 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module type="CPP_MODULE" version="4">
|
||||
<component name="NewModuleRootManager">
|
||||
<content url="file://$MODULE_DIR$" />
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
</component>
|
||||
</module>
|
||||
266
platformio/ide/tpls/clion/.idea/workspace.xml.tpl
generated
Normal file
@@ -0,0 +1,266 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="CMakeRunConfigurationManager" shouldGenerate="true" assignedExecutableTargets="true" buildAllGenerated="true">
|
||||
<generated>
|
||||
<config projectName="{{project_name}}" targetName="PLATFORMIO_CLEAN" />
|
||||
<config projectName="{{project_name}}" targetName="PLATFORMIO_RUN" />
|
||||
<config projectName="{{project_name}}" targetName="PLATFORMIO" />
|
||||
<config projectName="{{project_name}}" targetName="{{project_name}}" />
|
||||
<config projectName="{{project_name}}" targetName="DEBUG" />
|
||||
<config projectName="{{project_name}}" targetName="PLATFORMIO_BUILD" />
|
||||
<config projectName="{{project_name}}" targetName="PLATFORMIO_UPLOAD" />
|
||||
</generated>
|
||||
</component>
|
||||
<component name="CMakeSettings" AUTO_RELOAD="true" GENERATION_PASS_SYSTEM_ENVIRONMENT="true">
|
||||
<ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
<envs />
|
||||
</ADDITIONAL_GENERATION_ENVIRONMENT>
|
||||
</component>
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="ec922180-b3d3-40f1-af0b-2568113a9075" name="Default" comment="" />
|
||||
<ignored path="platformio.iws" />
|
||||
<ignored path=".idea/workspace.xml" />
|
||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||
<option name="TRACKING_ENABLED" value="true" />
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
||||
<option name="LAST_RESOLUTION" value="IGNORE" />
|
||||
</component>
|
||||
<component name="ChangesViewManager" flattened_view="true" show_ignored="false" />
|
||||
<component name="CreatePatchCommitExecutor">
|
||||
<option name="PATCH_PATH" value="" />
|
||||
</component>
|
||||
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
|
||||
<component name="FavoritesManager">
|
||||
<favorites_list name="{{project_name}}" />
|
||||
</component>
|
||||
<component name="FileEditorManager">
|
||||
<leaf>
|
||||
<file leaf-file-name="CMakeLists.txt" pinned="false" current-in-tab="true">
|
||||
<entry file="file://$PROJECT_DIR$/CMakeLists.txt">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state vertical-scroll-proportion="0.15758981">
|
||||
<caret line="8" column="49" selection-start-line="8" selection-start-column="49" selection-end-line="8" selection-end-column="49" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
% for file in srcfiles:
|
||||
<file leaf-file-name="{{file}}" pinned="false" current-in-tab="false">
|
||||
<entry file="file://$PROJECT_DIR/${{file}}">
|
||||
<provider selected="true" editor-type-id="text-editor">
|
||||
<state vertical-scroll-proportion="0.0">
|
||||
<caret line="24" column="4" selection-start-line="24" selection-start-column="4" selection-end-line="24" selection-end-column="4" />
|
||||
<folding />
|
||||
</state>
|
||||
</provider>
|
||||
</entry>
|
||||
</file>
|
||||
% end
|
||||
</leaf>
|
||||
</component>
|
||||
<component name="JsBuildToolGruntFileManager" detection-done="true" />
|
||||
<component name="JsGulpfileManager">
|
||||
<detection-done>true</detection-done>
|
||||
</component>
|
||||
<component name="NamedScopeManager">
|
||||
<order />
|
||||
</component>
|
||||
<component name="ProjectFrameBounds">
|
||||
<option name="x" value="252" />
|
||||
<option name="y" value="21" />
|
||||
<option name="width" value="1400" />
|
||||
<option name="height" value="1000" />
|
||||
</component>
|
||||
<component name="ProjectInspectionProfilesVisibleTreeState">
|
||||
<entry key="Project Default">
|
||||
<profile-state>
|
||||
<expanded-state>
|
||||
<State>
|
||||
<id />
|
||||
</State>
|
||||
</expanded-state>
|
||||
<selected-state>
|
||||
<State>
|
||||
<id>C/C++</id>
|
||||
</State>
|
||||
</selected-state>
|
||||
</profile-state>
|
||||
</entry>
|
||||
</component>
|
||||
<component name="ProjectLevelVcsManager" settingsEditedManually="false">
|
||||
<OptionsSetting value="true" id="Add" />
|
||||
<OptionsSetting value="true" id="Remove" />
|
||||
<OptionsSetting value="true" id="Checkout" />
|
||||
<OptionsSetting value="true" id="Update" />
|
||||
<OptionsSetting value="true" id="Status" />
|
||||
<OptionsSetting value="true" id="Edit" />
|
||||
<ConfirmationsSetting value="0" id="Add" />
|
||||
<ConfirmationsSetting value="0" id="Remove" />
|
||||
</component>
|
||||
<component name="ProjectView">
|
||||
<navigator currentView="ProjectPane" proportions="" version="1">
|
||||
<flattenPackages />
|
||||
<showMembers />
|
||||
<showModules />
|
||||
<showLibraryContents />
|
||||
<hideEmptyPackages />
|
||||
<abbreviatePackageNames />
|
||||
<autoscrollToSource />
|
||||
<autoscrollFromSource />
|
||||
<sortByType />
|
||||
</navigator>
|
||||
<panes>
|
||||
<pane id="ProjectPane">
|
||||
<subPane>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="{{project_name}}" />
|
||||
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="{{project_name}}" />
|
||||
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="{{project_name}}" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
<PATH>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="{{project_name}}" />
|
||||
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="{{project_name}}" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
<PATH_ELEMENT>
|
||||
<option name="myItemId" value="src" />
|
||||
<option name="myItemType" value="com.intellij.ide.projectView.impl.nodes.PsiDirectoryNode" />
|
||||
</PATH_ELEMENT>
|
||||
</PATH>
|
||||
</subPane>
|
||||
</pane>
|
||||
</panes>
|
||||
</component>
|
||||
<component name="PropertiesComponent">
|
||||
<property name="recentsLimit" value="5" />
|
||||
<property name="settings.editor.selected.configurable" value="CPPToolchains" />
|
||||
<property name="settings.editor.splitter.proportion" value="0.2" />
|
||||
<property name="last_opened_file_path" value="$PROJECT_DIR$/CMakeLists.txt" />
|
||||
<property name="restartRequiresConfirmation" value="true" />
|
||||
<property name="FullScreen" value="false" />
|
||||
</component>
|
||||
<component name="RunManager" selected="Application.PLATFORMIO_BUILD">
|
||||
<configuration default="true" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="{{project_name}}" TARGET_NAME="{{project_name}}" CONFIG_NAME="Debug">
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="true" type="js.build_tools.gulp" factoryName="Gulp.js">
|
||||
<node-options />
|
||||
<gulpfile />
|
||||
<tasks />
|
||||
<arguments />
|
||||
<pass-parent-envs>true</pass-parent-envs>
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="Build All" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" CONFIG_NAME="Debug" EXPLICIT_BUILD_TARGET_NAME="all">
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="PLATFORMIO_BUILD" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="{{project_name}}" TARGET_NAME="PLATFORMIO_BUILD" CONFIG_NAME="Debug">
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="PLATFORMIO_CLEAN" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="{{project_name}}" TARGET_NAME="PLATFORMIO_CLEAN" CONFIG_NAME="Debug">
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<configuration default="false" name="PLATFORMIO_UPLOAD" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="{{project_name}}" TARGET_NAME="PLATFORMIO_UPLOAD" CONFIG_NAME="Debug">
|
||||
<envs />
|
||||
<method />
|
||||
</configuration>
|
||||
<list size="4">
|
||||
<item index="0" class="java.lang.String" itemvalue="Application.Build All" />
|
||||
<item index="1" class="java.lang.String" itemvalue="Application.PLATFORMIO_BUILD" />
|
||||
<item index="2" class="java.lang.String" itemvalue="Application.PLATFORMIO_CLEAN" />
|
||||
<item index="3" class="java.lang.String" itemvalue="Application.PLATFORMIO_UPLOAD" />
|
||||
</list>
|
||||
</component>
|
||||
<component name="ShelveChangesManager" show_recycled="false" />
|
||||
<component name="SvnConfiguration">
|
||||
<configuration />
|
||||
</component>
|
||||
<component name="TaskManager">
|
||||
<task active="true" id="Default" summary="Default task">
|
||||
<changelist id="ec922180-b3d3-40f1-af0b-2568113a9075" name="Default" comment="" />
|
||||
<created>1435919971910</created>
|
||||
<option name="number" value="Default" />
|
||||
<updated>1435919971910</updated>
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
<component name="ToolWindowManager">
|
||||
<frame x="252" y="21" width="1400" height="1000" extended-state="0" />
|
||||
<editor active="true" />
|
||||
<layout>
|
||||
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
|
||||
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.4631503" order="7" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
|
||||
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32996634" sideWeight="0.53684974" order="7" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
|
||||
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
|
||||
</layout>
|
||||
</component>
|
||||
<component name="Vcs.Log.UiProperties">
|
||||
<option name="RECENTLY_FILTERED_USER_GROUPS">
|
||||
<collection />
|
||||
</option>
|
||||
<option name="RECENTLY_FILTERED_BRANCH_GROUPS">
|
||||
<collection />
|
||||
</option>
|
||||
</component>
|
||||
<component name="VcsContentAnnotationSettings">
|
||||
<option name="myLimit" value="2678400000" />
|
||||
</component>
|
||||
<component name="XDebuggerManager">
|
||||
<breakpoint-manager>
|
||||
<option name="time" value="4" />
|
||||
</breakpoint-manager>
|
||||
<watches-manager />
|
||||
</component>
|
||||
<component name="masterDetails">
|
||||
<states>
|
||||
<state key="ScopeChooserConfigurable.UI">
|
||||
<settings>
|
||||
<splitter-proportions>
|
||||
<option name="proportions">
|
||||
<list>
|
||||
<option value="0.2" />
|
||||
</list>
|
||||
</option>
|
||||
</splitter-proportions>
|
||||
</settings>
|
||||
</state>
|
||||
</states>
|
||||
</component>
|
||||
</project>
|
||||
31
platformio/ide/tpls/clion/CMakeLists.txt.tpl
Normal file
@@ -0,0 +1,31 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
project({{project_name}})
|
||||
% for include in includes:
|
||||
% if include.startswith(user_home_dir):
|
||||
include_directories("$ENV{HOME}{{include.replace(user_home_dir, '').replace("\\", "/")}}")
|
||||
% else:
|
||||
include_directories("{{include}}")
|
||||
% end
|
||||
% end
|
||||
|
||||
% for define in defines:
|
||||
add_definitions(-D{{define}})
|
||||
% end
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_BUILD ALL
|
||||
COMMAND platformio -f run
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOAD ALL
|
||||
COMMAND platformio -f run --target upload
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_CLEAN ALL
|
||||
COMMAND platformio -f run --target clean
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
@@ -24,8 +24,12 @@
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1624502120" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.239157887" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
% for include in includes:
|
||||
% if include.startswith(user_home_dir):
|
||||
<listOptionValue builtIn="false" value="${HOME}{{include.replace(user_home_dir, '')}}"/>
|
||||
% else:
|
||||
<listOptionValue builtIn="false" value="{{include}}"/>
|
||||
% end
|
||||
% end
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.922107295" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||
% for define in defines:
|
||||
@@ -37,8 +41,12 @@
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.54121539" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1096940598" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
% for include in includes:
|
||||
% if include.startswith(user_home_dir):
|
||||
<listOptionValue builtIn="false" value="${HOME}{{include.replace(user_home_dir, '')}}"/>
|
||||
% else:
|
||||
<listOptionValue builtIn="false" value="{{include}}"/>
|
||||
% end
|
||||
% end
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1198905600" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||
% for define in defines:
|
||||
@@ -50,8 +58,12 @@
|
||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1310559623" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.41298875" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||
% for include in includes:
|
||||
% if include.startswith(user_home_dir):
|
||||
<listOptionValue builtIn="false" value="${HOME}{{include.replace(user_home_dir, '')}}"/>
|
||||
% else:
|
||||
<listOptionValue builtIn="false" value="{{include}}"/>
|
||||
% end
|
||||
% end
|
||||
</option>
|
||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.884639970" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||
% for define in defines:
|
||||
|
||||
@@ -2,14 +2,16 @@ win32 {
|
||||
HOMEDIR += $$(USERPROFILE)
|
||||
}
|
||||
else {
|
||||
HOMEDIR += $$(PWD)
|
||||
HOMEDIR += $$(HOME)
|
||||
}
|
||||
|
||||
% for include in includes:
|
||||
% if include.startswith(user_home_dir):
|
||||
INCLUDEPATH += "$${HOMEDIR}{{include.replace(user_home_dir, "")}}"
|
||||
% else:
|
||||
INCLUDEPATH += "{{include}}"
|
||||
% end
|
||||
|
||||
win32:INCLUDEPATH ~= s,/,\\,g
|
||||
% end
|
||||
|
||||
% for define in defines:
|
||||
DEFINES += "{{define}}"
|
||||
|
||||
@@ -1,231 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE QtCreatorProject>
|
||||
<!-- Written by QtCreator 3.2.2, 2015-05-07T12:57:08. -->
|
||||
<qtcreator>
|
||||
<data>
|
||||
<variable>EnvironmentId</variable>
|
||||
<value type="QByteArray">{00248b6a-4380-4f03-8dea-a03053177907}</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.ActiveTarget</variable>
|
||||
<value type="int">0</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.EditorSettings</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="bool" key="EditorConfiguration.AutoIndent">true</value>
|
||||
<value type="bool" key="EditorConfiguration.AutoSpacesForTabs">false</value>
|
||||
<value type="bool" key="EditorConfiguration.CamelCaseNavigation">true</value>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.0">
|
||||
<value type="QString" key="language">Cpp</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">CppGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="EditorConfiguration.CodeStyle.1">
|
||||
<value type="QString" key="language">QmlJS</value>
|
||||
<valuemap type="QVariantMap" key="value">
|
||||
<value type="QByteArray" key="CurrentPreferences">QmlJSGlobal</value>
|
||||
</valuemap>
|
||||
</valuemap>
|
||||
<value type="int" key="EditorConfiguration.CodeStyle.Count">2</value>
|
||||
<value type="QByteArray" key="EditorConfiguration.Codec">UTF-8</value>
|
||||
<value type="bool" key="EditorConfiguration.ConstrainTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.IndentSize">4</value>
|
||||
<value type="bool" key="EditorConfiguration.KeyboardTooltips">false</value>
|
||||
<value type="int" key="EditorConfiguration.MarginColumn">80</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseHiding">true</value>
|
||||
<value type="bool" key="EditorConfiguration.MouseNavigation">true</value>
|
||||
<value type="int" key="EditorConfiguration.PaddingMode">1</value>
|
||||
<value type="bool" key="EditorConfiguration.ScrollWheelZooming">true</value>
|
||||
<value type="bool" key="EditorConfiguration.ShowMargin">false</value>
|
||||
<value type="int" key="EditorConfiguration.SmartBackspaceBehavior">0</value>
|
||||
<value type="bool" key="EditorConfiguration.SpacesForTabs">true</value>
|
||||
<value type="int" key="EditorConfiguration.TabKeyBehavior">0</value>
|
||||
<value type="int" key="EditorConfiguration.TabSize">8</value>
|
||||
<value type="bool" key="EditorConfiguration.UseGlobal">true</value>
|
||||
<value type="int" key="EditorConfiguration.Utf8BomBehavior">1</value>
|
||||
<value type="bool" key="EditorConfiguration.addFinalNewLine">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanIndentation">true</value>
|
||||
<value type="bool" key="EditorConfiguration.cleanWhitespace">true</value>
|
||||
<value type="bool" key="EditorConfiguration.inEntireDocument">false</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.PluginSettings</variable>
|
||||
<valuemap type="QVariantMap"/>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Target.0</variable>
|
||||
<valuemap type="QVariantMap">
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">{{project_name}}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">{{project_name}}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.53.win32_mingw482_kit</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">1</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
|
||||
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">{{project_dir}}</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--force run</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Command">platformio</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.ProcessStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--force run --target clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Command">platformio</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.ProcessStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
|
||||
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">{{project_dir}}</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--force run</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Command">platformio</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.ProcessStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
|
||||
</valuemap>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.1">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
|
||||
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Arguments">--force run --target clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.Command">platformio</value>
|
||||
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.ProcessStep</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">2</value>
|
||||
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
|
||||
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
|
||||
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.BuildConfigurationCount">2</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.DeployConfiguration.0">
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
|
||||
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">0</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Deploy locally</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.DeployConfigurationCount">1</value>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.PluginSettings"/>
|
||||
<valuemap type="QVariantMap" key="ProjectExplorer.Target.RunConfiguration.0">
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.AddedSuppressionFiles"/>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectBusEvents">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.CollectSystime">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableBranchSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableCacheSim">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Callgrind.EnableEventToolTips">true</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.MinimumCostRatio">0.01</value>
|
||||
<value type="double" key="Analyzer.Valgrind.Callgrind.VisualisationMinimumCostRatio">10</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.FilterExternalIssues">true</value>
|
||||
<value type="int" key="Analyzer.Valgrind.LeakCheckOnFinish">1</value>
|
||||
<value type="int" key="Analyzer.Valgrind.NumCallers">25</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.RemovedSuppressionFiles"/>
|
||||
<value type="int" key="Analyzer.Valgrind.SelfModifyingCodeDetection">1</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.Settings.UseGlobalSettings">true</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.ShowReachable">false</value>
|
||||
<value type="bool" key="Analyzer.Valgrind.TrackOrigins">true</value>
|
||||
<value type="QString" key="Analyzer.Valgrind.ValgrindExecutable">valgrind</value>
|
||||
<valuelist type="QVariantList" key="Analyzer.Valgrind.VisibleErrorKinds">
|
||||
<value type="int">0</value>
|
||||
<value type="int">1</value>
|
||||
<value type="int">2</value>
|
||||
<value type="int">3</value>
|
||||
<value type="int">4</value>
|
||||
<value type="int">5</value>
|
||||
<value type="int">6</value>
|
||||
<value type="int">7</value>
|
||||
<value type="int">8</value>
|
||||
<value type="int">9</value>
|
||||
<value type="int">10</value>
|
||||
<value type="int">11</value>
|
||||
<value type="int">12</value>
|
||||
<value type="int">13</value>
|
||||
<value type="int">14</value>
|
||||
</valuelist>
|
||||
<value type="int" key="PE.EnvironmentAspect.Base">2</value>
|
||||
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">platformio</value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
|
||||
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:{{project_dir}}/platformio.pro</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">platformio.pro</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
|
||||
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseTerminal">false</value>
|
||||
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
|
||||
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>
|
||||
<value type="bool" key="RunConfiguration.UseMultiProcess">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebugger">false</value>
|
||||
<value type="bool" key="RunConfiguration.UseQmlDebuggerAuto">true</value>
|
||||
</valuemap>
|
||||
<value type="int" key="ProjectExplorer.Target.RunConfigurationCount">1</value>
|
||||
</valuemap>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.TargetCount</variable>
|
||||
<value type="int">1</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>ProjectExplorer.Project.Updater.FileVersion</variable>
|
||||
<value type="int">16</value>
|
||||
</data>
|
||||
<data>
|
||||
<variable>Version</variable>
|
||||
<value type="int">16</value>
|
||||
</data>
|
||||
</qtcreator>
|
||||
@@ -3,27 +3,27 @@
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
<Extensions>cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx;ino;pde</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Source Files\src">
|
||||
<UniqueIdentifier>{cad450ef-1a84-42d4-a5b5-a1736b8833d3}</UniqueIdentifier>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="platformio.ini" />
|
||||
<None Include="src\blink.pde">
|
||||
<Filter>Source Files\src</Filter>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
% for file in srcfiles:
|
||||
<ItemGroup>
|
||||
% if any([file.endswith(".%s" % e) for e in ("h", "hh", "hpp", "inc")]):
|
||||
<ClInclude Include="{{file}}">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
% else:
|
||||
<ClCompile Include="{{file}}">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
%end
|
||||
</ItemGroup>
|
||||
% end
|
||||
</Project>
|
||||
|
||||
@@ -39,26 +39,33 @@
|
||||
<NMakeBuildCommandLine>platformio --force run</NMakeBuildCommandLine>
|
||||
<NMakeCleanCommandLine>platformio --force run --target clean</NMakeCleanCommandLine>
|
||||
<NMakePreprocessorDefinitions>{{";".join(defines)}}</NMakePreprocessorDefinitions>
|
||||
<NMakeIncludeSearchPath>{{";".join(includes)}}</NMakeIncludeSearchPath>
|
||||
<NMakeIncludeSearchPath>{{";".join(["$(HOMEDRIVE)$(HOMEPATH)%s" % i.replace(user_home_dir, "") if i.startswith(user_home_dir) else i for i in includes])}}</NMakeIncludeSearchPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<NMakeBuildCommandLine>platformio run</NMakeBuildCommandLine>
|
||||
<NMakeCleanCommandLine>platformio run --target clean</NMakeCleanCommandLine>
|
||||
<NMakePreprocessorDefinitions>{";".join(defines)}}</NMakePreprocessorDefinitions>
|
||||
<NMakeIncludeSearchPath>{{";".join(includes)}}</NMakeIncludeSearchPath>
|
||||
<NMakeIncludeSearchPath>{{";".join(["$(HOMEDRIVE)$(HOMEPATH)%s" % i.replace(user_home_dir, "") if i.startswith(user_home_dir) else i for i in includes])}}</NMakeIncludeSearchPath>
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<Text Include="readme.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="platformio.ini" />
|
||||
% for file in srcfiles:
|
||||
<None Include="{{file}}" />
|
||||
% end
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
<ItemGroup>
|
||||
<None Include="platformio.ini" />
|
||||
</ItemGroup>
|
||||
% for file in srcfiles:
|
||||
<ItemGroup>
|
||||
% if any([file.endswith(".%s" % e) for e in ("h", "hh", "hpp", "inc")]):
|
||||
<ClInclude Include="{{file}}">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
% else:
|
||||
<ClCompile Include="{{file}}">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
%end
|
||||
</ItemGroup>
|
||||
% end
|
||||
</Project>
|
||||
|
||||
@@ -86,7 +86,7 @@ class Upgrader(object):
|
||||
def _upgrade_to_0_9_0(self, ctx): # pylint: disable=R0201
|
||||
prev_platforms = []
|
||||
|
||||
# remove platform's folder (obsoleted package structure)
|
||||
# remove platform's folder (obsolete package structure)
|
||||
for name in PlatformFactory.get_platforms().keys():
|
||||
pdir = join(get_home_dir(), name)
|
||||
if not isdir(pdir):
|
||||
|
||||
@@ -25,10 +25,12 @@ class AtmelavrPlatform(BasePlatform):
|
||||
},
|
||||
|
||||
"tool-avrdude": {
|
||||
"alias": "uploader",
|
||||
"default": True
|
||||
},
|
||||
|
||||
"tool-micronucleus": {
|
||||
"alias": "uploader",
|
||||
"default": True
|
||||
},
|
||||
|
||||
@@ -51,11 +53,11 @@ class AtmelavrPlatform(BasePlatform):
|
||||
for v in variables:
|
||||
if "BOARD=" not in v:
|
||||
continue
|
||||
tuploader = "tool-avrdude"
|
||||
disable_tool = "tool-micronucleus"
|
||||
_, board = v.split("=")
|
||||
bdata = get_boards(board)
|
||||
if "digispark" in bdata['build']['core']:
|
||||
tuploader = "tool-micronucleus"
|
||||
self.PACKAGES[tuploader]['alias'] = "uploader"
|
||||
disable_tool = "tool-avrdude"
|
||||
del self.PACKAGES[disable_tool]['alias']
|
||||
break
|
||||
return BasePlatform.run(self, variables, targets, verbose)
|
||||
|
||||
@@ -242,6 +242,10 @@ class BasePlatform(object):
|
||||
names.append(name)
|
||||
return names
|
||||
|
||||
def get_default_packages(self):
|
||||
return [k for k, v in self.get_packages().items()
|
||||
if v.get("default", False)]
|
||||
|
||||
def get_installed_packages(self):
|
||||
pm = PackageManager()
|
||||
return [n for n in self.get_packages().keys() if pm.is_installed(n)]
|
||||
|
||||
@@ -7,6 +7,7 @@ import re
|
||||
import sys
|
||||
import threading
|
||||
import uuid
|
||||
from os import getenv
|
||||
from time import time
|
||||
|
||||
import click
|
||||
@@ -197,6 +198,32 @@ def _finalize():
|
||||
def on_command(ctx): # pylint: disable=W0613
|
||||
mp = MeasurementProtocol()
|
||||
mp.send("screenview")
|
||||
if util.is_ci():
|
||||
measure_ci()
|
||||
|
||||
|
||||
def measure_ci():
|
||||
event = {
|
||||
"category": "CI",
|
||||
"action": "NoName",
|
||||
"label": None
|
||||
}
|
||||
|
||||
envmap = {
|
||||
"APPVEYOR": {"label": getenv("APPVEYOR_REPO_NAME")},
|
||||
"CIRCLECI": {"label": "%s/%s" % (getenv("CIRCLE_PROJECT_USERNAME"),
|
||||
getenv("CIRCLE_PROJECT_REPONAME"))},
|
||||
"TRAVIS": {"label": getenv("TRAVIS_REPO_SLUG")},
|
||||
"SHIPPABLE": {"label": getenv("REPO_NAME")},
|
||||
"DRONE": {"label": getenv("DRONE_REPO_SLUG")}
|
||||
}
|
||||
|
||||
for key, value in envmap.iteritems():
|
||||
if getenv(key, "").lower() != "true":
|
||||
continue
|
||||
event.update({"action": key, "label": value['label']})
|
||||
|
||||
on_event(**event)
|
||||
|
||||
|
||||
def on_run_environment(options, targets):
|
||||
|
||||
@@ -91,6 +91,9 @@ def generate_packages(packages):
|
||||
**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).
|
||||
|
||||
**Windows Users:** Please check that you have correctly installed USB driver
|
||||
from board manufacturer
|
||||
|
||||
""")
|
||||
return "\n".join(lines)
|
||||
|
||||
|
||||
@@ -9,7 +9,7 @@ from tempfile import NamedTemporaryFile
|
||||
|
||||
|
||||
CURINTERPRETER_PATH = os.path.normpath(sys.executable)
|
||||
IS_WINDOWS = system() == "Windows"
|
||||
IS_WINDOWS = system().lower() == "windows"
|
||||
|
||||
|
||||
def fix_winpython_pathenv():
|
||||
@@ -61,12 +61,12 @@ def exec_command(*args, **kwargs):
|
||||
out, err = p.communicate()
|
||||
|
||||
if p.returncode != 0:
|
||||
raise Exception(err)
|
||||
raise Exception("\n".join([out, err]))
|
||||
return out
|
||||
|
||||
|
||||
def exec_python_cmd(args):
|
||||
return exec_command([CURINTERPRETER_PATH] + args, shell=IS_WINDOWS).strip()
|
||||
return exec_command([CURINTERPRETER_PATH] + args).strip()
|
||||
|
||||
|
||||
def install_pip():
|
||||
@@ -89,8 +89,7 @@ def install_pip():
|
||||
def install_pypi_packages(packages):
|
||||
for pipargs in packages:
|
||||
print (exec_python_cmd([
|
||||
"-m",
|
||||
"pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
|
||||
"-m", "pip.__main__" if sys.version_info < (2, 7, 0) else "pip",
|
||||
"install", "-U"] + pipargs))
|
||||
|
||||
|
||||
@@ -100,8 +99,7 @@ def main():
|
||||
("Installing Python Package Manager", install_pip, []),
|
||||
("Installing PlatformIO and dependencies", install_pypi_packages, [
|
||||
[["setuptools"], ["platformio"], [
|
||||
"--egg",
|
||||
"http://sourceforge.net/projects/scons/files/latest/download"
|
||||
"--egg", "http://dl.platformio.org/scons.zip"
|
||||
]]
|
||||
])
|
||||
]
|
||||
@@ -111,14 +109,27 @@ def main():
|
||||
|
||||
is_error = False
|
||||
for s in steps:
|
||||
if is_error:
|
||||
break
|
||||
print ("\n==> %s ..." % s[0])
|
||||
try:
|
||||
s[1](*s[2])
|
||||
print ("[SUCCESS]")
|
||||
except Exception, e:
|
||||
is_error = True
|
||||
print (e)
|
||||
print (str(e))
|
||||
print ("[FAILURE]")
|
||||
if "Permission denied" in str(e) and not IS_WINDOWS:
|
||||
print ("""
|
||||
-----------------
|
||||
Permission denied
|
||||
-----------------
|
||||
|
||||
You need the `sudo` permission to install Python packages. Try
|
||||
|
||||
$ sudo python -c "$(curl -fsSL
|
||||
https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
""")
|
||||
|
||||
if is_error:
|
||||
print ("The installation process has been FAILED!\n"
|
||||
@@ -130,16 +141,25 @@ def main():
|
||||
"successfully FINISHED! <==\n")
|
||||
|
||||
try:
|
||||
print (exec_command("platformio", shell=IS_WINDOWS))
|
||||
print (exec_command("platformio"))
|
||||
except:
|
||||
try:
|
||||
print (exec_python_cmd([
|
||||
"-m",
|
||||
"platformio.__main__" if sys.version_info < (2, 7, 0) else
|
||||
"platformio"]))
|
||||
finally:
|
||||
print ("\n Please RESTART your Terminal Application and run "
|
||||
"`platformio --help` command.")
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
print ("""
|
||||
|
||||
----------------------------------------
|
||||
Please RESTART your Terminal Application
|
||||
----------------------------------------
|
||||
|
||||
Then run `platformio --help` command.
|
||||
|
||||
""")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
9
setup.py
@@ -50,7 +50,10 @@ setup(
|
||||
"Topic :: Software Development :: Build Tools",
|
||||
"Topic :: Software Development :: Compilers"
|
||||
],
|
||||
keywords=("builder library manager atmel avr sam espressif esp freescale "
|
||||
"kinetis nordic nrf51 nxp lpc silicon labs efm32 st stm32 ti "
|
||||
"msp430 tiva teensy arduino mbed libopencm3")
|
||||
keywords=(
|
||||
"builder library manager embedded development ide continuous "
|
||||
"integration atmel avr sam espressif esp freescale kinetis nordic "
|
||||
"nrf51 nxp lpc silicon labs efm32 st stm32 ti msp430 tiva teensy "
|
||||
"arduino mbed libopencm3"
|
||||
)
|
||||
)
|
||||
|
||||
@@ -52,19 +52,25 @@ def validate_package(url, sfpkglist):
|
||||
|
||||
def test_package(package_data, sfpkglist):
|
||||
assert package_data['url'].endswith("%d.tar.gz" % package_data['version'])
|
||||
sf_package = "sourceforge.net" in package_data['url']
|
||||
|
||||
# check content type and that file exists
|
||||
try:
|
||||
r = requests.head(package_data['url'], allow_redirects=True)
|
||||
if 500 <= r.status_code <= 599:
|
||||
raise requests.exceptions.ConnectionError()
|
||||
except requests.exceptions.ConnectionError:
|
||||
return pytest.skip("SF is off-line")
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
if sf_package:
|
||||
return pytest.skip("SF is off-line")
|
||||
raise Exception(e)
|
||||
|
||||
validate_response(r)
|
||||
assert r.headers['Content-Type'] in ("application/x-gzip",
|
||||
"application/octet-stream")
|
||||
|
||||
if not sf_package:
|
||||
return
|
||||
|
||||
# check sha1 sum
|
||||
if sfpkglist is None:
|
||||
return pytest.skip("SF is off-line")
|
||||
|
||||
4
tox.ini
@@ -11,7 +11,7 @@ deps =
|
||||
isort
|
||||
flake8
|
||||
commands =
|
||||
pip install --egg http://sourceforge.net/projects/scons/files/latest/download
|
||||
pip install --egg http://dl.platformio.org/scons.zip
|
||||
|
||||
[testenv:docs]
|
||||
basepython = python2.7
|
||||
@@ -48,5 +48,5 @@ passenv = *
|
||||
deps = pytest
|
||||
commands =
|
||||
{envpython} --version
|
||||
pip install --egg http://sourceforge.net/projects/scons/files/latest/download
|
||||
pip install --egg http://dl.platformio.org/scons.zip
|
||||
py.test -v --basetemp="{envtmpdir}" tests
|
||||
|
||||