Compare commits

...

153 Commits

Author SHA1 Message Date
5b8c6c4d56 Merge branch 'release/v2.2.1' 2015-07-17 14:54:55 +03:00
bfb801acef Version bump to 2.2.1 (issues #132, #248, #249, #250, #251) 2015-07-17 14:54:39 +03:00
9379c3cb39 Updated "sdk-esp8266" package for espressif platform 2015-07-17 14:51:17 +03:00
d66e8fe7af Check if all default packages are installed 2015-07-17 14:50:06 +03:00
b85303c12a Improve espressif platform and native example for new SDK 2015-07-17 14:32:50 +03:00
60e3d7450f Fix platform auto-installation 2015-07-17 14:28:14 +03:00
4cd294ef57 Fix indention 2015-07-17 13:52:43 +03:00
890acbc80e Switch to PlatformIO's SCons version 2015-07-17 13:48:17 +03:00
de1cce41b0 Improve platform auto-installing (especially for @SmartAthill) 2015-07-16 22:19:09 +03:00
e20f6abef4 Fix mention about project conf 2015-07-16 13:29:22 +03:00
fa11f5d613 More details about limited features of CLion IDE 2015-07-16 13:27:58 +03:00
1e0adcfdc4 Bump to 2.2.1a0 2015-07-15 19:45:56 +03:00
d5c852d329 Project generator for CLion IDE // Resolve #132 2015-07-15 19:34:10 +03:00
c4e42c88fe Fix Espressif "uploadlazy" target for @SmartAnthill Project 2015-07-13 14:02:14 +03:00
4b93ec0b0b Improve "uploadlazy" target for @SmartAnthill Project 2015-07-13 12:43:45 +03:00
21b01c8949 Note about Windows drivers for embedded boards 2015-07-07 23:33:25 +03:00
76415b930f Fixed incorrect arguments handling for "platformio serialports monitor" command // Resolve #248 2015-07-07 23:08:54 +03:00
88ad2a1626 Minor fix 2015-07-06 22:36:05 +03:00
94c459258c Add explanation about dir change 2015-07-06 18:44:00 +03:00
e1b7810465 Merge branch 'release/v2.2.0' into develop 2015-07-01 18:03:44 +03:00
6c2883ba3b Merge branch 'release/v2.2.0' 2015-07-01 18:03:43 +03:00
249b00df1a Version bump to 2.2.0 (issues #233, #238, #239, #240, #242, #243, #244, #245, #246) 2015-07-01 18:03:33 +03:00
3fcf0a1bda New boards; update packages for pre-built frameworks 2015-06-30 23:34:01 +03:00
c31f591ca0 Add new boards to ST STM32 & Nordic NRF51 platforms 2015-06-30 22:25:27 +03:00
c80fb5f4b3 Update Espressif platform // Resolve #245 2015-06-30 22:21:22 +03:00
218a978f6d Update PlatformIO slogan 2015-06-29 22:26:37 +03:00
f6aed63055 Specify full target anchor for images 2015-06-29 22:25:56 +03:00
a119e39ede Typos fix 2015-06-29 19:40:15 +03:00
94da243dad Disable .user file for Qt Creator (additional steps are explained in docs) // Resolve #244 2015-06-29 18:02:19 +03:00
244412daf1 Update IDE integration instructions for Qt Creator and VisualStudio 2015-06-29 17:59:47 +03:00
29d7137a3d Fix include paths without HOMEDRIVE for VisualStudio 2015-06-29 17:40:10 +03:00
9017cb1600 Fix access to env variable from qtmake 2015-06-29 16:44:37 +03:00
80b012c157 Fix incorrect "includes" for project generator 2015-06-29 16:36:02 +03:00
b80c525952 Improve docs for env's "target" option 2015-06-28 20:38:37 +03:00
1af6eba151 Rename "srcbuild_flags" env option to "src_build_flags" 2015-06-28 20:18:16 +03:00
e288499db9 Rename "install_libs" env option to "lib_install" 2015-06-28 20:16:43 +03:00
ebdbf79868 Rename "use_libs" env option to "lib_use" 2015-06-28 19:44:35 +03:00
776a2027fb Rename "ignore_libs" env option to "lib_ignore" 2015-06-28 19:31:28 +03:00
a928f4aa8f Rename "ldf_cyclic" env option to "lib_dfcyclic" 2015-06-28 19:20:31 +03:00
9c5f9b6e30 Improve embedded texts 2015-06-27 22:47:44 +03:00
ae4918bdb7 Fix relative path for includes when generating project for IDE // Resolve #243 2015-06-27 21:20:44 +03:00
a581ba9814 Fix project generator for Microsoft Visual Studio 2015-06-27 21:18:33 +03:00
31840bbc11 Update PlatformIO logo 2015-06-27 17:57:21 +03:00
53b005bbed Simplify installation process for development version 2015-06-27 15:18:51 +03:00
82864d38e2 Fix IDE project generator when board is specified // Resolve #242 2015-06-27 15:13:27 +03:00
43205b8cd5 Correct fs directory separator // Issue #240 2015-06-23 14:24:46 +03:00
e240e0ee32 Add to FAQ ARM toolchain issue with "error while loading shared libraries" 2015-06-22 18:45:20 +03:00
6c7e26412a Change source dir to "src" 2015-06-22 17:27:32 +03:00
3232ba6a6c Allow to exclude/include source files from build process using src_filter // Resolve #240 2015-06-22 15:06:39 +03:00
46461b0721 Merge branch 'hotfix/v2.1.2' into develop 2015-06-21 21:56:16 +03:00
90508dfd96 Merge branch 'hotfix/v2.1.2' 2015-06-21 21:51:38 +03:00
d8dba90f77 Fix broken link to SCons installer 2015-06-21 21:48:45 +03:00
829d5781a5 Allow to launch own extra script before firmware building/uploading processes // Resolve #239 2015-06-19 15:29:22 +03:00
8e95bfb464 Allow to specify own path to the linker script (ld) using build_flags option // Resolve #233 2015-06-19 13:43:30 +03:00
91563b01d2 Improve path validator 2015-06-19 00:10:50 +03:00
89e2f46e68 Update dependent test-lib 2015-06-19 00:10:17 +03:00
5f1f4a1b19 Bump to 2.2.0.dev0 2015-06-17 14:08:22 +03:00
4669dc7f16 Fix "stk500v2_command(): command failed" // Resolve #238 2015-06-17 13:35:10 +03:00
ca721d7262 Update dependent test-lib 2015-06-17 13:29:28 +03:00
14f84a49a6 Allow to specify library compatibility with the all platforms/frameworks using * symbol in library.json 2015-06-17 13:28:56 +03:00
4744f5afdc Merge pull request #235 from ctag/patch-1
Updated recommened platforms install command
2015-06-13 22:07:29 +02:00
3a48f1c40b Updated recommened platforms install
$ platformio install [platform]
The above line is obsolete, I've changed the recommendation to reflect this latest version of the program.
2015-06-12 23:47:17 -05:00
aea7121076 Merge branch 'release/v2.1.1' 2015-06-09 22:21:21 +03:00
50875ff74b Merge branch 'release/v2.1.1' into develop 2015-06-09 22:21:21 +03:00
dc13048254 Version bump to 2.1.1 (issues #229, #231, #232) 2015-06-09 22:20:53 +03:00
18145d2c1c Add OpenHub badge 2015-06-09 22:08:13 +03:00
f868c64d81 Automatically detect upload port using VID:PID board settings // Resolve #231 2015-06-08 23:02:05 +03:00
3b7ad2d333 Avoid "LibInstallDependencyError" when more then 1 library is found // Resolve #229 2015-06-06 16:41:00 +03:00
6732c7cb7c Better handling of user exceptions 2015-06-06 15:02:12 +03:00
7ba67582de Fix indention 2015-06-05 19:30:49 +03:00
35ae470196 Fix Windows Error 32 while cleanup pioenvs dir 2015-06-05 19:12:57 +03:00
fa339a8b70 Fix firmware verification for examples 2015-06-04 23:17:18 +03:00
43b27c138a Fix bad indentation 2015-06-04 23:15:28 +03:00
36cdbb8f0c Improv detection of build changes 2015-06-04 22:50:13 +03:00
8c331df105 Use direct path to LDScript 2015-06-04 21:24:19 +03:00
02d4efcfb5 Merge branch 'release/v2.1.0' into develop 2015-06-03 19:54:52 +03:00
00cb6bd845 Merge branch 'release/v2.1.0' 2015-06-03 19:54:51 +03:00
f038c7a28e Version bump to 2.1.0 (issues #215, #219, #221, #225, #226) 2015-06-03 19:54:39 +03:00
18b4497be7 Add info about Silicon Labs EFM32 platform 2015-06-03 19:53:00 +03:00
8704ad4032 Add new article by @lekum "Discovering PlatformIO: The RaspberryPi / Arduino combo kit is...." 2015-06-03 19:42:48 +03:00
f899e255f3 Add Silicon Labs EFM32 "siliconlabsefm32" development platform // Issue #226 2015-06-03 19:31:09 +03:00
23cf725c20 Skip SF 5xx errors 2015-06-03 19:14:10 +03:00
ba20459178 Merge pull request #227 from valeros/develop
Add Silicon Labs EFM32 development platform // Resolve #226
2015-06-02 17:07:54 +03:00
442604003d Add Silicon Labs EFM32 development platform // Resolve #226 2015-06-02 14:38:41 +03:00
369d0e1a00 Fix response with 504 code when SF is off-line 2015-06-01 17:49:04 +03:00
04b2f94478 Enable auto erase for flash memory while uploading 2015-06-01 17:26:17 +03:00
61b2bd6cb8 Describe in documentation how to create/register own board for PlatformIO 2015-05-30 17:09:01 +03:00
eea4ba3581 Merge pull request #223 from valeros/develop
Update IDE pictures in docs with "forced" run command // Resolve #215
2015-05-29 22:26:04 +03:00
3cb3b4f2ba Update IDE pictures in docs with "forced" run command // Resolve #215 2015-05-29 22:24:04 +03:00
2f376c9d36 Bump to 2.0.3.dev1 2015-05-29 20:33:24 +03:00
c4877e4444 Fix firmware uploading using USB programmer (USBasp) for atmelavr platform // Resolve #221 2015-05-29 20:29:24 +03:00
a288736ced Fix broken tests when SF is offline 2015-05-29 18:34:21 +03:00
1debe847d4 Disabled "nano.specs" for ARM-based platforms // Resolve #219 2015-05-29 17:47:30 +03:00
0c2a15a866 Trim whitespaces 2015-05-29 17:44:57 +03:00
da7e60b49f Switch badges to shields.io 2015-05-29 14:42:41 +03:00
d7c6da71f1 Integrate PlatformIO with Shippable CI 2015-05-28 21:07:41 +03:00
c4ed09c68f Integrate PlatformIO with Circle CI 2015-05-28 16:10:11 +03:00
06baa98823 Fix "ConnectionError" when PlatformIO SF Storage is off-line 2015-05-28 13:44:10 +03:00
8d9071e7c2 Merge branch 'feature/circleci' into develop 2015-05-28 13:10:48 +03:00
8d0785cf1b Fix Circle CI Example 2015-05-28 13:10:36 +03:00
ef0ce3fc07 Update project submodules 2015-05-28 12:44:37 +03:00
af9cdd0694 Remove invalid PyPi SCons package 2015-05-28 12:38:21 +03:00
a120514e9e Fix bottle requirement 2015-05-28 12:35:25 +03:00
e627a6ebdd Fix environment 2015-05-28 12:30:55 +03:00
94c37f4584 Integrate Circle CI 2015-05-28 12:28:24 +03:00
a48b62b0f2 Disable Travis CI cache 2015-05-28 12:03:46 +03:00
a9a9545b37 Fix resolving of C/C++ std libs by Eclipse IDE // Resolve #220 2015-05-28 00:19:55 +03:00
ca1df9462d Bump version to 2.0.2 2015-05-27 19:32:47 +03:00
32b057d1f3 Merge branch 'release/v2.0.2' 2015-05-27 19:27:02 +03:00
5e340843b1 Fix order for "listdir" method 2015-05-27 19:21:29 +03:00
0311298af1 Update history with 2.0.1 release 2015-05-27 17:03:34 +03:00
b4c2e9301c Merge branch 'release/v.2.0.1' 2015-05-27 17:02:08 +03:00
089ef2fa08 Merge branch 'release/v.2.0.1' into develop 2015-05-27 17:02:08 +03:00
9232c7abb1 Version bump to 2.0.1 (issues #210, #211, #212, #214, #216, #217) 2015-05-27 17:01:59 +03:00
27b7c2e201 Enhance docs for Library Manager 2015-05-27 16:23:39 +03:00
392758a842 Allow to control cyclic behaviour of Library Dependency Finder 2015-05-26 23:45:29 +03:00
25fde8db86 Cleanup boards 2015-05-26 23:00:40 +03:00
65ad07af6b Fix failing with `platformio init --ide eclipse` without boards // Resolve #217 2015-05-26 22:55:59 +03:00
ac7479415b Add support for new WildFire boards from Wicked Device to atmelavr platform 2015-05-26 22:52:09 +03:00
1f64f0aacf Merge pull request #218 from valeros/develop
Add WildFire boards from Wicked Device.
2015-05-26 20:47:24 +03:00
8fb0e1b75f Add WildFire boards from Wicked Device. 2015-05-26 20:06:37 +03:00
78db2cda27 Use forced run command and "--project-dir" option 2015-05-26 16:41:45 +03:00
6534fdaf04 Pass all environment variables which shall be copied from the tox invocation environment 2015-05-26 16:16:14 +03:00
2e214f16e7 Return args + options for telemetry 2015-05-26 15:04:47 +03:00
1f373b1e47 Handle AVR Symbols when initialising project for IDE // Resolve #216 2015-05-26 13:59:33 +03:00
4d36db1319 Improve handling of sys.args 2015-05-26 13:07:36 +03:00
58f0f8fab4 Use "include" directories from toolchain when exporting project for IDE // Resolve #210 2015-05-25 23:33:38 +03:00
7d949ecb16 Fix old-style class defination 2015-05-25 23:29:10 +03:00
be70047233 Improve running project from other directory (not CWD) 2015-05-25 23:26:35 +03:00
7649769437 Disable packages/libs updating while "upgrade" operation // Resolve #214 2015-05-25 22:50:46 +03:00
bcf0cc26aa Add --force for run command 2015-05-25 21:45:50 +03:00
96ce0692f8 Merge branch 'feature/reversed-cppath' into develop 2015-05-25 19:35:48 +03:00
9ba3136a24 Fix library order 2015-05-25 19:35:40 +03:00
92313c0686 Reversed order for CPPATH via Append 2015-05-25 13:35:26 +03:00
a1bb98fd5c Reversed order for CPPATH 2015-05-25 13:18:52 +03:00
146d430695 Revert CI detecting 2015-05-25 13:17:50 +03:00
b6a0a0f7c7 Merge pull request #213 from valeros/develop
Add c++ support for ststm32 platform // Resolve #211
2015-05-25 12:54:06 +03:00
97de38d6a6 Add c++ support for ststm32 platform // Resolve #211 2015-05-25 12:45:36 +03:00
65ba676f01 Correct path to import project in VisualStudio 2015-05-25 12:00:53 +03:00
5d9f81533d Use os.environ to detect CI system 2015-05-25 10:11:28 +03:00
1948a730d9 Pass environment variables to subprocess 2015-05-25 09:50:37 +03:00
77f2b17afd Update package for Arduino framework to 1.6.4 // Resolve #212 2015-05-24 18:48:45 +03:00
8739efaee4 Simplify Travis example 2015-05-24 01:02:12 +03:00
8f65492d96 Extend ASM list of source files 2015-05-23 20:23:13 +03:00
4f10047ba3 Handle new environment variable PLATFORMIO_BUILD_FLAGS 2015-05-23 19:17:07 +03:00
9560a665e5 Better detecting of Continuous Integration system 2015-05-23 18:36:11 +03:00
1113e5d69c Improve Travis CI docs 2015-05-23 17:42:22 +03:00
363c65da5f Fix stripping comments when converting from *.ino to *.cpp 2015-05-23 15:00:21 +03:00
28dd32070f Pass to API requests information about Continuous Integration system 2015-05-23 14:23:55 +03:00
f732d4088b Fix bug with converting "*.ino" to "*.cpp" 2015-05-23 14:02:05 +03:00
e22e4d23e4 Fix broken link 2015-05-22 22:16:27 +03:00
ce7d6f0507 Add where PlatformIO 2.0 was made 2015-05-22 22:03:55 +03:00
f499494963 Merge branch 'release/v2.0.0' into develop 2015-05-22 21:49:14 +03:00
101 changed files with 2134 additions and 799 deletions

View File

@ -1,7 +1,3 @@
cache:
directories:
- $HOME/.platformio
language: python
python:
- "2.7"

View File

@ -1,10 +1,114 @@
Release History
===============
2.2.1 (2015-??-??)
------------------
* 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
* Updated ``sdk-esp8266`` package for `espressif <http://docs.platformio.org/en/latest/platforms/espressif.html>`__ platform
(`issue #251 <https://github.com/platformio/platformio/issues/251>`_)
* 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)
------------------
* Automatically detect upload port using VID:PID board settings
(`issue #231 <https://github.com/platformio/platformio/issues/231>`_)
* Improved detection of build changes
* Avoided ``LibInstallDependencyError`` when more then 1 library is found
(`issue #229 <https://github.com/platformio/platformio/issues/229>`_)
2.1.0 (2015-06-03)
------------------
* Added Silicon Labs EFM32 `siliconlabsefm32 <http://docs.platformio.org/en/latest/platforms/siliconlabsefm32.html>`_
development platform
(`issue #226 <https://github.com/platformio/platformio/issues/226>`_)
* Integrate PlatformIO with `Circle CI <https://circleci.com>`_ and
`Shippable CI <https://shippable.com>`_
* Described in documentation how to `create/register own board <http://docs.platformio.org/en/latest/platforms/creating_board.html>`_ for PlatformIO
* Disabled "nano.specs" for ARM-based platforms
(`issue #219 <https://github.com/platformio/platformio/issues/219>`_)
* Fixed "ConnectionError" when PlatformIO SF Storage is off-line
* Fixed resolving of C/C++ std libs by Eclipse IDE
(`issue #220 <https://github.com/platformio/platformio/issues/220>`_)
* Fixed firmware uploading using USB programmer (USBasp) for
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html>`_
platform
(`issue #221 <https://github.com/platformio/platformio/issues/221>`_)
2.0.2 (2015-05-27)
------------------
* Fixed libraries order for "Library Dependency Finder" under Linux OS
2.0.1 (2015-05-27)
------------------
* Handle new environment variable
`PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`_
* Pass to API requests information about Continuous Integration system. This
information will be used by PlatformIO-API.
* Use ``include`` directories from toolchain when initialising project for IDE
(`issue #210 <https://github.com/platformio/platformio/issues/210>`_)
* Added support for new WildFire boards from
`Wicked Device <http://wickeddevice.com>`_ to
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#boards>`__
platform
* Updated `Arduino Framework <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__ to
1.6.4 version (`issue #212 <https://github.com/platformio/platformio/issues/212>`_)
* Handle Atmel AVR Symbols when initialising project for IDE
(`issue #216 <https://github.com/platformio/platformio/issues/216>`_)
* Fixed bug with converting ``*.ino`` to ``*.cpp``
* Fixed failing with ``platformio init --ide eclipse`` without boards
(`issue #217 <https://github.com/platformio/platformio/issues/217>`_)
2.0.0 (2015-05-22)
------------------
* PlatformIO as :ref:`ci` (CI) tool for embedded projects
*Made in* `Paradise <https://twitter.com/ikravets/status/592356377185619969>`_
* PlatformIO as `Continuous Integration <http://docs.platformio.org/en/latest/ci/index.html>`_
(CI) tool for embedded projects
(`issue #108 <https://github.com/platformio/platformio/issues/108>`_)
* Initialise PlatformIO project for the specified IDE
(`issue #151 <https://github.com/platformio/platformio/issues/151>`_)
@ -21,11 +125,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
@ -80,7 +184,7 @@ Release History
`teensy <http://docs.platformio.org/en/latest/platforms/teensy.html>`__
platform
* Added support for new Arduino based boards by *SparkFun, BQ, LightUp,
LowPowerLab, Quirkbot, RedBearLab, TinyCircuits, WickedDevice* to
LowPowerLab, Quirkbot, RedBearLab, TinyCircuits* to
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#boards>`__
platform
* Upgraded `Arduino Framework <http://docs.platformio.org/en/latest/frameworks/arduino.html>`__ to
@ -213,7 +317,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
@ -381,10 +485,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>`_

View File

@ -7,21 +7,29 @@ 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
.. image:: https://gemnasium.com/platformio/platformio.png
:target: https://gemnasium.com/platformio/platformio
:alt: Dependency Status
.. image:: https://pypip.in/version/platformio/badge.png?style=flat
.. image:: https://img.shields.io/pypi/v/platformio.svg
:target: https://pypi.python.org/pypi/platformio/
:alt: Latest Version
.. image:: https://pypip.in/download/platformio/badge.png?style=flat
.. image:: https://img.shields.io/pypi/dm/platformio.svg
:target: https://pypi.python.org/pypi/platformio/
:alt: Downloads
.. image:: https://pypip.in/license/platformio/badge.png?style=flat
.. image:: https://img.shields.io/pypi/l/platformio.svg
:target: https://pypi.python.org/pypi/platformio/
:alt: License
.. image:: https://badges.gitter.im/Join%20Chat.svg
:alt: Join the chat at https://gitter.im/platformio/platformio
:target: https://gitter.im/platformio/platformio
.. image:: https://www.openhub.net/p/platformio/widgets/project_thin_badge.gif
:target: https://www.openhub.net/p/platformio
`Website + Library Search <http://platformio.org>`_ |
`Documentation <http://docs.platformio.org>`_ |
@ -30,14 +38,16 @@ PlatformIO
`Reddit <http://www.reddit.com/r/platformio/>`_ |
`Twitter <https://twitter.com/PlatformIO_Org>`_
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc.*
.. image:: https://raw.githubusercontent.com/platformio/platformio/develop/docs/_static/platformio-logo.png
:target: http://platformio.org
`PlatformIO <http://platformio.org>`_ is a cross-platform code builder
and the missing library manager.
and the missing library manager (Ready for embedded development, IDE and
Continuous integration, Arduino and MBED compatible).
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed,
libOpenCM3, etc.*
* `Get Started <http://platformio.org/#!/get-started>`_
* `Web 2.0 Library Search <http://platformio.org/#!/lib>`_
@ -72,11 +82,13 @@ Embedded Development. *Easier Than Ever.*
settings for most popular `Embedded Boards <http://platformio.org/#!/boards>`_.
* Colourful `command-line output <https://raw.githubusercontent.com/platformio/platformio/develop/examples/platformio-examples.png>`_
* Built-in `Serial Port Monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_
* Configurable `build -flags/-options <http://docs.platformio.org/en/latest/projectconf.html#build-flags>`_
* `IDE Integration <http://docs.platformio.org/en/latest/ide.html>`_ with
*Arduino, Eclipse, Energia, Qt Creator, Sublime Text, Vim, Visual Studio*
* `Continuous Integration <http://docs.platformio.org/en/latest/ci/index.html>`_
with *AppVeyor, Circle CI, Drone, Shippable, Travis CI*
* Built-in `Serial Port Monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ and configurable
`build -flags/-options <http://docs.platformio.org/en/latest/projectconf.html#build-flags>`_
* Automatic **firmware uploading**
* Integration with `development environments (IDE) <http://docs.platformio.org/en/latest/ide.html>`_
* Ready for **Cloud Compiling** and `Continuous Integration <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
@ -136,6 +148,7 @@ It has support for the most popular embedded platforms:
* `Nordic nRF51 <http://platformio.org/#!/platforms/nordicnrf51>`_
* `NXP LPC <http://platformio.org/#!/platforms/nxplpc>`_
* `ST STM32 <http://platformio.org/#!/platforms/ststm32>`_
* `Silicon Labs EFM32 <http://platformio.org/#!/platforms/siliconlabsefm32>`_
* `Teensy <http://platformio.org/#!/platforms/teensy>`_
* `TI MSP430 <http://platformio.org/#!/platforms/timsp430>`_
* `TI TIVA C <http://platformio.org/#!/platforms/titiva>`_

20
circle.yml Normal file
View File

@ -0,0 +1,20 @@
machine:
python:
version: 2.7
environment:
TOX_ENV: docs
TOX_ENV: lint
TOX_ENV: py26
TOX_ENV: py27
checkout:
post:
- git submodule update --init
dependencies:
pre:
- pip install tox
test:
override:
- tox -e $TOX_ENV

BIN
docs/_static/ide-platformio-clion.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 57 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 67 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

After

Width:  |  Height:  |  Size: 13 KiB

View File

@ -9,6 +9,7 @@ Articles about us
Here are recent articles about PlatformIO:
* Jun 02, 2015 - **Alejandro Guirao Rodriguez** - `Discovering PlatformIO: The RaspberryPi / Arduino combo kit is a winner option when prototyping an IoT-style project <http://lekum.org/posts/discovering-platformio.html>`_
* May 11, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part II <http://ithare.com/from-web-developer-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-ii/>`_
* May 4, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part I <http://ithare.com/from-web-development-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-i/>`_
* April 17, 2015 - **Michael Ball** - `PlatformIO - A Cross-Platform Code Builder and Missing Library Manager <http://arduino-pi.blogspot.com.es/2015/04/platformio-cross-platform-code-builder.html>`_

View File

@ -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"
}

View File

@ -30,9 +30,9 @@ Put ``circle.yml`` to the root directory of the GitHub repository.
machine:
environment:
- PLATFORMIO_CI_SRC=path/to/source/file.c
- PLATFORMIO_CI_SRC=path/to/source/file.ino
- PLATFORMIO_CI_SRC=path/to/source/directory
PLATFORMIO_CI_SRC: path/to/source/file.c
PLATFORMIO_CI_SRC: path/to/source/file.ino
PLATFORMIO_CI_SRC: path/to/source/directory
dependencies:
pre:

View File

@ -44,6 +44,8 @@ Please put ``.travis.yml`` to the root directory of the GitHub repository.
- platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
Then see step 1, 2, and step 4 here: http://docs.travis-ci.com/user/getting-started/
For more details as for PlatformIO build process please look into :ref:`cmd_ci`
command.
@ -60,13 +62,22 @@ Examples
- "2.7"
env:
- PLATFORMIO_CI_SRC=examples/Bluetooth/PS3SPP/PS3SPP.ino
- PLATFORMIO_CI_SRC=examples/pl2303/pl2303_gps/pl2303_gps.ino
- PLATFORMIO_CI_SRC=examples/acm/acm_terminal
- PLATFORMIO_CI_SRC=examples/Bluetooth/WiiIRCamera PLATFORMIO_BUILD_FLAGS="-DWIICAMERA"
- PLATFORMIO_CI_SRC=examples/ftdi/USBFTDILoopback
- PLATFORMIO_CI_SRC=examples/Xbox/XBOXUSB
# - ...
install:
- python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
- wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip
- unzip /tmp/spi4teensy3.zip -d /tmp
# Libraries from PlatformIO Library Registry
# http://platformio.org/#!/lib/show/416/TinyGPS
# http://platformio.org/#!/lib/show/417/SPI4Teensy3
- platformio lib install 416 417
script:
- platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due
- platformio ci --board=uno --board=teensy31 --board=due --lib="."
* Configuration file: https://github.com/felis/USB_Host_Shield_2.0/blob/master/.travis.yml
* Build History: https://travis-ci.org/felis/USB_Host_Shield_2.0

View File

@ -36,44 +36,60 @@ In other words, ``CI=true`` automatically setup
PLATFORMIO_HOME_DIR
~~~~~~~~~~~~~~~~~~~
Allows to override :ref:`projectconf` option
:ref:`projectconf_pio_home_dir`.
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_home_dir`.
.. _envvar_PLATFORMIO_LIB_DIR:
PLATFORMIO_LIB_DIR
~~~~~~~~~~~~~~~~~~
Allows to override :ref:`projectconf` option
:ref:`projectconf_pio_lib_dir`.
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_lib_dir`.
.. _envvar_PLATFORMIO_SRC_DIR:
PLATFORMIO_SRC_DIR
~~~~~~~~~~~~~~~~~~
Allows to override :ref:`projectconf` option
:ref:`projectconf_pio_src_dir`.
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_src_dir`.
.. _envvar_PLATFORMIO_ENVS_DIR:
PLATFORMIO_ENVS_DIR
~~~~~~~~~~~~~~~~~~~
Allows to override :ref:`projectconf` option
:ref:`projectconf_pio_envs_dir`.
Allows to override :ref:`projectconf` option :ref:`projectconf_pio_envs_dir`.
Builder
-------
.. _envvar_PLATFORMIO_SRCBUILD_FLAGS:
.. _envvar_PLATFORMIO_BUILD_FLAGS:
PLATFORMIO_SRCBUILD_FLAGS
~~~~~~~~~~~~~~~~~~~~~~~~~
PLATFORMIO_BUILD_FLAGS
~~~~~~~~~~~~~~~~~~~~~~
Allows to override :ref:`projectconf` option
:ref:`projectconf_srcbuild_flags`.
Allows to set :ref:`projectconf` option :ref:`projectconf_build_flags`.
.. _envvar_PLATFORMIO_SRC_BUILD_FLAGS:
PLATFORMIO_SRC_BUILD_FLAGS
~~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to set :ref:`projectconf` option :ref:`projectconf_src_build_flags`.
.. _envvar_PLATFORMIO_SRC_FILTER:
PLATFORMIO_SRC_FILTER
~~~~~~~~~~~~~~~~~~~~~
Allows to set :ref:`projectconf` option :ref:`projectconf_src_filter`.
.. _envvar_PLATFORMIO_EXTRA_SCRIPT:
PLATFORMIO_EXTRA_SCRIPT
~~~~~~~~~~~~~~~~~~~~~~~
Allows to set :ref:`projectconf` option :ref:`projectconf_extra_script`.
Settings
--------

View File

@ -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>`_.

View File

@ -923,8 +923,8 @@ TinyCircuits
- 32 Kb
- 2 Kb
WickedDevice
~~~~~~~~~~~~
Wicked Device
~~~~~~~~~~~~~
.. list-table::
:header-rows: 1
@ -937,14 +937,14 @@ WickedDevice
- RAM
* - ``wildfirev2``
- `WickedDevice WildFire v2 [stk500] <http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup>`_
- `Wicked Device WildFire V2 <http://shop.wickeddevice.com/resources/wildfire/>`_
- ATMEGA1284P
- 16 MHz
- 128 Kb
- 16 Kb
* - ``wildfirev3``
- `WickedDevice WildFire v3 [optiboot] <http://shop.wickeddevice.com/resources/wildfire/>`_
- `Wicked Device WildFire V3 <http://shop.wickeddevice.com/resources/wildfire/>`_
- ATMEGA1284P
- 16 MHz
- 128 Kb

View File

@ -25,6 +25,9 @@ Platforms
* - :ref:`platform_nxplpc`
- The NXP LPC is a family of 32-bit microcontroller integrated circuits by NXP Semiconductors. The LPC chips are grouped into related series that are based around the same 32-bit ARM processor core, such as the Cortex-M4F, Cortex-M3, Cortex-M0+, or Cortex-M0. Internally, each microcontroller consists of the processor core, static RAM memory, flash memory, debugging interface, and various peripherals.
* - :ref:`platform_siliconlabsefm32`
- Silicon Labs EFM32 Gecko 32-bit microcontroller (MCU) family includes devices that offer flash memory configurations up to 256 kB, 32 kB of RAM and CPU speeds up to 48 MHz. Based on the powerful ARM Cortex-M core, the Gecko family features innovative low energy techniques, short wake-up time from energy saving modes and a wide selection of peripherals, making it ideal for battery operated applications and other systems requiring high performance and low-energy consumption.
* - :ref:`platform_ststm32`
- The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development.
@ -56,6 +59,26 @@ CQ Publishing
- 64 Kb
- 10 Kb
Delta
~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``dfcm_nnn40``
- `Delta DFCM-NNN40 <https://developer.mbed.org/platforms/Delta-DFCM-NNN40/>`_
- NRF51822
- 32 MHz
- 256 Kb
- 32 Kb
Embedded Artists
~~~~~~~~~~~~~~~~
@ -342,11 +365,11 @@ ST
- 48 Kb
* - ``disco_f334c8``
- `ST 32F3348DISCOVERY <http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF260318>`_
- `ST 32F3348DISCOVERY <http://www.st.com/web/en/catalog/tools/PF260318>`_
- STM32F334C8T6
- 72 MHz
- 64 Kb
- 16 Kb
- 12 Kb
* - ``disco_f401vc``
- `ST 32F401CDISCOVERY <http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/LN1848/PF259098>`_
@ -369,6 +392,13 @@ ST
- 2048 Kb
- 256 Kb
* - ``disco_l053c8``
- `ST 32L0538DISCOVERY <http://www.st.com/web/en/catalog/tools/PF260319>`_
- STM32L053C8T6
- 32 MHz
- 64 Kb
- 8 Kb
* - ``nucleo_f030r8``
- `ST Nucleo F030R8 <https://developer.mbed.org/platforms/ST-Nucleo-F030R8/>`_
- STM32F030R8T6
@ -480,6 +510,54 @@ SeeedStudio
- 512 Kb
- 32 Kb
Silicon Labs
~~~~~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``efm32gg_stk3700``
- `Silicon Labs EFM32GG-STK3700 (Giant Gecko) <https://developer.mbed.org/platforms/EFM32-Giant-Gecko/>`_
- EFM32GG990F1024
- 48 MHz
- 1024 Kb
- 128 Kb
* - ``efm32hg_stk3400``
- `Silicon Labs SLSTK3400A USB-enabled (Happy Gecko) <https://developer.mbed.org/platforms/EFM32-Happy-Gecko/>`_
- EFM32HG322F64
- 24 MHz
- 64 Kb
- 8 Kb
* - ``efm32lg_stk3600``
- `Silicon Labs EFM32LG-STK3600 (Leopard Gecko) <https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/>`_
- EFM32LG990F256
- 48 MHz
- 256 Kb
- 32 Kb
* - ``efm32wg_stk3800``
- `Silicon Labs EFM32WG-STK3800 (Wonder Gecko) <https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/>`_
- EFM32WG990F256
- 48 MHz
- 256 Kb
- 32 Kb
* - ``efm32zg_stk3200``
- `Silicon Labs EFM32ZG-STK3200 (Zero Gecko) <https://developer.mbed.org/platforms/EFM32-Zero-Gecko/>`_
- EFM2ZG222F32
- 24 MHz
- 32 Kb
- 4 Kb
Solder Splash Labs
~~~~~~~~~~~~~~~~~~

View File

@ -7,6 +7,7 @@ IDE Integration
:maxdepth: 2
ide/arduino
ide/clion
ide/eclipse
ide/energia
ide/qtcreator

51
docs/ide/clion.rst Normal file
View 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

View File

@ -30,11 +30,12 @@ Project Generator
^^^^^^^^^^^^^^^^^
Since PlatformIO 2.0 you can generate Eclipse compatible project using
:option:`platformio init --ide` command:
:option:`platformio init --ide` command. Please choose board type using
:ref:`cmd_boards` command and run:
.. code-block:: shell
platformio init --ide eclipse
platformio init --ide eclipse --board %TYPE%
Then import this project via ``File > Import... > General > Existing Projects
into Workspace > Next`` and specify root directory where is located
@ -51,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

View File

@ -21,16 +21,22 @@ Integration
Project Generator
^^^^^^^^^^^^^^^^^
Since PlatformIO 2.0 you can generate Eclipse compatible project using
:option:`platformio init --ide` command:
Since PlatformIO 2.0 you can generate Qt Creator compatible project using
:option:`platformio init --ide` command. Please choose board type using
:ref:`cmd_boards` command and run:
.. code-block:: shell
platformio init --ide qtcreator
platformio init --ide qtcreator --board %TYPE%
Then import this project via ``File > New File or Project > Import Project``
and specify root directory where is located :ref:`projectconf`.
After import, we need to delete default build and clean steps and configure project with PlatformIO source code builder (click on Projects label on left menu or ``Ctrl+5`` shortcut):
.. image:: ../_static/ide-platformio-qtcreator-3.png
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png
Manual Integration
^^^^^^^^^^^^^^^^^^
@ -40,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:
@ -57,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
~~~~~~~~~~~~~~~~~~~~~~~~~~~
@ -76,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``.
@ -100,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.
@ -127,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

View File

@ -21,12 +21,13 @@ Integration
Project Generator
^^^^^^^^^^^^^^^^^
Since PlatformIO 2.0 you can generate Eclipse compatible project using
:option:`platformio init --ide` command:
Since PlatformIO 2.0 you can generate Sublime Text compatible project using
:option:`platformio init --ide` command. Please choose board type using
:ref:`cmd_boards` command and run:
.. code-block:: shell
platformio init --ide sublimetext
platformio init --ide sublimetext --board %TYPE%
Then import this project via ``Project > Open Project...`` and specify root
directory where is located :ref:`projectconf`.
@ -44,17 +45,17 @@ described below:
.. code-block:: bash
{
"cmd": ["platformio", "run"],
"cmd": ["platformio", "--force", "run"],
"working_dir": "${project_path:${folder}}",
"variants":
[
{
"name": "Clean",
"cmd": ["platformio", "run", "-t", "clean"]
"cmd": ["platformio", "--force", "run", "--target", "clean"]
},
{
"name": "Upload",
"cmd": ["platformio", "run", "-t", "upload"]
"cmd": ["platformio", "--force", "run", "--target", "upload"]
}
]
}

View File

@ -30,10 +30,10 @@ Put to the project directory ``Makefile`` wrapper with contents:
#PATH := /usr/local/bin:$(PATH)
all:
platformio run -t upload
platformio --force run --target upload
clean:
platformio run -t clean
platformio --force run --target clean
Now, in VIM ``cd /path/to/this/project`` and press ``Ctrl+B`` or ``Cmd+B``

View File

@ -21,15 +21,16 @@ Integration
Project Generator
^^^^^^^^^^^^^^^^^
Since PlatformIO 2.0 you can generate Eclipse compatible project using
:option:`platformio init --ide` command:
Since PlatformIO 2.0 you can generate Visual Studio compatible project using
:option:`platformio init --ide` command. Please choose board type using
:ref:`cmd_boards` command and run:
.. code-block:: shell
platformio init --ide visualstudio
platformio init --ide visualstudio --board %TYPE%
Then import this project via ``File > Import ...`` and specify root directory
where is located :ref:`projectconf`.
Then import this project via ``File->Open->Project/Solution`` and specify root
directory where is located :ref:`projectconf`.
Manual Integration
^^^^^^^^^^^^^^^^^^
@ -122,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

View File

@ -1,8 +1,12 @@
PlatformIO: A cross-platform code builder and the missing library manager
=========================================================================
PlatformIO is a cross-platform code builder and the missing library manager
===========================================================================
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC, ST STM32,
TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc.*
**Ready for embedded development, IDE and Continuous integration, Arduino and
MBED compatible**
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed,
libOpenCM3, etc.*
.. image:: _static/platformio-logo.png
:target: http://platformio.org
@ -26,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.*
----------------------------------------

View File

@ -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
---------------
@ -65,6 +71,10 @@ script. Then run the following (you might need to run ``sudo`` first):
.. code-block:: bash
# change directory to folder where is located downloaded "get-platformio.py"
cd /path/to/dir/where/is/installer/script
# run it
python get-platformio.py
@ -72,6 +82,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\installer\script
# run it
C:\Python27\python.exe get-platformio.py
Full Guide
@ -122,18 +136,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>`_.

View File

@ -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:

View File

@ -8,8 +8,10 @@ Library Manager
*"The missing library manager for development platforms"* [#]_
*PlatformIO Library Manager* allows you to organize external embedded libraries.
You can search for new libraries via :ref:`Command Line interface <cmd_lib_search>`
or `Web 2.0 Library Search <http://platformio.org/#!/lib>`_.
You can search for new libraries via
* :ref:`Command Line interface <cmd_lib_search>`
* `Web 2.0 Library Search <http://platformio.org/#!/lib>`_
You don't need to bother for finding the latest version of library. Due to
:ref:`cmd_lib_update` command you will have up-to-date external libraries.

View File

@ -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
@ -816,8 +819,8 @@ TinyCircuits
- 32 Kb
- 2 Kb
WickedDevice
~~~~~~~~~~~~
Wicked Device
~~~~~~~~~~~~~
.. list-table::
:header-rows: 1
@ -830,14 +833,14 @@ WickedDevice
- RAM
* - ``wildfirev2``
- `WickedDevice WildFire v2 [stk500] <http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup>`_
- `Wicked Device WildFire V2 <http://shop.wickeddevice.com/resources/wildfire/>`_
- ATMEGA1284P
- 16 MHz
- 128 Kb
- 16 Kb
* - ``wildfirev3``
- `WickedDevice WildFire v3 [optiboot] <http://shop.wickeddevice.com/resources/wildfire/>`_
- `Wicked Device WildFire V3 <http://shop.wickeddevice.com/resources/wildfire/>`_
- ATMEGA1284P
- 16 MHz
- 128 Kb

View File

@ -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

View File

@ -0,0 +1,62 @@
.. _board_creating:
Creating Board
==============
*PlatformIO* has pre-built settings for the most popular embedded boards. This
list is available:
* `Embedded Boards Explorer <http://platformio.org/#!/boards>`_ (Web)
* :ref:`cmd_boards` (CLI command)
Nevertheless, PlatformIO allows to create own board or override existing
board's settings. All data is declared using
`JSON-style <http://en.wikipedia.org/wiki/JSON>`_ via
`associative array <http://en.wikipedia.org/wiki/Associative_array>`_
(name/value pairs).
.. contents::
JSON Structure
--------------
The key fields:
* ``build`` data will be used by :ref:`Platforms <platforms>` and
:ref:`frameworks` builders
* ``frameworks`` is the list with supported :ref:`frameworks`
* ``platform`` main type of :ref:`Platforms <platforms>`
* ``upload`` upload settings which depend on the ``platform``
.. code-block:: json
{
"myboard": {
"build": {},
"frameworks": ["%LIST_WITH_SUPPORTED_FRAMEWORKS%"],
"name": "My test board",
"platform": "%PLATFORM_TYPE_HERE%",
"upload": {},
"url": "http://example.com",
"vendor": "My Company Ltd."
}
}
Installation
------------
1. Create ``boards`` directory in :ref:`projectconf_pio_home_dir` if it
doesn't exist.
2. Create ``my_own_boards.json`` file and put to ``boards`` directory.
3. Search available boards via :ref:`cmd_boards` command. You should see
``myboard`` board.
Now, you can use ``myboard`` for the :ref:`projectconf_env_board` option in
:ref:`projectconf`.
Examples
--------
For the examples, please look into built-in ``*.json`` files with boards
settings: https://github.com/platformio/platformio/tree/develop/platformio/boards.

View File

@ -292,7 +292,7 @@ Installation
------------
1. Create ``platforms`` directory in :ref:`projectconf_pio_home_dir` if it
doesn't exists.
doesn't exist.
2. Copy ``test.py`` and ``test-builder.py`` files to ``platforms`` directory.
3. Search available platforms via :ref:`cmd_platforms_search` command. You should see
``test`` platform.

View File

@ -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

View File

@ -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

View File

@ -20,8 +20,10 @@ MCU, upload protocol or etc. Please use ``board`` option.
freescalekinetis
nordicnrf51
nxplpc
siliconlabsefm32
ststm32
teensy
timsp430
titiva
creating_platform
creating_board

View File

@ -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
~~~~~~

View File

@ -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

View File

@ -0,0 +1,101 @@
.. _platform_siliconlabsefm32:
Platform ``siliconlabsefm32``
=============================
Silicon Labs EFM32 Gecko 32-bit microcontroller (MCU) family includes devices that offer flash memory configurations up to 256 kB, 32 kB of RAM and CPU speeds up to 48 MHz. Based on the powerful ARM Cortex-M core, the Gecko family features innovative low energy techniques, short wake-up time from energy saving modes and a wide selection of peripherals, making it ideal for battery operated applications and other systems requiring high performance and low-energy consumption.
For more detailed information please visit `vendor site <http://www.silabs.com/products/mcu/32-bit/efm32-gecko/Pages/efm32-gecko.aspx>`_.
.. contents::
Packages
--------
.. list-table::
:header-rows: 1
* - Name
- Contents
* - ``framework-mbed``
- `mbed Framework <http://mbed.org>`_
* - ``toolchain-gccarmnoneeabi``
- `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_
.. warning::
**Linux Users:** Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file).
**Windows Users:** Please check that you have correctly installed USB driver
from board manufacturer
Frameworks
----------
.. list-table::
:header-rows: 1
* - Name
- Description
* - :ref:`framework_mbed`
- The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community.
Boards
------
.. note::
* You can list pre-configured boards by :ref:`cmd_boards` command or
`PlatformIO Boards Explorer <http://platformio.org/#!/boards>`_
* For more detailed ``board`` information please scroll tables below by
horizontal.
Silicon Labs
~~~~~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``efm32gg_stk3700``
- `Silicon Labs EFM32GG-STK3700 (Giant Gecko) <https://developer.mbed.org/platforms/EFM32-Giant-Gecko/>`_
- EFM32GG990F1024
- 48 MHz
- 1024 Kb
- 128 Kb
* - ``efm32hg_stk3400``
- `Silicon Labs SLSTK3400A USB-enabled (Happy Gecko) <https://developer.mbed.org/platforms/EFM32-Happy-Gecko/>`_
- EFM32HG322F64
- 24 MHz
- 64 Kb
- 8 Kb
* - ``efm32lg_stk3600``
- `Silicon Labs EFM32LG-STK3600 (Leopard Gecko) <https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/>`_
- EFM32LG990F256
- 48 MHz
- 256 Kb
- 32 Kb
* - ``efm32wg_stk3800``
- `Silicon Labs EFM32WG-STK3800 (Wonder Gecko) <https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/>`_
- EFM32WG990F256
- 48 MHz
- 256 Kb
- 32 Kb
* - ``efm32zg_stk3200``
- `Silicon Labs EFM32ZG-STK3200 (Zero Gecko) <https://developer.mbed.org/platforms/EFM32-Zero-Gecko/>`_
- EFM2ZG222F32
- 24 MHz
- 32 Kb
- 4 Kb

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -145,7 +145,8 @@ need to specify ``board_mcu``, ``board_f_cpu``, ``upload_protocol`` or
``upload_speed`` options. Just define a ``board`` type and *PlatformIO* will
pre-fill options described above with appropriate values.
You can find the ``board`` type in *Boards* section of each :ref:`platforms`.
You can find the ``board`` type in *Boards* section of each :ref:`platforms` or
using `PlatformIO Embedded Boards Explorer <http://platformio.org/#!/boards>`_.
``board_mcu``
@ -198,20 +199,6 @@ A protocol that "uploader" tool uses to talk to the board.
A connection speed (`baud rate <http://en.wikipedia.org/wiki/Baud>`_)
which "uploader" tool uses when sending firmware to board.
``targets``
^^^^^^^^^^^
A list with targets which will be processed by :ref:`cmd_run` command by
default. You can enter more then one target separated with "space".
When no targets are defined, *PlatformIO* will build only sources by default.
.. note::
This option is useful to enable "auto-uploading" after building operation
(``targets = upload``).
.. _projectconf_build_flags:
``build_flags``
@ -226,10 +213,6 @@ processes:
* - Format
- Scope
- Description
* - ``-Wp,option``
- CPPFLAGS
- Bypass the compiler driver and pass *option* directly through to the
preprocessor
* - ``-D name``
- CPPDEFINES
- Predefine *name* as a macro, with definition 1.
@ -241,6 +224,10 @@ processes:
- CPPDEFINES
- Cancel any previous definition of *name*, either built in or provided
with a ``-D`` option.
* - ``-Wp,option``
- CPPFLAGS
- Bypass the compiler driver and pass *option* directly through to the
preprocessor
* - ``-Wall``
- CCFLAGS
- Turns on all optional warnings which are desirable for normal code.
@ -254,10 +241,18 @@ processes:
- CCFLAGS
- Process *file* as if ``#include "file"`` appeared as the first line of
the primary source file.
* - ``-Idir``
- CPPPATH
- Add the directory *dir* to the list of directories to be searched
for header files.
* - ``-Wa,option``
- ASFLAGS, CCFLAGS
- Pass *option* as an option to the assembler. If *option* contains
commas, it is split into multiple options at the commas.
* - ``-Wl,option``
- LINKFLAGS
- Pass *option* as an option to the linker. If *option* contains
commas, it is split into multiple options at the commas.
* - ``-llibrary``
- LIBS
- Search the *library* named library when linking
@ -265,21 +260,23 @@ processes:
- LIBPATH
- Add directory *dir* to the list of directories to be searched for
``-l``.
* - ``-Idir``
- CPPPATH
- Add the directory *dir* to the list of directories to be searched
for header files.
This option can be set by global environment variable
:ref:`envvar_PLATFORMIO_BUILD_FLAGS`.
Example:
.. code-block:: ini
[env:specific_defines]
build_flags = -O2 -Dfoo -Dbar=1
build_flags = -Dfoo -Dbar=1
[env:specific_inclibs]
build_flags = -I/opt/include -L/opt/lib -lfoo
[env:specific_ld_script]
build_flags = -Wl,-T/path/to/ld_script.ld
For more detailed information about available flags/options go to:
@ -297,20 +294,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 overridden by global environment variable
:ref:`envvar_PLATFORMIO_SRCBUILD_FLAGS`.
This option can be set by global environment variable
:ref:`envvar_PLATFORMIO_SRC_BUILD_FLAGS`.
``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
@ -320,36 +339,118 @@ 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`` with
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``
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
``lib_dfcyclic``
^^^^^^^^^^^^^^^^
Control cyclic (recursive) behaviour for ``Library Dependency Finder (LDF)``.
By default, this option is turned OFF (``lib_dfcyclic=False``) and means, that
``LDF`` will find only libraries which are included in source files from the
project :ref:`projectconf_pio_src_dir`.
If you want to enable cyclic (recursive, nested) search, please set this option
to ``True``. Founded library will be treated like a new source files and
``LDF`` will search dependencies for it.
Example:
.. code-block:: ini
[env:libs_with_enabled_ldf_cyclic]
lib_dfcyclic = True
.. _projectconf_extra_script:
``extra_script``
^^^^^^^^^^^^^^^^
Allows to launch extra script using `SCons <http://www.scons.org>`_ software
construction tool. For more details please follow to "Construction Environments"
section of
`SCons documentation <http://www.scons.org/doc/production/HTML/scons-user.html#chap-environments>`_.
This option can be set by global environment variable
:ref:`envvar_PLATFORMIO_EXTRA_SCRIPT`.
Example, specify own upload command for :ref:`platform_atmelavr`:
``platformio.ini``:
.. code-block:: ini
[env:env_with_specific_extra_script]
platform = atmelavr
extra_script = /path/to/extra_script.py
``extra_script.py``:
.. code-block:: python
from SCons.Script import DefaultEnvironment
env = DefaultEnvironment()
env.Replace(UPLOADHEXCMD='"$UPLOADER" --uploader --flags')
# uncomment line below to see environment variables
# print env.Dump()
See built-in examples of `PlatformIO build scripts <https://github.com/platformio/platformio/tree/develop/platformio/builder/scripts>`_.
``targets``
^^^^^^^^^^^
A list with targets which will be processed by :ref:`cmd_run` command by
default. You can enter more then one target separated with "space".
Pre-built targets:
* ``clean`` delete compiled object files, libraries and firmware binaries
* ``upload`` enable "auto-uploading" for embedded platforms after building
operation
* ``envdump`` dump current build environment
**Tip!** You can use these targets like an option to
:option:`platformio run --target` command. For example:
.. code-block:: bash
# clean project
platformio run -t clean
# dump curent build environment
platformio run --target envdump
When no targets are defined, *PlatformIO* will build only sources by default.
.. _projectconf_examples:

View File

@ -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);
}

View File

@ -47,3 +47,9 @@ board = nucleo_f401re
platform = teensy
framework = mbed
board = teensy31
# Silicon Labs EFM32 Platform
[env:siliconlabsefm32]
platform = siliconlabsefm32
framework = mbed
board = efm32hg_stk3400

View File

@ -1,14 +1,15 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
VERSION = (2, 0, 0)
VERSION = (2, 2, 1)
__version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio"
__description__ = ("A cross-platform code builder and the missing library "
"manager (Atmel AVR & SAM, Espressif, Freescale Kinetis, "
"Nordic nRF51, NXP LPC, ST STM32, TI MSP430 & Tiva, "
"Teensy, Arduino, mbed, libOpenCM3, etc.)")
__description__ = (
"Cross-platform code builder and the missing library manager "
"(Ready for embedded development, IDE and Continuous integration, "
"Arduino and MBED compatible)"
)
__url__ = "http://platformio.org"
__author__ = "Ivan Kravets"

View File

@ -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)

View File

@ -250,50 +250,6 @@
"vendor": "TinyCircuits"
},
"wildfirev3": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR",
"f_cpu": "16000000L",
"mcu": "atmega1284p",
"variant": "wildfirev3"
},
"frameworks": ["arduino"],
"name": "WickedDevice WildFire v3 [optiboot]",
"platform": "atmelavr",
"upload": {
"maximum_ram_size": 16384,
"maximum_size": 130048,
"protocol": "arduino",
"require_upload_port" : true,
"speed": 115200
},
"url": "http://shop.wickeddevice.com/resources/wildfire/",
"vendor": "WickedDevice"
},
"wildfirev2": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR",
"f_cpu": "16000000L",
"mcu": "atmega1284p",
"variant": "wildfirev2"
},
"frameworks": ["arduino"],
"name": "WickedDevice WildFire v2 [stk500]",
"platform": "atmelavr",
"upload": {
"maximum_ram_size": 16384,
"maximum_size": 122878,
"protocol": "wiring",
"require_upload_port" : true,
"speed": 38400
},
"url": "http://shop.wickeddevice.com/resources/wildfire/#arduinoidesetup",
"vendor": "WickedDevice"
},
"blend": {
"build": {
"core": "arduino",
@ -521,5 +477,49 @@
},
"url": "http://quirkbot.com",
"vendor": "Quirkbot"
},
"wildfirev2": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_MEGA",
"f_cpu": "16000000L",
"mcu": "atmega1284p",
"variant": "wildfirev2"
},
"frameworks": ["arduino"],
"name": "Wicked Device WildFire V2",
"platform": "atmelavr",
"upload": {
"maximum_ram_size": 16384,
"maximum_size": 122878,
"protocol": "wiring",
"require_upload_port" : true,
"speed": 38400
},
"url": "http://shop.wickeddevice.com/resources/wildfire/",
"vendor": "Wicked Device"
},
"wildfirev3": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_AVR_MEGA",
"f_cpu": "16000000L",
"mcu": "atmega1284p",
"variant": "wildfirev3"
},
"frameworks": ["arduino"],
"name": "Wicked Device WildFire V3",
"platform": "atmelavr",
"upload": {
"maximum_ram_size": 16384,
"maximum_size": 130048,
"protocol": "arduino",
"require_upload_port" : true,
"speed": 115200
},
"url": "http://shop.wickeddevice.com/resources/wildfire/",
"vendor": "Wicked Device"
}
}

View File

@ -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"
}
}
}

View File

@ -0,0 +1,86 @@
{
"efm32wg_stk3800": {
"build": {
"f_cpu": "48000000L",
"cpu": "cortex-m4",
"mcu": "efm32wg990f256"
},
"frameworks": ["mbed"],
"name": "Silicon Labs EFM32WG-STK3800 (Wonder Gecko)",
"platform": "siliconlabsefm32",
"upload": {
"maximum_ram_size": 32768,
"maximum_size": 262144
},
"url": "https://developer.mbed.org/platforms/EFM32-Wonder-Gecko/",
"vendor": "Silicon Labs"
},
"efm32gg_stk3700": {
"build": {
"f_cpu": "48000000L",
"cpu": "cortex-m3",
"mcu": "efm32gg990f1024"
},
"frameworks": ["mbed"],
"name": "Silicon Labs EFM32GG-STK3700 (Giant Gecko)",
"platform": "siliconlabsefm32",
"upload": {
"maximum_ram_size": 131072,
"maximum_size": 1048576
},
"url": "https://developer.mbed.org/platforms/EFM32-Giant-Gecko/",
"vendor": "Silicon Labs"
},
"efm32lg_stk3600": {
"build": {
"f_cpu": "48000000L",
"cpu": "cortex-m3",
"mcu": "efm32lg990f256"
},
"frameworks": ["mbed"],
"name": "Silicon Labs EFM32LG-STK3600 (Leopard Gecko)",
"platform": "siliconlabsefm32",
"upload": {
"maximum_ram_size": 32768,
"maximum_size": 262144
},
"url": "https://developer.mbed.org/platforms/EFM32-Leopard-Gecko/",
"vendor": "Silicon Labs"
},
"efm32zg_stk3200": {
"build": {
"f_cpu": "24000000L",
"cpu": "cortex-m0plus",
"mcu": "efm2zg222f32"
},
"frameworks": ["mbed"],
"name": "Silicon Labs EFM32ZG-STK3200 (Zero Gecko)",
"platform": "siliconlabsefm32",
"upload": {
"maximum_ram_size": 4096,
"maximum_size": 32768
},
"url": "https://developer.mbed.org/platforms/EFM32-Zero-Gecko/",
"vendor": "Silicon Labs"
},
"efm32hg_stk3400": {
"build": {
"f_cpu": "24000000L",
"cpu": "cortex-m3",
"mcu": "efm32hg322f64"
},
"frameworks": ["mbed"],
"name": "Silicon Labs SLSTK3400A USB-enabled (Happy Gecko)",
"platform": "siliconlabsefm32",
"upload": {
"maximum_ram_size": 8192,
"maximum_size": 65536
},
"url": "https://developer.mbed.org/platforms/EFM32-Happy-Gecko/",
"vendor": "Silicon Labs"
}
}

View File

@ -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"
}
}
}

View File

@ -11,11 +11,13 @@ except ImportError:
break
from platformio import util
from os.path import join
import json
from os import getenv
from os.path import isfile, join
from time import time
from SCons.Script import (DefaultEnvironment, Exit, SConscript,
SConscriptChdir, Variables)
from SCons.Script import (COMMAND_LINE_TARGETS, DefaultEnvironment, Exit,
SConscript, SConscriptChdir, Variables)
from platformio.exception import UnknownBoard
@ -25,6 +27,7 @@ from platformio.exception import UnknownBoard
commonvars = Variables(None)
commonvars.AddVariables(
("BUILD_SCRIPT",),
("EXTRA_SCRIPT",),
("PIOENV",),
("PLATFORM",),
@ -35,9 +38,11 @@ commonvars.AddVariables(
# options
("FRAMEWORK",),
("BUILD_FLAGS",),
("SRCBUILD_FLAGS",),
("IGNORE_LIBS",),
("USE_LIBS",),
("SRC_BUILD_FLAGS",),
("SRC_FILTER",),
("LIB_DFCYCLIC",),
("LIB_IGNORE",),
("LIB_USE",),
# board options
("BOARD",),
@ -53,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,
@ -62,6 +67,7 @@ DefaultEnvironment(
PIOHOME_DIR=util.get_home_dir(),
PROJECT_DIR=util.get_project_dir(),
PROJECTLIB_DIR=util.get_projectlib_dir(),
PROJECTSRC_DIR=util.get_projectsrc_dir(),
PIOENVS_DIR=util.get_pioenvs_dir(),
@ -69,8 +75,9 @@ DefaultEnvironment(
PIOPACKAGES_DIR=join("$PIOHOME_DIR", "packages"),
BUILD_DIR=join("$PIOENVS_DIR", "$PIOENV"),
BUILDSRC_DIR=join("$BUILD_DIR", "src"),
LIBSOURCE_DIRS=[
join("$PROJECT_DIR", "lib"),
"$PROJECTLIB_DIR",
util.get_lib_dir(),
join("$PLATFORMFW_DIR", "libraries")
]
@ -96,9 +103,11 @@ if "BOARD" in env:
UPLOAD_SPEED="${BOARD_OPTIONS['upload'].get('speed', None)}")
if "ldscript" in env.get("BOARD_OPTIONS", {}).get("build", {}):
env.Replace(
LDSCRIPT_PATH=join(
"$PIOHOME_DIR", "packages", "ldscripts",
"${BOARD_OPTIONS['build']['ldscript']}"
LDSCRIPT_PATH=(
env['BOARD_OPTIONS']['build']['ldscript']
if isfile(env['BOARD_OPTIONS']['build']['ldscript'])
else join("$PIOHOME_DIR", "packages", "ldscripts",
"${BOARD_OPTIONS['build']['ldscript']}")
)
)
@ -109,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",
@ -119,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()

View File

@ -20,14 +20,21 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
with open(path, "w") as f:
f.write(str(value))
upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {})
if env.subst("$UPLOAD_SPEED"):
env.Append(UPLOADERFLAGS=["-b", "$UPLOAD_SPEED"])
if "micronucleus" in env['UPLOADER']:
print "Please unplug/plug device ..."
upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {})
if "usb" in env.subst("$UPLOAD_PROTOCOL"):
upload_options['require_upload_port'] = False
env.Replace(UPLOAD_SPEED=None)
if env.subst("$UPLOAD_SPEED"):
env.Append(UPLOADERFLAGS=[
"-b", "$UPLOAD_SPEED",
"-D"
])
if not upload_options.get("require_upload_port", False):
return
@ -74,7 +81,6 @@ else:
UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"),
UPLOADERFLAGS=[
"-v",
"-D", # disable auto erase for flash memory
"-p", "$BOARD_MCU",
"-C",
'"%s"' % join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude.conf"),

View File

@ -47,8 +47,7 @@ env.Replace(
"-Os",
"-Wl,--gc-sections,--relax",
"-mthumb",
"-mcpu=${BOARD_OPTIONS['build']['cpu']}",
"--specs=nano.specs"
"-mcpu=${BOARD_OPTIONS['build']['cpu']}"
],
LIBS=["c", "gcc", "m"],

View File

@ -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)
#

View File

@ -161,7 +161,7 @@ if BOARD_BUILDOPTS.get("core", None) == "teensy":
# search relative includes in teensy directories
core_dir = join(env.get("PIOHOME_DIR"), "packages",
"framework-arduinoteensy", "cores", "teensy")
for item in listdir(core_dir):
for item in sorted(listdir(core_dir)):
file_path = join(core_dir, item)
if not isfile(file_path):
continue

View File

@ -32,7 +32,7 @@ BOARD_BUILDOPTS = env.get("BOARD_OPTIONS", {}).get("build", {})
def find_ldscript(src_dir):
ldscript = None
matches = []
for item in listdir(src_dir):
for item in sorted(listdir(src_dir)):
_path = join(src_dir, item)
if not isfile(_path) or not item.endswith(".ld"):
continue

View File

@ -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 = {

View File

@ -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)

View File

@ -0,0 +1,50 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
"""
Builder for Silicon Labs EFM32 series ARM microcontrollers.
"""
from os.path import join
from SCons.Script import (COMMAND_LINE_TARGETS, AlwaysBuild, Default,
DefaultEnvironment, SConscript)
env = DefaultEnvironment()
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
#
# Target: Build executable and linkable firmware
#
target_elf = env.BuildFirmware()
#
# Target: Build the .bin file
#
if "uploadlazy" in COMMAND_LINE_TARGETS:
target_firm = join("$BUILD_DIR", "firmware.bin")
else:
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
#
# Target: Print binary size
#
target_size = env.Alias("size", target_elf, "$SIZEPRINTCMD")
AlwaysBuild(target_size)
#
# Target: Upload by default .bin file
#
upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk)
AlwaysBuild(upload)
#
# Target: Define targets
#
Default([target_firm, target_size])

View File

@ -53,6 +53,8 @@ env.Append(
"${BOARD_OPTIONS['build']['variant'].upper()}"
],
LIBS=["stdc++", "nosys"],
LINKFLAGS=[
"-nostartfiles",
"-nostdlib"

View 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

View File

@ -69,18 +69,25 @@ def AutodetectUploadPort(env):
if (not item['name'] or
not any([l in item['name'].lower() for l in msdlabels])):
continue
print "Auto-detected UPLOAD_PORT/DISK: %s" % item['disk']
env.Replace(UPLOAD_PORT=item['disk'])
break
else:
board_build_opts = env.get("BOARD_OPTIONS", {}).get("build", {})
board_hwid = ("%s:%s" % (
board_build_opts.get("vid"),
board_build_opts.get("pid")
)).replace("0x", "")
for item in get_serialports():
if "VID:PID" not in item['hwid']:
continue
print "Auto-detected UPLOAD_PORT: %s" % item['port']
env.Replace(UPLOAD_PORT=item['port'])
break
if board_hwid in item['hwid']:
break
if "UPLOAD_PORT" not in env:
if "UPLOAD_PORT" in env:
print "Auto-detected UPLOAD_PORT/DISK: %s" % env['UPLOAD_PORT']
else:
Exit("Error: Please specify `upload_port` for environment or use "
"global `--upload-port` option.\n"
"For the some development platforms it can be USB flash drive\n")

View File

@ -1,19 +1,25 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
import atexit
import json
import re
from os import getenv, listdir, remove, sep, walk
from glob import glob
from os import getenv, listdir, sep, walk
from os.path import basename, dirname, isdir, isfile, join, normpath
from SCons.Script import (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
@ -26,54 +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(
env.Prepend(
_LIBFLAGS="-Wl,--start-group "
)
firmenv.Append(
env.Append(
_LIBFLAGS=" -Wl,--end-group"
)
_srcbuild_flags = getenv("PLATFORMIO_SRCBUILD_FLAGS",
env.subst("$SRCBUILD_FLAGS"))
if _srcbuild_flags:
firmenv.MergeFlags(_srcbuild_flags)
# Handle SRC_BUILD_FLAGS
if getenv("PLATFORMIO_SRC_BUILD_FLAGS", None):
env.MergeFlags(getenv("PLATFORMIO_SRC_BUILD_FLAGS"))
if "SRC_BUILD_FLAGS" in env:
env.MergeFlags(env['SRC_BUILD_FLAGS'])
firmenv.Append(
env.Append(
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
*pioversion_to_intstr())]
)
if "envdump" in COMMAND_LINE_TARGETS:
print env.Dump()
Exit()
if "idedata" in COMMAND_LINE_TARGETS:
_data = {"defines": [], "includes": []}
for item in env.get("VARIANT_DIRS", []):
_data['includes'].append(env.subst(item[1]))
for item in env.get("CPPDEFINES", []):
_data['defines'].append(env.subst(item))
print json.dumps(_data)
Exit()
return firmenv.Program(
return env.Program(
join("$BUILD_DIR", "firmware"),
[firmenv.GlobCXXFiles(vdir) for vdir in vdirs],
LIBS=list(env.get("LIBS", []) + deplibs)[::-1],
env.LookupSources(
"$BUILDSRC_DIR", "$PROJECTSRC_DIR", duplicate=False,
src_filter=getenv("PLATFORMIO_SRC_FILTER",
env.get("SRC_FILTER", None))),
LIBS=env.get("LIBS", []) + deplibs,
LIBPATH=env.get("LIBPATH", []) + ["$BUILD_DIR"],
PROGSUFFIX=".elf"
)
@ -83,6 +77,9 @@ def ProcessFlags(env):
if "extra_flags" in env.get("BOARD_OPTIONS", {}).get("build", {}):
env.MergeFlags(env.subst("${BOARD_OPTIONS['build']['extra_flags']}"))
# Handle BUILD_FLAGS
if getenv("PLATFORMIO_BUILD_FLAGS", None):
env.MergeFlags(getenv("PLATFORMIO_BUILD_FLAGS"))
if "BUILD_FLAGS" in env:
env.MergeFlags(env['BUILD_FLAGS'])
@ -95,13 +92,13 @@ def ProcessFlags(env):
env.Append(_CPPDEFFLAGS=" %s" % " ".join(undefines))
def GlobCXXFiles(env, path):
files = []
for suff in ["*.c", "*.cpp", "*.S"]:
_list = env.Glob(join(path, suff))
if _list:
files += _list
return files
def IsFileWithExt(env, file_, ext): # pylint: disable=W0613
if basename(file_).startswith("."):
return False
for e in ext:
if file_.endswith(".%s" % e):
return True
return False
def VariantDirWrap(env, variant_dir, src_dir, duplicate=True):
@ -109,24 +106,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 +165,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 +174,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 +187,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 +227,7 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
if not isdir(lsd_dir):
continue
for ld in USE_LIBS + listdir(lsd_dir):
for ld in env.get("LIB_USE", []) + sorted(listdir(lsd_dir)):
if not isdir(join(lsd_dir, ld)):
continue
@ -220,7 +240,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 +270,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):
@ -278,23 +298,23 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
len(state['ordered']) + 1, finder.getLibName(),
_lib_dir))
state['libs'].add(_lib_dir)
state = _process_src_dir(state, _lib_dir)
if env.subst("$LIB_DFCYCLIC").lower() == "true":
state = _process_src_dir(state, _lib_dir)
return state
# end internal prototypes
deplibs = _get_dep_libs(src_dir)
env.Prepend(
CPPPATH=[join("$BUILD_DIR", l) for (l, _) in deplibs]
)
# add automatically "utility" dir from the lib (Arduino issue)
env.Prepend(
CPPPATH=[
join("$BUILD_DIR", l, "utility") for (l, ld) in deplibs
if isdir(join(ld, "utility"))
]
)
for l, ld in deplibs:
env.Append(
CPPPATH=[join("$BUILD_DIR", l)]
)
# add automatically "utility" dir from the lib (Arduino issue)
if isdir(join(ld, "utility")):
env.Append(
CPPPATH=[join("$BUILD_DIR", l, "utility")]
)
libs = []
for (libname, inc_dir) in deplibs:
@ -305,105 +325,6 @@ def BuildDependentLibraries(env, src_dir): # pylint: disable=R0914
return libs
class InoToCPPConverter(object):
PROTOTYPE_RE = re.compile(
r"""^(
(?:\s*[a-z_\d]+){1,2} # return type
\s+[a-z_\d]+\s* # name of prototype
\([a-z_,\.\*\&\[\]\s\d]*\) # arguments
)\s*\{ # must end with {
""",
re.X | re.M | re.I
)
DETECTMAIN_RE = re.compile(r"void\s+(setup|loop)\s*\(", re.M | re.I)
STRIPCOMMENTS_RE = re.compile(r"(/\*.*?\*/|//[^\r\n]*$)", re.M | re.S)
def __init__(self, nodes):
self.nodes = nodes
def is_main_node(self, contents):
return self.DETECTMAIN_RE.search(contents)
@staticmethod
def _replace_comments_callback(match):
if "\n" in match.group(1):
return "\n" * match.group(1).count("\n")
else:
return " "
def append_prototypes(self, fname, contents, prototypes):
contents = self.STRIPCOMMENTS_RE.sub(self._replace_comments_callback,
contents)
result = []
is_appended = False
linenum = 0
for line in contents.splitlines():
linenum += 1
line = line.strip()
if not is_appended and line and not line.startswith("#"):
is_appended = True
result.append("%s;" % ";\n".join(prototypes))
result.append('#line %d "%s"' % (linenum, fname))
result.append(line)
return result
def convert(self):
prototypes = []
data = []
for node in self.nodes:
ino_contents = node.get_text_contents()
prototypes += self.PROTOTYPE_RE.findall(ino_contents)
item = (basename(node.get_path()), ino_contents)
if self.is_main_node(ino_contents):
data = [item] + data
else:
data.append(item)
if not data:
return None
result = ["#include <Arduino.h>"]
is_first = True
for name, contents in data:
if is_first and prototypes:
result += self.append_prototypes(name, contents, prototypes)
else:
result.append('#line 1 "%s"' % name)
result.append(contents)
is_first = False
return "\n".join(result)
def ConvertInoToCpp(env):
def delete_tmpcpp_file(file_):
remove(file_)
ino_nodes = (env.Glob(join("$PROJECTSRC_DIR", "*.ino")) +
env.Glob(join("$PROJECTSRC_DIR", "*.pde")))
c = InoToCPPConverter(ino_nodes)
data = c.convert()
if not data:
return
tmpcpp_file = join(env.subst("$PROJECTSRC_DIR"), "tmp_ino_to.cpp")
with open(tmpcpp_file, "w") as f:
f.write(data)
atexit.register(delete_tmpcpp_file, tmpcpp_file)
def exists(_):
return True
@ -411,11 +332,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)
return env

View File

@ -3,8 +3,8 @@
import stat
from glob import glob
from os import chmod, environ, makedirs, remove
from os.path import abspath, basename, isdir, isfile, join
from os import chmod, getenv, makedirs, remove
from os.path import abspath, basename, expanduser, isdir, isfile, join
from shutil import copyfile, copytree, rmtree
from tempfile import mkdtemp
@ -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:
@ -59,7 +63,7 @@ def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913
build_dir, keep_build_dir, project_conf, verbose):
if not src:
src = environ.get("PLATFORMIO_CI_SRC", "").split(":")
src = getenv("PLATFORMIO_CI_SRC", "").split(":")
if not src:
raise click.BadParameter("Missing argument 'src'")
@ -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):

View File

@ -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(

View File

@ -142,8 +142,23 @@ def lib_install_dependency(ctx, data):
query.append('+"%s"' % data[key])
result = get_api_result("/lib/search", dict(query=" ".join(query)))
assert result['total'] == 1
ctx.invoke(lib_install, libid=[result['items'][0]['id']])
assert result['total'] > 0
if result['total'] == 1 or not app.get_setting("enable_prompts"):
ctx.invoke(lib_install, libid=[result['items'][0]['id']])
else:
click.secho(
"Conflict: More then one dependent libraries have been found "
"by request %s:" % json.dumps(data), fg="red")
echo_liblist_header()
for item in result['items']:
echo_liblist_item(item)
deplib_id = click.prompt(
"Please choose one dependent library ID",
type=click.Choice([str(i['id']) for i in result['items']]))
ctx.invoke(lib_install, libid=[int(deplib_id)])
@cli.command("uninstall", short_help="Uninstall libraries")

View File

@ -2,8 +2,9 @@
# See LICENSE for details.
from datetime import datetime
from os import chdir, getcwd
from os.path import getmtime, isdir, join
from hashlib import sha1
from os import getcwd, makedirs, walk
from os.path import getmtime, isdir, isfile, join
from shutil import rmtree
from time import time
@ -28,9 +29,7 @@ from platformio.platforms.base import PlatformFactory
@click.pass_context
def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
project_dir, verbose):
initial_cwd = getcwd()
chdir(project_dir)
try:
with util.cd(project_dir):
config = util.get_project_config()
if not config.sections():
@ -40,12 +39,8 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
if unknown:
raise exception.UnknownEnvNames(", ".join(unknown))
# remove ".pioenvs" if project config is modified
_pioenvs_dir = util.get_pioenvs_dir()
if (isdir(_pioenvs_dir) and
getmtime(join(util.get_project_dir(), "platformio.ini")) >
getmtime(_pioenvs_dir)):
rmtree(_pioenvs_dir)
# clean obsolete .pioenvs dir
_clean_pioenvs_dir()
results = []
for section in config.sections():
@ -74,17 +69,23 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
if not all(results):
raise exception.ReturnErrorCode()
finally:
chdir(initial_cwd)
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)
@ -115,6 +116,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:
@ -123,7 +141,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):
@ -145,22 +163,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):
@ -180,3 +218,41 @@ def _autoinstall_libs(ctx, libids_list):
", ".join([str(i) for i in not_intalled_libs])
)):
ctx.invoke(cmd_lib_install, libid=not_intalled_libs)
def _clean_pioenvs_dir():
pioenvs_dir = util.get_pioenvs_dir()
structhash_file = join(pioenvs_dir, "structure.hash")
proj_hash = calculate_project_hash()
# if project's config is modified
if (isdir(pioenvs_dir) and
getmtime(join(util.get_project_dir(), "platformio.ini")) >
getmtime(pioenvs_dir)):
rmtree(pioenvs_dir)
# check project structure
if isdir(pioenvs_dir) and isfile(structhash_file):
with open(structhash_file) as f:
if f.read() == proj_hash:
return
rmtree(pioenvs_dir)
if not isdir(pioenvs_dir):
makedirs(pioenvs_dir)
with open(structhash_file, "w") as f:
f.write(proj_hash)
def calculate_project_hash():
structure = []
for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()):
if not isdir(d):
continue
for root, _, files in walk(d):
for f in files:
path = join(root, f)
if not any([s in path for s in (".git", ".svn")]):
structure.append(path)
return sha1(",".join(sorted(structure))).hexdigest() if structure else ""

View File

@ -68,7 +68,7 @@ def serialports_list(json_output):
@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():

View File

@ -3,7 +3,6 @@
from email.utils import parsedate_tz
from math import ceil
from os import environ
from os.path import getsize, join
from time import mktime
@ -26,8 +25,11 @@ class FileDownloader(object):
self._destination = self._fname
if dest_dir:
self.set_destination(join(dest_dir, self._fname))
self._progressbar = None
self._progressbar = None
self._request = None
# make connection
self._request = requests.get(url, stream=True,
headers=util.get_request_defheaders())
if self._request.status_code != 200:
@ -50,7 +52,7 @@ class FileDownloader(object):
f = open(self._destination, "wb")
chunks = int(ceil(self.get_size() / float(self.CHUNK_SIZE)))
if environ.get("CI") == "true":
if util.is_ci():
click.echo("Downloading...")
for _ in range(0, chunks):
f.write(next(itercontent))
@ -94,4 +96,5 @@ class FileDownloader(object):
util.change_filemtime(self._destination, lmtime)
def __del__(self):
self._request.close()
if self._request:
self._request.close()

View File

@ -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):

View File

@ -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()
@ -23,19 +23,22 @@ class ProjectGenerator(object):
@staticmethod
def get_supported_ides():
tpls_dir = join(util.get_source_dir(), "ide", "tpls")
return [d for d in listdir(tpls_dir)
if isdir(join(tpls_dir, d))]
return sorted([d for d in listdir(tpls_dir)
if isdir(join(tpls_dir, d))])
@staticmethod
def get_project_env():
data = {}
config = util.get_project_config()
for section in config.sections():
if not section.startswith("env:"):
continue
data['env_name'] = section[4:]
for k, v in config.items(section):
data[k] = v
@util.memoized
def get_project_env(self):
data = {"env_name": "PlatformIO"}
with util.cd(self.project_dir):
config = util.get_project_config()
for section in config.sections():
if not section.startswith("env:"):
continue
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
@ -44,7 +47,8 @@ class ProjectGenerator(object):
if "env_name" not in envdata:
return None
result = util.exec_command(
["platformio", "run", "-t", "idedata", "-e", envdata['env_name']]
["platformio", "run", "-t", "idedata", "-e", envdata['env_name'],
"--project-dir", self.project_dir]
)
if result['returncode'] != 0 or '{"includes":' not in result['out']:
return None
@ -62,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 = ""
@ -98,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
})

View 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>

View 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>

View 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>

View 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>

View 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}
)

View File

@ -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:

View File

@ -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}}"

View File

@ -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 -t 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 -t 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>

View File

@ -5,6 +5,7 @@
"cmd":
[
"platformio",
"--force",
"run"
],
"name": "PlatformIO",

View File

@ -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>

View File

@ -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 -t clean</NMakeCleanCommandLine>
<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>

View File

@ -36,7 +36,7 @@ class LibraryManager(object):
items = {}
if not isdir(self.lib_dir):
return items
for dirname in listdir(self.lib_dir):
for dirname in sorted(listdir(self.lib_dir)):
conf_path = join(self.lib_dir, dirname, self.CONFIG_NAME)
if not isfile(conf_path):
continue

View File

@ -3,6 +3,7 @@
import re
import struct
import sys
from os import remove
from os.path import isdir, isfile, join
from shutil import rmtree
@ -25,6 +26,13 @@ from platformio.util import get_home_dir
def on_platformio_start(ctx, force):
app.set_session_var("force_option", force)
telemetry.on_command(ctx)
# skip any check operations when upgrade process
args = [str(s).lower() for s in sys.argv[1:]
if not str(s).startswith("-")]
if len(args) > 1 and args[1] == "upgrade":
return
after_upgrade(ctx)
try:
@ -78,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):

View File

@ -2,11 +2,12 @@
# See LICENSE for details.
from os import makedirs, remove
from os.path import isdir, join
from os.path import basename, isdir, isfile, join
from shutil import rmtree
from time import time
import click
import requests
from platformio import exception, telemetry, util
from platformio.app import get_state_item, set_state_item
@ -85,7 +86,17 @@ class PackageManager(object):
if not isdir(pkg_dir):
makedirs(pkg_dir)
dlpath = self.download(info['url'], pkg_dir, info['sha1'])
dlpath = None
try:
dlpath = self.download(info['url'], pkg_dir, info['sha1'])
except requests.exceptions.ConnectionError:
if info['url'].startswith("http://sourceforge.net"):
dlpath = self.download(
"http://dl.platformio.org/packages/%s" %
basename(info['url']), pkg_dir, info['sha1'])
assert isfile(dlpath)
if self.unpack(dlpath, pkg_dir):
self._register(name, info['version'])
# remove archive

View File

@ -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)

View File

@ -139,7 +139,7 @@ class PlatformFactory(object):
pdir = join(d, "platforms")
if not isdir(pdir):
continue
for p in listdir(pdir):
for p in sorted(listdir(pdir)):
if (p in ("__init__.py", "base.py") or not
p.endswith(".py")):
continue
@ -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)]

View File

@ -0,0 +1,36 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from platformio.platforms.base import BasePlatform
class Siliconlabsefm32Platform(BasePlatform):
"""
Silicon Labs EFM32 Gecko 32-bit microcontroller (MCU) family includes
devices that offer flash memory configurations up to 256 kB, 32 kB of
RAM and CPU speeds up to 48 MHz.
Based on the powerful ARM Cortex-M core, the Gecko family features
innovative low energy techniques, short wake-up time from energy saving
modes and a wide selection of peripherals, making it ideal for battery
operated applications and other systems requiring high performance and
low-energy consumption.
http://www.silabs.com/products/mcu/32-bit/efm32-gecko/Pages/efm32-gecko.aspx
"""
PACKAGES = {
"toolchain-gccarmnoneeabi": {
"alias": "toolchain",
"default": True
},
"framework-mbed": {
"default": True
}
}
def get_name(self):
return "Silicon Labs EFM32"

View File

@ -4,15 +4,15 @@
import atexit
import platform
import re
import sys
import threading
import uuid
from sys import argv as sys_argv
from time import time
import click
import requests
from platformio import __version__, app, util
from platformio import __version__, app, exception, util
class TelemetryBase(object):
@ -91,7 +91,8 @@ class MeasurementProtocol(TelemetryBase):
self['cd4'] = 1 if app.get_setting("enable_prompts") else 0
def _prefill_screen_name(self):
args = [str(s).lower() for s in sys_argv[1:]]
args = [str(s).lower() for s in sys.argv[1:]
if not str(s).startswith("-")]
if not args:
return
@ -101,7 +102,7 @@ class MeasurementProtocol(TelemetryBase):
cmd_path = args[:1]
self['screen_name'] = " ".join([p.title() for p in cmd_path])
self['cd3'] = " ".join(args)
self['cd3'] = " ".join([str(s).lower() for s in sys.argv[1:]])
def send(self, hittype):
if not app.get_setting("enable_telemetry"):
@ -218,9 +219,11 @@ def on_event(category, action, label=None, value=None, screen_name=None):
def on_exception(e):
if isinstance(e, exception.AbortedByUser):
return
mp = MeasurementProtocol()
mp['exd'] = "%s: %s" % (type(e).__name__, e)
mp['exf'] = 1
mp['exf'] = int(not isinstance(e, exception.PlatformioException))
mp.send("exception")

View File

@ -1,7 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
from os import chmod, environ
from os import chmod
from os.path import join, splitext
from tarfile import open as tarfile_open
from time import mktime
@ -9,8 +9,8 @@ from zipfile import ZipFile
import click
from platformio import util
from platformio.exception import UnsupportedArchiveType
from platformio.util import change_filemtime
class ArchiveBase(object):
@ -51,7 +51,7 @@ class ZIPArchive(ArchiveBase):
@staticmethod
def preserve_mtime(item, dest_dir):
change_filemtime(
util.change_filemtime(
join(dest_dir, item.filename),
mktime(list(item.date_time) + [0]*3)
)
@ -81,7 +81,7 @@ class FileUnpacker(object):
raise UnsupportedArchiveType(archpath)
def start(self):
if environ.get("CI") == "true":
if util.is_ci():
click.echo("Unpacking...")
for item in self._unpacker.get_items():
self._unpacker.extract_item(item, self._dest_dir)

View File

@ -55,6 +55,18 @@ class AsyncPipe(Thread):
self.join()
class cd(object):
def __init__(self, new_path):
self.new_path = new_path
self.prev_path = os.getcwd()
def __enter__(self):
os.chdir(self.new_path)
def __exit__(self, etype, value, traceback):
os.chdir(self.prev_path)
class memoized(object):
'''
Decorator. Caches a function's return value each time it is called.
@ -155,6 +167,10 @@ def get_projectsrc_dir():
)
def get_projectlib_dir():
return join(get_project_dir(), "lib")
def get_pioenvs_dir():
return _get_projconf_option_dir(
"envs_dir",
@ -175,6 +191,10 @@ def change_filemtime(path, time):
os.utime(path, (time, time))
def is_ci():
return os.getenv("CI", "").lower() == "true"
def exec_command(*args, **kwargs):
result = {
"out": None,
@ -246,8 +266,9 @@ def get_logicaldisks():
def get_request_defheaders():
return {"User-Agent": "PlatformIO/%s %s" % (
__version__, requests.utils.default_user_agent())}
return {"User-Agent": "PlatformIO/%s CI/%d %s" % (
__version__, int(is_ci()), requests.utils.default_user_agent()
)}
def get_api_result(path, params=None, data=None):
@ -288,7 +309,7 @@ def _lookup_boards():
bdirs.append(join(get_home_dir(), "boards"))
for bdir in bdirs:
for json_file in os.listdir(bdir):
for json_file in sorted(os.listdir(bdir)):
if not json_file.endswith(".json"):
continue
with open(join(bdir, json_file)) as f:

View File

@ -1,6 +1,5 @@
click==4.0
bottle=0.12.8
bottle==0.12.8
colorama==0.3.3
pyserial==2.7
requests==2.7.0
scons==2.3.0

View File

@ -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)

View File

@ -100,8 +100,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"
]]
])
]

View File

@ -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 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"
)
)

View File

@ -30,8 +30,7 @@ def test_run(platformio_setup, pioproject_dir):
rmtree(join(pioproject_dir, ".pioenvs"))
result = exec_command(
["platformio", "run"],
cwd=pioproject_dir
["platformio", "--force", "run", "--project-dir", pioproject_dir]
)
if result['returncode'] != 0:
pytest.fail(result)
@ -39,6 +38,8 @@ def test_run(platformio_setup, pioproject_dir):
# check .elf file
pioenvs_dir = join(pioproject_dir, ".pioenvs")
for item in listdir(pioenvs_dir):
if not isdir(item):
continue
assert isfile(join(pioenvs_dir, item, "firmware.elf"))
# check .hex or .bin files
firmwares = []

View File

@ -54,14 +54,20 @@ def test_package(package_data, sfpkglist):
assert package_data['url'].endswith("%d.tar.gz" % package_data['version'])
# check content type and that file exists
r = requests.head(package_data['url'], allow_redirects=True)
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")
validate_response(r)
assert r.headers['Content-Type'] in ("application/x-gzip",
"application/octet-stream")
# check sha1 sum
if sfpkglist is None:
return pytest.skip("SF is offline")
return pytest.skip("SF is off-line")
pkgname = basename(package_data['url'])
assert pkgname in sfpkglist
assert package_data['sha1'] == sfpkglist.get(pkgname, {}).get("sha1")

Some files were not shown because too many files have changed in this diff Show More