Compare commits

..

90 Commits

Author SHA1 Message Date
Ivan Kravets
aea7121076 Merge branch 'release/v2.1.1' 2015-06-09 22:21:21 +03:00
Ivan Kravets
dc13048254 Version bump to 2.1.1 (issues #229, #231, #232) 2015-06-09 22:20:53 +03:00
Ivan Kravets
18145d2c1c Add OpenHub badge 2015-06-09 22:08:13 +03:00
Ivan Kravets
f868c64d81 Automatically detect upload port using VID:PID board settings // Resolve #231 2015-06-08 23:02:05 +03:00
Ivan Kravets
3b7ad2d333 Avoid "LibInstallDependencyError" when more then 1 library is found // Resolve #229 2015-06-06 16:41:00 +03:00
Ivan Kravets
6732c7cb7c Better handling of user exceptions 2015-06-06 15:02:12 +03:00
Ivan Kravets
7ba67582de Fix indention 2015-06-05 19:30:49 +03:00
Ivan Kravets
35ae470196 Fix Windows Error 32 while cleanup pioenvs dir 2015-06-05 19:12:57 +03:00
Ivan Kravets
fa339a8b70 Fix firmware verification for examples 2015-06-04 23:17:18 +03:00
Ivan Kravets
43b27c138a Fix bad indentation 2015-06-04 23:15:28 +03:00
Ivan Kravets
36cdbb8f0c Improv detection of build changes 2015-06-04 22:50:13 +03:00
Ivan Kravets
8c331df105 Use direct path to LDScript 2015-06-04 21:24:19 +03:00
Ivan Kravets
02d4efcfb5 Merge branch 'release/v2.1.0' into develop 2015-06-03 19:54:52 +03:00
Ivan Kravets
00cb6bd845 Merge branch 'release/v2.1.0' 2015-06-03 19:54:51 +03:00
Ivan Kravets
f038c7a28e Version bump to 2.1.0 (issues #215, #219, #221, #225, #226) 2015-06-03 19:54:39 +03:00
Ivan Kravets
18b4497be7 Add info about Silicon Labs EFM32 platform 2015-06-03 19:53:00 +03:00
Ivan Kravets
8704ad4032 Add new article by @lekum "Discovering PlatformIO: The RaspberryPi / Arduino combo kit is...." 2015-06-03 19:42:48 +03:00
Ivan Kravets
f899e255f3 Add Silicon Labs EFM32 "siliconlabsefm32" development platform // Issue #226 2015-06-03 19:31:09 +03:00
Ivan Kravets
23cf725c20 Skip SF 5xx errors 2015-06-03 19:14:10 +03:00
Ivan Kravets
ba20459178 Merge pull request #227 from valeros/develop
Add Silicon Labs EFM32 development platform // Resolve #226
2015-06-02 17:07:54 +03:00
Valeriy Koval
442604003d Add Silicon Labs EFM32 development platform // Resolve #226 2015-06-02 14:38:41 +03:00
Ivan Kravets
369d0e1a00 Fix response with 504 code when SF is off-line 2015-06-01 17:49:04 +03:00
Ivan Kravets
04b2f94478 Enable auto erase for flash memory while uploading 2015-06-01 17:26:17 +03:00
Ivan Kravets
61b2bd6cb8 Describe in documentation how to create/register own board for PlatformIO 2015-05-30 17:09:01 +03:00
Ivan Kravets
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
Valeriy Koval
3cb3b4f2ba Update IDE pictures in docs with "forced" run command // Resolve #215 2015-05-29 22:24:04 +03:00
Ivan Kravets
2f376c9d36 Bump to 2.0.3.dev1 2015-05-29 20:33:24 +03:00
Ivan Kravets
c4877e4444 Fix firmware uploading using USB programmer (USBasp) for atmelavr platform // Resolve #221 2015-05-29 20:29:24 +03:00
Ivan Kravets
a288736ced Fix broken tests when SF is offline 2015-05-29 18:34:21 +03:00
Ivan Kravets
1debe847d4 Disabled "nano.specs" for ARM-based platforms // Resolve #219 2015-05-29 17:47:30 +03:00
Ivan Kravets
0c2a15a866 Trim whitespaces 2015-05-29 17:44:57 +03:00
Ivan Kravets
da7e60b49f Switch badges to shields.io 2015-05-29 14:42:41 +03:00
Ivan Kravets
d7c6da71f1 Integrate PlatformIO with Shippable CI 2015-05-28 21:07:41 +03:00
Ivan Kravets
c4ed09c68f Integrate PlatformIO with Circle CI 2015-05-28 16:10:11 +03:00
Ivan Kravets
06baa98823 Fix "ConnectionError" when PlatformIO SF Storage is off-line 2015-05-28 13:44:10 +03:00
Ivan Kravets
8d9071e7c2 Merge branch 'feature/circleci' into develop 2015-05-28 13:10:48 +03:00
Ivan Kravets
8d0785cf1b Fix Circle CI Example 2015-05-28 13:10:36 +03:00
Ivan Kravets
ef0ce3fc07 Update project submodules 2015-05-28 12:44:37 +03:00
Ivan Kravets
af9cdd0694 Remove invalid PyPi SCons package 2015-05-28 12:38:21 +03:00
Ivan Kravets
a120514e9e Fix bottle requirement 2015-05-28 12:35:25 +03:00
Ivan Kravets
e627a6ebdd Fix environment 2015-05-28 12:30:55 +03:00
Ivan Kravets
94c37f4584 Integrate Circle CI 2015-05-28 12:28:24 +03:00
Ivan Kravets
a48b62b0f2 Disable Travis CI cache 2015-05-28 12:03:46 +03:00
Ivan Kravets
a9a9545b37 Fix resolving of C/C++ std libs by Eclipse IDE // Resolve #220 2015-05-28 00:19:55 +03:00
Ivan Kravets
ca1df9462d Bump version to 2.0.2 2015-05-27 19:32:47 +03:00
Ivan Kravets
32b057d1f3 Merge branch 'release/v2.0.2' 2015-05-27 19:27:02 +03:00
Ivan Kravets
5e340843b1 Fix order for "listdir" method 2015-05-27 19:21:29 +03:00
Ivan Kravets
0311298af1 Update history with 2.0.1 release 2015-05-27 17:03:34 +03:00
Ivan Kravets
b4c2e9301c Merge branch 'release/v.2.0.1' 2015-05-27 17:02:08 +03:00
Ivan Kravets
089ef2fa08 Merge branch 'release/v.2.0.1' into develop 2015-05-27 17:02:08 +03:00
Ivan Kravets
9232c7abb1 Version bump to 2.0.1 (issues #210, #211, #212, #214, #216, #217) 2015-05-27 17:01:59 +03:00
Ivan Kravets
27b7c2e201 Enhance docs for Library Manager 2015-05-27 16:23:39 +03:00
Ivan Kravets
392758a842 Allow to control cyclic behaviour of Library Dependency Finder 2015-05-26 23:45:29 +03:00
Ivan Kravets
25fde8db86 Cleanup boards 2015-05-26 23:00:40 +03:00
Ivan Kravets
65ad07af6b Fix failing with `platformio init --ide eclipse` without boards // Resolve #217 2015-05-26 22:55:59 +03:00
Ivan Kravets
ac7479415b Add support for new WildFire boards from Wicked Device to atmelavr platform 2015-05-26 22:52:09 +03:00
Ivan Kravets
1f64f0aacf Merge pull request #218 from valeros/develop
Add WildFire boards from Wicked Device.
2015-05-26 20:47:24 +03:00
Valeriy Koval
8fb0e1b75f Add WildFire boards from Wicked Device. 2015-05-26 20:06:37 +03:00
Ivan Kravets
78db2cda27 Use forced run command and "--project-dir" option 2015-05-26 16:41:45 +03:00
Ivan Kravets
6534fdaf04 Pass all environment variables which shall be copied from the tox invocation environment 2015-05-26 16:16:14 +03:00
Ivan Kravets
2e214f16e7 Return args + options for telemetry 2015-05-26 15:04:47 +03:00
Ivan Kravets
1f373b1e47 Handle AVR Symbols when initialising project for IDE // Resolve #216 2015-05-26 13:59:33 +03:00
Ivan Kravets
4d36db1319 Improve handling of sys.args 2015-05-26 13:07:36 +03:00
Ivan Kravets
58f0f8fab4 Use "include" directories from toolchain when exporting project for IDE // Resolve #210 2015-05-25 23:33:38 +03:00
Ivan Kravets
7d949ecb16 Fix old-style class defination 2015-05-25 23:29:10 +03:00
Ivan Kravets
be70047233 Improve running project from other directory (not CWD) 2015-05-25 23:26:35 +03:00
Ivan Kravets
7649769437 Disable packages/libs updating while "upgrade" operation // Resolve #214 2015-05-25 22:50:46 +03:00
Ivan Kravets
bcf0cc26aa Add --force for run command 2015-05-25 21:45:50 +03:00
Ivan Kravets
96ce0692f8 Merge branch 'feature/reversed-cppath' into develop 2015-05-25 19:35:48 +03:00
Ivan Kravets
9ba3136a24 Fix library order 2015-05-25 19:35:40 +03:00
Ivan Kravets
92313c0686 Reversed order for CPPATH via Append 2015-05-25 13:35:26 +03:00
Ivan Kravets
a1bb98fd5c Reversed order for CPPATH 2015-05-25 13:18:52 +03:00
Ivan Kravets
146d430695 Revert CI detecting 2015-05-25 13:17:50 +03:00
Ivan Kravets
b6a0a0f7c7 Merge pull request #213 from valeros/develop
Add c++ support for ststm32 platform // Resolve #211
2015-05-25 12:54:06 +03:00
Valeriy Koval
97de38d6a6 Add c++ support for ststm32 platform // Resolve #211 2015-05-25 12:45:36 +03:00
Ivan Kravets
65ba676f01 Correct path to import project in VisualStudio 2015-05-25 12:00:53 +03:00
Ivan Kravets
5d9f81533d Use os.environ to detect CI system 2015-05-25 10:11:28 +03:00
Ivan Kravets
1948a730d9 Pass environment variables to subprocess 2015-05-25 09:50:37 +03:00
Ivan Kravets
77f2b17afd Update package for Arduino framework to 1.6.4 // Resolve #212 2015-05-24 18:48:45 +03:00
Ivan Kravets
8739efaee4 Simplify Travis example 2015-05-24 01:02:12 +03:00
Ivan Kravets
8f65492d96 Extend ASM list of source files 2015-05-23 20:23:13 +03:00
Ivan Kravets
4f10047ba3 Handle new environment variable PLATFORMIO_BUILD_FLAGS 2015-05-23 19:17:07 +03:00
Ivan Kravets
9560a665e5 Better detecting of Continuous Integration system 2015-05-23 18:36:11 +03:00
Ivan Kravets
1113e5d69c Improve Travis CI docs 2015-05-23 17:42:22 +03:00
Ivan Kravets
363c65da5f Fix stripping comments when converting from *.ino to *.cpp 2015-05-23 15:00:21 +03:00
Ivan Kravets
28dd32070f Pass to API requests information about Continuous Integration system 2015-05-23 14:23:55 +03:00
Ivan Kravets
f732d4088b Fix bug with converting "*.ino" to "*.cpp" 2015-05-23 14:02:05 +03:00
Ivan Kravets
e22e4d23e4 Fix broken link 2015-05-22 22:16:27 +03:00
Ivan Kravets
ce7d6f0507 Add where PlatformIO 2.0 was made 2015-05-22 22:03:55 +03:00
Ivan Kravets
f499494963 Merge branch 'release/v2.0.0' into develop 2015-05-22 21:49:14 +03:00
60 changed files with 912 additions and 220 deletions

View File

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

View File

@@ -1,10 +1,68 @@
Release History
===============
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 variables
`PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`_
and `PLATFORMIO_LDF_CYCLIC <http://docs.platformio.org/en/latest/envvars.html#platformio-ldf-cyclic>`_
* Pass to API requests information about Continuous Integration system. This
information will be used by PlatformIO-API.
* Use ``include`` directories from toolchain when initialising project for IDE
(`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>`_)
@@ -80,7 +138,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

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>`_ |
@@ -31,7 +39,8 @@ 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.*
Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed,
libOpenCM3, etc.*
.. image:: https://raw.githubusercontent.com/platformio/platformio/develop/docs/_static/platformio-logo.png
:target: http://platformio.org
@@ -136,6 +145,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

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

After

Width:  |  Height:  |  Size: 70 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

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

@@ -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,53 @@ 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_BUILD_FLAGS:
PLATFORMIO_BUILD_FLAGS
~~~~~~~~~~~~~~~~~~~~~~
Allows to set :ref:`projectconf` option :ref:`projectconf_build_flags`.
.. _envvar_PLATFORMIO_SRCBUILD_FLAGS:
PLATFORMIO_SRCBUILD_FLAGS
~~~~~~~~~~~~~~~~~~~~~~~~~
Allows to override :ref:`projectconf` option
:ref:`projectconf_srcbuild_flags`.
Allows to set :ref:`projectconf` option :ref:`projectconf_srcbuild_flags`.
.. _envvar_PLATFORMIO_LDF_CYCLIC:
PLATFORMIO_LDF_CYCLIC
~~~~~~~~~~~~~~~~~~~~~
Allows to set :ref:`projectconf` option :ref:`projectconf_ldf_cyclic`.
Settings
--------

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.
@@ -480,6 +483,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

@@ -29,12 +29,13 @@ Integration
Project Generator
^^^^^^^^^^^^^^^^^
Since PlatformIO 2.0 you can generate Eclipse compatible project using
:option:`platformio init --ide` command:
SSince PlatformIO 2.0 you can generate Eclipse compatible project using
:option:`platformio init --ide` command. Please choose board type using
:ref:`cmd_boards` command and run:
.. code-block:: shell
platformio init --ide eclipse
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

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

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

View File

@@ -1,8 +1,9 @@
PlatformIO: 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.*
*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

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

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

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

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

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

View File

@@ -270,6 +270,9 @@ processes:
- 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
@@ -306,7 +309,7 @@ An option ``srcbuild_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
This option can be set by global environment variable
:ref:`envvar_PLATFORMIO_SRCBUILD_FLAGS`.
``install_libs``
@@ -328,7 +331,7 @@ Example:
``use_libs``
^^^^^^^^^^^^
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:
@@ -341,7 +344,7 @@ Example:
``ignore_libs``
^^^^^^^^^^^^^^^
Specify libraries which should be ignored by ``Library Dependency Finder``
Specify libraries which should be ignored by ``Library Dependency Finder (LDF)``
Example:
@@ -350,6 +353,30 @@ Example:
[env:ignore_some_libs]
ignore_libs = SPI,EngduinoV3_ID123
.. _projectconf_ldf_cyclic:
``ldf_cyclic``
^^^^^^^^^^^^^^
Control cyclic (recursive) behaviour for ``Library Dependency Finder (LDF)``.
By default, this option is turned OFF (``ldf_cyclic=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.
This option can be set by global environment variable
:ref:`envvar_PLATFORMIO_LDF_CYCLIC`.
Example:
.. code-block:: ini
[env:libs_with_enabled_ldf_cyclic]
ldf_cyclic = True
.. _projectconf_examples:

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,14 @@
# Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details.
VERSION = (2, 0, 0)
VERSION = (2, 1, 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.)")
"Nordic nRF51, NXP LPC, Silicon Labs EFM32, ST STM32, "
"TI MSP430 & Tiva, Teensy, Arduino, mbed, libOpenCM3, etc)")
__url__ = "http://platformio.org"
__author__ = "Ivan Kravets"

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

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

@@ -11,7 +11,7 @@ except ImportError:
break
from platformio import util
from os.path import join
from os.path import isfile, join
from time import time
from SCons.Script import (DefaultEnvironment, Exit, SConscript,
@@ -38,6 +38,7 @@ commonvars.AddVariables(
("SRCBUILD_FLAGS",),
("IGNORE_LIBS",),
("USE_LIBS",),
("LDF_CYCLIC",),
# board options
("BOARD",),
@@ -62,6 +63,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(),
@@ -70,7 +72,7 @@ DefaultEnvironment(
BUILD_DIR=join("$PIOENVS_DIR", "$PIOENV"),
LIBSOURCE_DIRS=[
join("$PROJECT_DIR", "lib"),
"$PROJECTLIB_DIR",
util.get_lib_dir(),
join("$PLATFORMFW_DIR", "libraries")
]
@@ -96,9 +98,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']}")
)
)

View File

@@ -20,14 +20,18 @@ def BeforeUpload(target, source, env): # pylint: disable=W0613,W0621
with open(path, "w") as f:
f.write(str(value))
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"])
if "micronucleus" in env['UPLOADER']:
print "Please unplug/plug device ..."
if not upload_options.get("require_upload_port", False):
return
@@ -74,7 +78,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

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

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

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

@@ -4,6 +4,7 @@
import atexit
import json
import re
from glob import glob
from os import getenv, listdir, remove, sep, walk
from os.path import basename, dirname, isdir, isfile, join, normpath
@@ -47,10 +48,11 @@ def BuildFirmware(env):
_LIBFLAGS=" -Wl,--end-group"
)
_srcbuild_flags = getenv("PLATFORMIO_SRCBUILD_FLAGS",
env.subst("$SRCBUILD_FLAGS"))
if _srcbuild_flags:
firmenv.MergeFlags(_srcbuild_flags)
# Handle SRCBUILD_FLAGS
if getenv("PLATFORMIO_SRCBUILD_FLAGS", None):
firmenv.MergeFlags(getenv("PLATFORMIO_SRCBUILD_FLAGS"))
if "SRCBUILD_FLAGS" in env:
firmenv.MergeFlags(env['SRCBUILD_FLAGS'])
firmenv.Append(
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
@@ -62,18 +64,13 @@ def BuildFirmware(env):
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)
print json.dumps(env.DumpIDEData())
Exit()
return firmenv.Program(
join("$BUILD_DIR", "firmware"),
[firmenv.GlobCXXFiles(vdir) for vdir in vdirs],
LIBS=list(env.get("LIBS", []) + deplibs)[::-1],
LIBS=env.get("LIBS", []) + deplibs,
LIBPATH=env.get("LIBPATH", []) + ["$BUILD_DIR"],
PROGSUFFIX=".elf"
)
@@ -83,6 +80,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'])
@@ -97,8 +97,8 @@ def ProcessFlags(env):
def GlobCXXFiles(env, path):
files = []
for suff in ["*.c", "*.cpp", "*.S"]:
_list = env.Glob(join(path, suff))
for suff in ["c", "cpp", "S", "spp", "SPP", "sx", "s", "asm", "ASM"]:
_list = env.Glob(join(path, "*.%s" % suff))
if _list:
files += _list
return files
@@ -207,7 +207,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 USE_LIBS + sorted(listdir(lsd_dir)):
if not isdir(join(lsd_dir, ld)):
continue
@@ -278,23 +278,24 @@ 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 getenv("PLATFORMIO_LDF_CYCLIC",
env.subst("$LDF_CYCLIC")).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:
@@ -309,8 +310,8 @@ class InoToCPPConverter(object):
PROTOTYPE_RE = re.compile(
r"""^(
(?:\s*[a-z_\d]+){1,2} # return type
\s+[a-z_\d]+\s* # name of prototype
(\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 {
""",
@@ -319,7 +320,8 @@ class InoToCPPConverter(object):
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)
STRIPCOMMENTS_RE = re.compile(r"(/\*.*?\*/|(^|\s+)//[^\r\n]*$)",
re.M | re.S)
def __init__(self, nodes):
self.nodes = nodes
@@ -334,6 +336,15 @@ class InoToCPPConverter(object):
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)
@@ -358,7 +369,7 @@ class InoToCPPConverter(object):
data = []
for node in self.nodes:
ino_contents = node.get_text_contents()
prototypes += self.PROTOTYPE_RE.findall(ino_contents)
prototypes += self._parse_prototypes(ino_contents)
item = (basename(node.get_path()), ino_contents)
if self.is_main_node(ino_contents):
@@ -404,6 +415,42 @@ def ConvertInoToCpp(env):
atexit.register(delete_tmpcpp_file, tmpcpp_file)
def DumpIDEData(env):
data = {
"defines": [],
"includes": []
}
# includes from framework and libs
for item in env.get("VARIANT_DIRS", []):
data['includes'].append(env.subst(item[1]))
# includes from toolchain
toolchain_dir = env.subst(
join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN"))
toolchain_incglobs = [
join(toolchain_dir, "*", "include"),
join(toolchain_dir, "lib", "gcc", "*", "*", "include")
]
for g in toolchain_incglobs:
data['includes'].extend(glob(g))
# global symbols
for item in env.get("CPPDEFINES", []):
data['defines'].append(env.subst(item))
# special symbol for Atmel AVR MCU
board = env.get("BOARD_OPTIONS", {})
if board and board['platform'] == "atmelavr":
data['defines'].append(
"__AVR_%s__" % board['build']['mcu'].upper()
.replace("ATMEGA", "ATmega")
.replace("ATTINY", "ATtiny")
)
return data
def exists(_):
return True
@@ -418,4 +465,5 @@ def generate(env):
env.AddMethod(BuildLibrary)
env.AddMethod(BuildDependentLibraries)
env.AddMethod(ConvertInoToCpp)
env.AddMethod(DumpIDEData)
return env

View File

@@ -3,7 +3,7 @@
import stat
from glob import glob
from os import chmod, environ, makedirs, remove
from os import chmod, getenv, makedirs, remove
from os.path import abspath, basename, isdir, isfile, join
from shutil import copyfile, copytree, rmtree
from tempfile import mkdtemp
@@ -59,7 +59,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'")

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,8 +69,6 @@ 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):
@@ -180,3 +173,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

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

@@ -23,19 +23,19 @@ 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
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
return data
@util.memoized
@@ -44,7 +44,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

View File

@@ -84,7 +84,7 @@
<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.Arguments">--force run --target clean</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Command">platformio</value>
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>
@@ -125,7 +125,7 @@
<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.Arguments">--force run --target clean</value>
<value type="QString" key="ProjectExplorer.ProcessStep.Command">platformio</value>
<value type="QString" key="ProjectExplorer.ProcessStep.WorkingDirectory">%{buildDir}</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Custom Process Step</value>

View File

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

View File

@@ -43,7 +43,7 @@
</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>
</PropertyGroup>

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:

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

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

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

@@ -51,6 +51,6 @@ setup(
"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")
"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")

View File

@@ -44,9 +44,8 @@ basepython =
py26: python2.6
py27: python2.7
usedevelop = True
passenv = *
deps = pytest
setenv =
PLATFORMIO_SETTING_ENABLE_PROMPTS = False
commands =
{envpython} --version
pip install --egg http://sourceforge.net/projects/scons/files/latest/download