Merge branch 'release/v2.8.5'
51
.github/ISSUE_TEMPLATE.md
vendored
Normal file
@ -0,0 +1,51 @@
|
||||
What kind of issue is this?
|
||||
|
||||
- [ ] Question. This issue tracker is not the place for questions. If you want to ask how to do
|
||||
something, or to understand why something isn't working the way you expect it to, use
|
||||
our technical chat https://gitter.im/platformio/platformio
|
||||
|
||||
- [ ] Feature Request. Start by telling us what problem you’re trying to solve. Often a solution
|
||||
already exists! Don’t send pull requests to implement new features without first getting our
|
||||
support. Sometimes we leave features out on purpose to keep the project small.
|
||||
|
||||
- [ ] PlatformIO IDE. All issues related to PlatformIO IDE should be reported to appropriate repository
|
||||
https://github.com/platformio/platformio-atom-ide/issues
|
||||
|
||||
- [ ] Bug report. If you’ve found a bug, please provide information below.
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
### Configuration
|
||||
|
||||
**Operating system**:
|
||||
|
||||
**PlatformIO Version** (`platformio --version`):
|
||||
|
||||
### Description of problem
|
||||
|
||||
|
||||
#### Steps to Reproduce
|
||||
|
||||
1.
|
||||
2.
|
||||
3.
|
||||
|
||||
### Actual Results
|
||||
|
||||
|
||||
### Expected Results
|
||||
|
||||
|
||||
### If problems with PlatformIO Build System:
|
||||
|
||||
**The content of `platformio.ini`:**
|
||||
```ini
|
||||
Insert here...
|
||||
```
|
||||
|
||||
**Source file to reproduce issue:**
|
||||
```cpp
|
||||
Insert here...
|
||||
```
|
||||
|
||||
### Additional info
|
20
.travis.yml
@ -1,15 +1,21 @@
|
||||
language: python
|
||||
python:
|
||||
- "2.7"
|
||||
"2.7"
|
||||
|
||||
env:
|
||||
- TOX_ENV=docs
|
||||
- TOX_ENV=lint
|
||||
- TOX_ENV=py26
|
||||
- TOX_ENV=py27
|
||||
TOX_ENV=docs
|
||||
TOX_ENV=lint
|
||||
TOX_ENV=py26
|
||||
TOX_ENV=py27
|
||||
|
||||
install:
|
||||
- pip install -U pip setuptools tox
|
||||
pip install -U pip setuptools tox
|
||||
|
||||
script:
|
||||
- tox -e $TOX_ENV
|
||||
tox -e $TOX_ENV
|
||||
|
||||
notifications:
|
||||
slack:
|
||||
on_success: change
|
||||
on_failure: always
|
||||
secure: uEU56hHACLxq6iRRZ0JeAl/MPADqQWMZZAsZB9IOnXaRUd0Pa6lT2CicJXhVlsEEbNRqR2u5LbcQ4R0nvAKPjYgglDlDet4RfhP+YIqLX2v2dv3B5q8cITsKMUUediv4fybdO/nmvQSImq5nqRQQsXKAwTAJZooIwS3F5Dsg+eE=
|
||||
|
35
HISTORY.rst
@ -4,6 +4,39 @@ Release Notes
|
||||
PlatformIO 2.0
|
||||
--------------
|
||||
|
||||
2.8.5 (2016-03-07)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Project generator for `NetBeans IDE <http://docs.platformio.org/en/latest/ide/netbeans.html>`__
|
||||
(`issue #541 <https://github.com/platformio/platformio/issues/541>`_)
|
||||
* Created package for Homebrew Mac OS X Package Manager: ``brew install
|
||||
platformio``
|
||||
(`issue #395 <https://github.com/platformio/platformio/issues/395>`_)
|
||||
* Updated Arduino core for Espressif platform to 2.1.0
|
||||
(`issue #544 <https://github.com/platformio/platformio/issues/544>`_)
|
||||
* Added support for the ESP8266 ESP-07 board to
|
||||
`Espressif <http://docs.platformio.org/en/latest/platforms/espressif.html>`__
|
||||
(`issue #527 <https://github.com/platformio/platformio/issues/527>`_)
|
||||
* Improved handling of String-based ``CPPDEFINES`` passed to extra ``build_flags``
|
||||
(`issue #526 <https://github.com/platformio/platformio/issues/526>`_)
|
||||
* Generate appropriate project for CLion IDE and CVS
|
||||
(`issue #523 <https://github.com/platformio/platformio/issues/523>`_)
|
||||
* Use ``src_dir`` directory from `Project Configuration File platformio.ini <http://docs.platformio.org/en/latest/projectconf.html>`__
|
||||
when initializing project otherwise create base ``src`` directory
|
||||
(`issue #536 <https://github.com/platformio/platformio/issues/536>`_)
|
||||
* Fixed issue with incorrect handling of user's build flags where the base flags
|
||||
were passed after user's flags to GCC compiler
|
||||
(`issue #528 <https://github.com/platformio/platformio/issues/528>`_)
|
||||
* Fixed issue with Project Generator when optional build flags were passed using
|
||||
system environment variables: `PLATFORMIO_BUILD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-flags>`__
|
||||
or `PLATFORMIO_BUILD_SRC_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-build-src-flags>`__
|
||||
* Fixed invalid detecting of compiler type
|
||||
(`issue #550 <https://github.com/platformio/platformio/issues/550>`_)
|
||||
* Fixed issue with updating package which was deleted manually by user
|
||||
(`issue #555 <https://github.com/platformio/platformio/issues/555>`_)
|
||||
* Fixed incorrect parsing of GCC ``-include`` flag
|
||||
(`issue #552 <https://github.com/platformio/platformio/issues/552>`_)
|
||||
|
||||
2.8.4 (2016-02-17)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@ -21,7 +54,7 @@ PlatformIO 2.0
|
||||
* Handle new environment variables
|
||||
`PLATFORMIO_UPLOAD_PORT <http://docs.platformio.org/en/latest/envvars.html#platformio-upload-port>`_
|
||||
and `PLATFORMIO_UPLOAD_FLAGS <http://docs.platformio.org/en/latest/envvars.html#platformio-upload-flags>`_
|
||||
(`IDE issue #518 <https://github.com/platformio/platformio/issues/518>`_)
|
||||
(`issue #518 <https://github.com/platformio/platformio/issues/518>`_)
|
||||
* Fixed issue with ``CPPDEFINES`` which contain space and break PlatformIO
|
||||
IDE Linter
|
||||
(`IDE issue #34 <https://github.com/platformio/platformio-atom-ide/issues/34>`_)
|
||||
|
12
README.rst
@ -22,10 +22,7 @@ PlatformIO
|
||||
.. image:: https://img.shields.io/pypi/dm/platformio.svg
|
||||
:target: https://pypi.python.org/pypi/platformio/
|
||||
:alt: PyPi Downloads
|
||||
.. image:: https://img.shields.io/sourceforge/dm/platformio-storage.svg
|
||||
:target: https://sourceforge.net/projects/platformio-storage/
|
||||
:alt: Packages Downloads
|
||||
.. image:: https://badges.gitter.im/Join%20Chat.svg
|
||||
.. image:: https://img.shields.io/chat/on%20gitter.png
|
||||
:alt: Join the chat at https://gitter.im/platformio/platformio
|
||||
:target: https://gitter.im/platformio/platformio
|
||||
.. image:: https://img.shields.io/donate/PlatformIO.png?color=yellow
|
||||
@ -40,6 +37,7 @@ PlatformIO
|
||||
`Twitter <https://twitter.com/PlatformIO_Org>`_ |
|
||||
`Facebook <https://www.facebook.com/platformio>`_ |
|
||||
`Hackaday <https://hackaday.io/project/7980-platformio>`_ |
|
||||
`Bintray <https://bintray.com/platformio>`_ |
|
||||
`Donate <http://platformio.org/#!/donate>`_ |
|
||||
`Contact Us <http://platformio.org/#!/contact>`_
|
||||
|
||||
@ -47,7 +45,7 @@ PlatformIO
|
||||
:target: http://platformio.org
|
||||
|
||||
`PlatformIO <http://platformio.org>`_ is an open source ecosystem for IoT
|
||||
development. Cross-platform code builder and library manager. Continuous and
|
||||
development. Cross-platform build system and library manager. Continuous and
|
||||
IDE integration. Arduino and MBED compatible. Ready for Cloud compiling.
|
||||
|
||||
* **PlatformIO IDE** - The next generation integrated development environment for IoT.
|
||||
@ -132,7 +130,7 @@ platforms which allows you to organize and have up-to-date external libraries.
|
||||
:target: http://platformio.org
|
||||
:alt: PlatformIO Library Manager Architecture
|
||||
|
||||
Smart Code Builder. *Fast and Reliable.*
|
||||
Smart Build System. *Fast and Reliable.*
|
||||
----------------------------------------
|
||||
*PlatformIO Code Builder* is built-on a next-generation software construction
|
||||
tool named `SCons <http://www.scons.org/>`_. Think of *SCons* as an improved,
|
||||
@ -146,7 +144,7 @@ cross-platform substitute for the classic *Make* utility.
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/platformio/platformio-web/develop/app/images/platformio-scons-builder.png
|
||||
:target: http://platformio.org
|
||||
:alt: PlatformIO Code Builder Architecture
|
||||
:alt: PlatformIO Build System Architecture
|
||||
|
||||
Single source code. *Multiple platforms.*
|
||||
-----------------------------------------
|
||||
|
14
docs/_static/extra.css
vendored
@ -256,6 +256,20 @@ nav {
|
||||
|
||||
/* Misc */
|
||||
|
||||
.wy-side-scroll .wy-side-nav-search .icon,
|
||||
.wy-side-scroll .wy-side-nav-search .version {
|
||||
display: none;
|
||||
visibility: none;
|
||||
}
|
||||
|
||||
.navbar-header .navbar-brand {
|
||||
color: #e0e0e0;
|
||||
background: url("../_static/platformio-logo-xs.png") no-repeat;
|
||||
background-position: 5px 0;
|
||||
padding-left: 50px;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.top-banner {
|
||||
display: block;
|
||||
padding: 10px 20px;
|
||||
|
BIN
docs/_static/ide-atom-platformio-menu-item.png
vendored
Before Width: | Height: | Size: 175 KiB After Width: | Height: | Size: 213 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-1.png
vendored
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-10.png
vendored
Normal file
After Width: | Height: | Size: 59 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-11.png
vendored
Normal file
After Width: | Height: | Size: 78 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-12.png
vendored
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-13.png
vendored
Normal file
After Width: | Height: | Size: 54 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-14.png
vendored
Normal file
After Width: | Height: | Size: 66 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-2.png
vendored
Normal file
After Width: | Height: | Size: 45 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-3.png
vendored
Normal file
After Width: | Height: | Size: 40 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-4.png
vendored
Normal file
After Width: | Height: | Size: 36 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-5.png
vendored
Normal file
After Width: | Height: | Size: 29 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-6.png
vendored
Normal file
After Width: | Height: | Size: 63 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-7.png
vendored
Normal file
After Width: | Height: | Size: 91 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-8.png
vendored
Normal file
After Width: | Height: | Size: 55 KiB |
BIN
docs/_static/ide-atom-platformio-quick-start-9.png
vendored
Normal file
After Width: | Height: | Size: 70 KiB |
BIN
docs/_static/ide-atom-platformio-toolbar.png
vendored
Before Width: | Height: | Size: 43 KiB After Width: | Height: | Size: 18 KiB |
BIN
docs/_static/ide-platformio-arduino.png
vendored
Before Width: | Height: | Size: 108 KiB |
BIN
docs/_static/ide-platformio-emacs.png
vendored
Before Width: | Height: | Size: 753 KiB After Width: | Height: | Size: 430 KiB |
BIN
docs/_static/ide-platformio-energia.png
vendored
Before Width: | Height: | Size: 112 KiB |
BIN
docs/_static/ide-platformio-netbeans.png
vendored
Normal file
After Width: | Height: | Size: 213 KiB |
BIN
docs/_static/ide-vs-platformio-newproject-6.png
vendored
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 24 KiB |
BIN
docs/_static/ide-vs-platformio-newproject-8.png
vendored
Before Width: | Height: | Size: 82 KiB After Width: | Height: | Size: 108 KiB |
BIN
docs/_static/ide-vs-platformio-newproject-9.png
vendored
Normal file
After Width: | Height: | Size: 71 KiB |
BIN
docs/_static/platformio-logo-xs.png
vendored
Normal file
After Width: | Height: | Size: 3.1 KiB |
10
docs/_templates/footer.html
vendored
@ -12,15 +12,15 @@
|
||||
<div>
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="http://platformio.org/#!/get-started"><i class="fa fa-rocket fa-lg"></i>Get Started</a></li>
|
||||
<li><a href="http://platformio.org/#!/platforms"><i class="fa fa-laptop fa-lg"></i>Platforms</a></li>
|
||||
<li><a href="http://platformio.org/#!/frameworks"><i class="fa fa-cogs fa-lg"></i>Frameworks</a></li>
|
||||
<li><a href="http://platformio.org/#!/boards"><i class="fa fa-gamepad fa-lg"></i>Boards</a></li>
|
||||
<li><a href="http://platformio.org/#!/platformio-ide"><i class="fa fa-cube fa-lg"></i>IDE</a></li>
|
||||
<li><a href="http://platformio.org/#!/platforms"><i class="fa fa-wrench fa-lg"></i>Development</a></li>
|
||||
<li ><a href="http://platformio.org/#!/lib"><i class="fa fa-code fa-lg"></i>Libraries</a></li>
|
||||
<li class="active"><a href="http://docs.platformio.org/"><i class="fa fa-book fa-lg"></i>Docs</a></li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="http://platformio.org/#!/who-uses"><i class="fa fa-heart-o fa-lg"></i>Who uses</a></li>
|
||||
<li class="active"><a href="http://docs.platformio.org/"><i class="fa fa-book fa-lg"></i>Docs</a></li>
|
||||
<li><a href="http://platformio.org/#!/donate"><i class="fa fa-heart-o fa-lg"></i>Donate</a></li>
|
||||
<li><a href="http://platformio.org/#!/contact"><i class="fa fa-envelope fa-lg"></i>Contact</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
@ -23,6 +23,12 @@ Here are recent articles about PlatformIO:
|
||||
2016
|
||||
^^^^
|
||||
|
||||
* Mar 04, 2016 - **Ricardo Vega** - `Programa tu Arduino desde Atom (Program your Arduino from Atom, Spanish) <http://ricveal.com/blog/programa-arduino-desde-atom/>`_
|
||||
* Feb 28, 2016 - **Alex Bloggt** - `PlatformIO vorgestellt (Introduction to PlatformIO IDE, German) <https://alexbloggt.com/platformio-vorgestellt/>`_
|
||||
* Feb 25, 2016 - **NutDIY** - `PlatformIO Blink On Nodemcu Dev Kit V1.0 (Thai) <http://nutdiy.blogspot.com/2016/02/platformio-blink-on-nodemcu-dev-kit-v10.html>`_
|
||||
* Feb 23, 2016 - **Ptarmigan Labs** - `ESP8266 Over The Air updating – what are the options? <https://ptarmiganlabs.com/blog/2016/02/23/esp8266-over-the-air-updating-what-are-the-options/>`_
|
||||
* Feb 22, 2016 - **Grzegorz Hołdys** - `How to Integrate PlatformIO with Netbeans <http://www.instructables.com/id/How-to-Integrate-PlatformIO-With-Netbeans/>`_
|
||||
* Feb 19, 2016 - **Embedds** - `Develop easier with PlatformIO ecosystem <http://www.embedds.com/develop-easier-with-platformio-ecosystem/>`_
|
||||
* Jan 24, 2016 - **Sergey Prilukin** - `How to use IntelliJ IDEA to develop and upload software for micro controllers like Arduino <http://jandevblog.blogspot.com/2016/01/how-to-use-intellij-idea-to-develop-and.html>`_
|
||||
* Jan 16, 2016 - **Dani Eichhorn** - `ESP8266 Arduino IDE Alternative: PlatformIO <http://blog.squix.ch/2016/01/esp8266-arduino-ide-alternative.html>`_
|
||||
* Jan 11, 2016 - **David Mills, Ph.D.** - `STM NUCLEOF401RE TIMER IO <http://webshed.org/wiki/STM_NUCLEOF401RE_TIMER_IO>`_
|
||||
@ -58,14 +64,14 @@ Here are recent articles about PlatformIO:
|
||||
* May 17, 2015 - **S.S** - `コマンドラインでArduino開発 : vim + platformio (Arduino development at the command line: VIM + PlatformIO, Japanese) <http://qiita.com/caad1229/items/7b5fb47f034ae6e0baf2>`_
|
||||
* May 11, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part II <http://ithare.com/from-web-developer-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-ii/>`_
|
||||
* May 4, 2015 - **IT Hare** - `From Web Developer to Embedded One: Interview with Ivan Kravets, The Guy Behind PlatformIO. Part I <http://ithare.com/from-web-development-to-embedded-one-interview-with-ivan-kravets-the-guy-behind-platformio-part-i/>`_
|
||||
* April 17, 2015 - **Michael Ball** - `PlatformIO - A Cross-Platform Code Builder and Missing Library Manager <http://arduino-pi.blogspot.com.es/2015/04/platformio-cross-platform-code-builder.html>`_
|
||||
* March 23, 2015 - **Atmel** - `Cross-board and cross-vendor embedded development with PlatformIO <http://blog.atmel.com/2015/03/23/cross-board-and-cross-vendor-embedded-development-with-platformio/>`_
|
||||
* March 22, 2015 - **Mark VandeWettering** - `Discovered a new tool for embedded development: PlatformIO <http://brainwagon.org/2015/03/22/discovered-a-new-tool-for-embedded-development-platformio/>`_
|
||||
* February 25, 2015 - **Hendrik Putzek** - `Use your favourite IDE together with Arduino <http://blog.putzek.com/2015/02/your-favourite-ide-with-arduino.html>`_
|
||||
* Apr 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>`_
|
||||
* Mar 23, 2015 - **Atmel** - `Cross-board and cross-vendor embedded development with PlatformIO <http://blog.atmel.com/2015/03/23/cross-board-and-cross-vendor-embedded-development-with-platformio/>`_
|
||||
* Mar 22, 2015 - **Mark VandeWettering** - `Discovered a new tool for embedded development: PlatformIO <http://brainwagon.org/2015/03/22/discovered-a-new-tool-for-embedded-development-platformio/>`_
|
||||
* Feb 25, 2015 - **Hendrik Putzek** - `Use your favourite IDE together with Arduino <http://blog.putzek.com/2015/02/your-favourite-ide-with-arduino.html>`_
|
||||
|
||||
2014
|
||||
^^^^
|
||||
|
||||
* October 7, 2014 - **Ivan Kravets, Ph.D.** - `Integration of PlatformIO library manager to Arduino and Energia IDEs <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_
|
||||
* June 20, 2014 - **Ivan Kravets, Ph.D.** - `Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO <http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio>`_
|
||||
* June 17, 2014 - **Ivan Kravets, Ph.D.** - `How was PlatformIO born or why I love Python World <http://www.ikravets.com/computer-life/programming/2014/06/17/how-was-platformio-born-or-why-i-love-python-world>`_
|
||||
* Oct 7, 2014 - **Ivan Kravets, Ph.D.** - `Integration of PlatformIO library manager to Arduino and Energia IDEs <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_
|
||||
* Jun 20, 2014 - **Ivan Kravets, Ph.D.** - `Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO <http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio>`_
|
||||
* Jun 17, 2014 - **Ivan Kravets, Ph.D.** - `How was PlatformIO born or why I love Python World <http://www.ikravets.com/computer-life/programming/2014/06/17/how-was-platformio-born-or-why-i-love-python-world>`_
|
||||
|
@ -21,8 +21,8 @@ Project Examples
|
||||
|
||||
Preconfigured demo projects are located in `PlatformIO GitHub <https://github.com/platformio/platformio/tree/develop/examples>`_ repository.
|
||||
|
||||
Wiring Blink
|
||||
------------
|
||||
"Blink Project"
|
||||
---------------
|
||||
|
||||
.. image:: _static/platformio-demo-wiring.gif
|
||||
|
||||
|
@ -77,6 +77,20 @@ Building
|
||||
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_build_flags`.
|
||||
|
||||
Examples:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Unix:
|
||||
export PLATFORMIO_BUILD_FLAGS=-DFOO
|
||||
export PLATFORMIO_BUILD_FLAGS="-DFOO -DBAR=1 -DFLOAT_VALUE=1.23457e+07"
|
||||
export PLATFORMIO_BUILD_FLAGS="'-DWIFI_PASS=\"My password\"' '-DWIFI_SSID=\"My ssid name\"'"
|
||||
|
||||
# Windows:
|
||||
SET PLATFORMIO_BUILD_FLAGS=-DFOO
|
||||
SET PLATFORMIO_BUILD_FLAGS=-DFOO -DBAR=1 -DFLOAT_VALUE=1.23457e+07
|
||||
SET PLATFORMIO_BUILD_FLAGS='-DWIFI_PASS="My password"' '-DWIFI_SSID="My ssid name"'
|
||||
|
||||
.. envvar:: PLATFORMIO_SRC_BUILD_FLAGS
|
||||
|
||||
Allows to set :ref:`projectconf` option :ref:`projectconf_src_build_flags`.
|
||||
|
44
docs/faq.rst
@ -19,53 +19,11 @@ Frequently Asked Questions
|
||||
General
|
||||
-------
|
||||
|
||||
.. _faq_what_is_platformio:
|
||||
|
||||
What is PlatformIO?
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
`PlatformIO <http://platformio.org>`_ is an open source ecosystem for IoT
|
||||
development.
|
||||
Please refer to :ref:`what_is_pio`
|
||||
|
||||
PlatformIO is independent from the platform, in which it is running. In fact,
|
||||
the only requirement is Python, which exists pretty much everywhere. What this
|
||||
means is that PlatformIO projects can be easily moved from one computer to
|
||||
another, as well as that PlatformIO allows for the easy sharing of projects
|
||||
between team members, regardless of operating system they prefer to work with.
|
||||
Beyond that, PlatformIO can be run not only on commonly used desktops/laptops
|
||||
but also on the servers without X Window System. While PlatformIO itself is a
|
||||
console application, it can be used in combination with one's favorite
|
||||
:ref:`ide` or text editor such as :ref:`ide_arduino`, :ref:`ide_atom`,
|
||||
:ref:`ide_clion`, :ref:`ide_eclipse`, :ref:`ide_qtcreator`,
|
||||
:ref:`ide_sublimetext`, :ref:`ide_vim`, :ref:`ide_visualstudio`, etc.
|
||||
|
||||
Alright, so PlatformIO can run on different operating systems. But more
|
||||
importantly, from development perspective at least, is a list of supported
|
||||
boards and MCUs. To keep things short: PlatformIO supports approximately 200
|
||||
`Embedded Boards <http://platformio.org/#!/boards>`_ and all major
|
||||
:ref:`Development Platforms <platforms>`.
|
||||
|
||||
PlatformIO allows users to:
|
||||
|
||||
* Decide which operation system they want to run development process on.
|
||||
You can even use one OS at home and another at work.
|
||||
* Choose which editor to use for writing the code. It can be pretty simple
|
||||
editor or powerful favorite :ref:`ide`.
|
||||
* Focus on the code development, significantly simplifying support for the
|
||||
:ref:`platforms` and MCUs.
|
||||
|
||||
|
||||
How does it work?
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
Without going too deep into PlatformIO implementation details, work cycle of
|
||||
the project developed using PlatformIO is as follows:
|
||||
|
||||
* Users choose board(s) interested in :ref:`projectconf`
|
||||
* Based on this list of boards, PlatformIO downloads required toolchains and
|
||||
installs them automatically.
|
||||
* Users develop code and PlatformIO makes sure that it is compiled, prepared
|
||||
and uploaded to all the boards of interest.
|
||||
|
||||
Command completion in Terminal
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
Framework ``arduino``
|
||||
=====================
|
||||
Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
For more detailed information please visit `vendor site <http://arduino.cc/en/Reference/HomePage>`_.
|
||||
|
||||
@ -583,6 +583,13 @@ Espressif
|
||||
- 1024 Kb
|
||||
- 80 Kb
|
||||
|
||||
* - ``esp07``
|
||||
- `Espressif Generic ESP8266 ESP-07 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family#esp-07>`_
|
||||
- ESP8266
|
||||
- 80 MHz
|
||||
- 4096 Kb
|
||||
- 80 Kb
|
||||
|
||||
* - ``esp12e``
|
||||
- `Espressif ESP8266 ESP-12E <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
|
||||
- ESP8266
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
Framework ``energia``
|
||||
=====================
|
||||
Energia framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before.
|
||||
Energia Wiring-based framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before.
|
||||
|
||||
For more detailed information please visit `vendor site <http://energia.nu/reference/>`_.
|
||||
|
||||
|
@ -18,11 +18,10 @@ IDE Integration
|
||||
:maxdepth: 2
|
||||
|
||||
ide/atom
|
||||
ide/arduino
|
||||
ide/clion
|
||||
ide/eclipse
|
||||
ide/emacs
|
||||
ide/energia
|
||||
ide/netbeans
|
||||
ide/qtcreator
|
||||
ide/sublimetext
|
||||
ide/vim
|
||||
|
31
docs/ide/_platformio_ide_extra.rst
Normal file
@ -0,0 +1,31 @@
|
||||
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
.. note::
|
||||
We are proud to present our official `PlatformIO IDE <http://platformio.org/#!/platformio-ide>`_ -
|
||||
The next generation integrated development environment for IoT.
|
||||
|
||||
* Cross-platform build system without external dependencies to the OS software:
|
||||
|
||||
- 200+ embedded boards
|
||||
- 15+ development platforms
|
||||
- 10+ frameworks
|
||||
|
||||
* C/C++ Intelligent code completion
|
||||
* C/C++ Smart code linter for super-fast coding
|
||||
* Library Manager for the hundreds popular libraries
|
||||
* Multi-projects workflow with multiple panes
|
||||
* Multiple panes
|
||||
* Themes support with dark and light colors
|
||||
* Serial Port Monitor
|
||||
* Built-in Terminal with :ref:`PlatformIO CLI <userguide>` tool (``pio``, ``platformio``)
|
||||
|
||||
`Install PlatformIO IDE <http://platformio.org/#!/platformio-ide>`_.
|
@ -1,50 +0,0 @@
|
||||
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
.. _ide_arduino:
|
||||
|
||||
Arduino
|
||||
=======
|
||||
|
||||
The open-source `Arduino Software (IDE) <http://arduino.cc/en/main/software>`_
|
||||
makes it easy to write code and upload it to the board. It runs on *Windows,
|
||||
Mac OS X, and Linux*. The environment is written in *Java* and based on
|
||||
*Processing* and other open-source software.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* :ref:`platform_atmelavr`
|
||||
* :ref:`platform_atmelsam`
|
||||
* :ref:`framework_arduino`
|
||||
|
||||
Refer to the `Arduino Getting Started <http://arduino.cc/en/Guide/HomePage>`_
|
||||
page for Installation instructions.
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
More detailed information is located in PlatformIO blog:
|
||||
`Integration of PlatformIO library manager to Arduino IDE <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_.
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* `Integration of PlatformIO library manager to Arduino and Energia IDEs <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_
|
||||
|
||||
See the full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
.. image:: ../_static/ide-platformio-arduino.png
|
||||
:target: http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides
|
@ -16,22 +16,21 @@ PlatformIO IDE for Atom
|
||||
|
||||
PlatformIO IDE is the next generation integrated development environment for IoT:
|
||||
|
||||
* Cross-platform code builder without external dependencies to the system
|
||||
software:
|
||||
* Cross-platform build system without external dependencies to the OS software:
|
||||
|
||||
- 200+ embedded boards
|
||||
- 15+ development platforms
|
||||
- 10+ frameworks
|
||||
|
||||
* C/C++ Intelligent code completion
|
||||
* C/C++ Smart code linter for super-fast coding
|
||||
* C/C++ Intelligent Code Completion
|
||||
* C/C++ Smart Code Linter for rapid professional development
|
||||
* Library Manager for the hundreds popular libraries
|
||||
* Multi-projects workflow with multiple panes
|
||||
* Multiple panes
|
||||
* Themes support with dark and light colors
|
||||
* Serial Port Monitor
|
||||
* Built-in Terminal with :ref:`PlatformIO CLI <userguide>` tool (``pio``, ``platformio``)
|
||||
|
||||
|
||||
PlatformIO IDE is based on GitHub's `Atom <https://atom.io>`_ source
|
||||
code editor that's modern, approachable, yet hackable to the core; a tool you
|
||||
can customize to do anything but also use productively without ever touching a
|
||||
@ -43,16 +42,34 @@ config file.
|
||||
Installation
|
||||
------------
|
||||
|
||||
1. Download and install Atom text editor
|
||||
PlatformIO IDE is the next generation integrated development environment for IoT.
|
||||
It's built on top of `GitHub's Atom "hackable" text editor <https://atom.io>`_.
|
||||
If you have already Atom installed, please install `PlatformIO IDE for Atom package <https://atom.io/packages/platformio-ide>`_.
|
||||
|
||||
- `Download for Mac <https://atom.io/download/mac>`_
|
||||
- `Download for Windows <https://atom.io/download/windows>`_
|
||||
- `Download .deb <https://atom.io/download/deb>`_
|
||||
- `Download .rpm <https://atom.io/download/rpm>`_
|
||||
Automatic Installation
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Please download PlatformIO IDE for Atom bundle with built-in auto installer
|
||||
(be patient and let the installation complete)
|
||||
|
||||
- `Download PlatformIO IDE for Windows <https://dl.bintray.com/platformio/ide-bundles/platformio-atom-windows.exe>`_
|
||||
- `Download PlatformIO IDE for Mac <https://dl.bintray.com/platformio/ide-bundles/platformio-atom-mac.zip>`_
|
||||
- `Download PlatformIO IDE .deb <https://dl.bintray.com/platformio/ide-bundles/platformio-atom-linux-x86_64.deb>`_
|
||||
- `Download PlatformIO IDE .rpm <https://dl.bintray.com/platformio/ide-bundles/platformio-atom-linux-x86_64.rpm>`_
|
||||
|
||||
Manual Installation
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
1. Download and install the latest Atom text editor
|
||||
|
||||
- `Download Atom for Mac <https://atom.io/download/mac>`_
|
||||
- `Download Atom for Windows <https://atom.io/download/windows>`_
|
||||
- `Download Atom .deb <https://atom.io/download/deb>`_
|
||||
- `Download Atom .rpm <https://atom.io/download/rpm>`_
|
||||
- `Other platforms <https://github.com/atom/atom/releases/latest>`_
|
||||
|
||||
|
||||
2. Open Atom Package Manager and search for `platformio-ide <https://atom.io/packages/platformio-ide>`_
|
||||
2. Open Atom Package Manager and install `platformio-ide <https://atom.io/packages/platformio-ide>`_ Atom package
|
||||
|
||||
- **Mac OS X**: ``Menu: Atom > Preferences > Install``
|
||||
- **Windows**: ``Menu: File > Settings > Install``
|
||||
@ -60,11 +77,153 @@ Installation
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-install.png
|
||||
|
||||
|
||||
.. _atom_ide_quickstart:
|
||||
|
||||
Quick Start
|
||||
-----------
|
||||
|
||||
This tutorial introduces you to the basics of PlatformIO IDE workflow and shows
|
||||
you a creation process of a simple "Blink" example. After finishing you will
|
||||
have a general understanding of how to work with projects in the IDE.
|
||||
|
||||
Launch
|
||||
~~~~~~
|
||||
|
||||
After installation, you launch PlatformIO IDE by opening Atom. Once Atom is
|
||||
open, PlatformIO IDE auto installer will continue to install dependent packages
|
||||
and PlatformIO CLI. Please be patient and let the installation complete. In the
|
||||
final result PlatformIO IDE will ask you to reload Atom window to apply
|
||||
installed components. Please click on ``Reload Now``. After it PlatformIO IDE is
|
||||
ready for using. Happy coding!
|
||||
|
||||
Setting Up the Project
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
1. To create a new project choose
|
||||
``Menu: PlatformIO > Initialize new Project or update existing`` or press
|
||||
the corresponding icon in the PlatformIO toolbar as shown in the image below:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-1.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-1.png
|
||||
|
||||
2. In the "New Project Menu" choose desired boards (more than one board is
|
||||
allowed) and select a project directory. Then press "Initialize" button:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-2.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-2.png
|
||||
|
||||
3. If everything is fine, you should see the success message and project tree
|
||||
in the left panel:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-3.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-3.png
|
||||
|
||||
4. Now, let's create the first project source file: right-click on the folder
|
||||
``src`` and choose ``New File``:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-4.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-4.png
|
||||
|
||||
Enter filename ``main.cpp``:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-5.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-5.png
|
||||
|
||||
Copy the next source code to the just created file ``main.cpp``:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
/**
|
||||
* Blink
|
||||
* Turns on an LED on for one second,
|
||||
* then off for one second, repeatedly.
|
||||
*/
|
||||
#include "Arduino.h"
|
||||
|
||||
void setup()
|
||||
{
|
||||
// initialize LED digital pin as an output.
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
// turn the LED on (HIGH is the voltage level)
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
// wait for a second
|
||||
delay(1000);
|
||||
// turn the LED off by making the voltage LOW
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
// wait for a second
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
Process Project
|
||||
~~~~~~~~~~~~~~~
|
||||
|
||||
PlatformIO IDE proposes different ways to process project (build, clean,
|
||||
upload firmware, run other targets) using:
|
||||
|
||||
- :ref:`atom_ide_platformio_toolbar`
|
||||
- :ref:`atom_ide_platformio_menu`
|
||||
- :ref:`ide_atom_building_targets` and hotkeys
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-6.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-6.png
|
||||
|
||||
5. Run ``Build`` and you should see green "success" result in the building
|
||||
panel:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-7.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-7.png
|
||||
|
||||
To upload firmware to the board run ``Upload``.
|
||||
|
||||
6. What is more, you can run specific target or process project environment
|
||||
using ``Menu: PlatformIO > Run other target...``
|
||||
or call targets list from the status bar (bottom, left corner):
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-8.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-8.png
|
||||
|
||||
And select desired target:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-9.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-9.png
|
||||
|
||||
7. To run built-in terminal interface choose ``Menu: PlatformIO > Terminal`` or
|
||||
press the corresponding icon in the PlatformIO toolbar:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-10.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-10.png
|
||||
|
||||
It provides you fast access to all set of powerful PlatformIO CLI commands:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-11.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-11.png
|
||||
|
||||
8. To run built-in "Serial Monitor" choose ``Menu: PlatformIO > Serial Monitor``
|
||||
or press the corresponding icon in the PlatformIO toolbar:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-12.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-12.png
|
||||
|
||||
It has several settings to adjust your connection:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-13.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-13.png
|
||||
|
||||
And allows you to communicate with your board in an easy way:
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-quick-start-14.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio-quick-start-14.png
|
||||
|
||||
|
||||
User Guide
|
||||
----------
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio.png
|
||||
.. _atom_ide_platformio_menu:
|
||||
|
||||
Menu item ``PlatformIO``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -74,10 +233,11 @@ new menu item named ``Menu: PlatformIO`` (after ``Menu: Help`` item).
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio-menu-item.png
|
||||
|
||||
.. _atom_ide_platformio_toolbar:
|
||||
|
||||
PlatformIO Toolbar
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
PlatformIO IDE Toolbar contains the quick access button to the popular commands.
|
||||
Each button contains hint (delay mouse on it).
|
||||
|
||||
@ -86,42 +246,19 @@ Each button contains hint (delay mouse on it).
|
||||
* PlatformIO: Build
|
||||
* PlatformIO: Upload
|
||||
* PlatformIO: Clean
|
||||
* Toggle build panel
|
||||
* ||
|
||||
* New File
|
||||
* Initialize new PlatformIO Project or update existing...
|
||||
* Add/Open Project Folder...
|
||||
* Find in Project...
|
||||
* ||
|
||||
* Terminal
|
||||
* Library Manager
|
||||
* Serial Ports
|
||||
* Serial Monitor
|
||||
* ||
|
||||
* Settings
|
||||
* PlatformIO Documentation
|
||||
|
||||
.. _ide_atom_quickstart:
|
||||
|
||||
Quickstart
|
||||
~~~~~~~~~~
|
||||
|
||||
:Step 1:
|
||||
|
||||
Create empty directory for the future project. Add it to PlatformIO IDE
|
||||
using (folder) button on the Toolbar or ``Menu: File > Add Project
|
||||
Folder...``
|
||||
|
||||
:Step 2:
|
||||
|
||||
Initialize new PlatformIO based project using ``Menu: PlatformIO >
|
||||
Initialize new Project (or update existing)`` and select boards.
|
||||
Put your source code ``*.h, *.c, *.cpp, *.S, *.ino, etc``. files to ``src``
|
||||
directory.
|
||||
|
||||
:Step 3:
|
||||
|
||||
Process the project environments. More details :ref:`ide_atom_building_targets`.
|
||||
|
||||
|
||||
.. _ide_atom_building_targets:
|
||||
|
||||
Building / Uploading / Targets
|
||||
@ -138,10 +275,10 @@ Building / Uploading / Targets
|
||||
|
||||
More details `Atom Build package <https://atom.io/packages/build>`_.
|
||||
|
||||
Code completion
|
||||
~~~~~~~~~~~~~~~
|
||||
Intelligent Code Autocompletion
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
PlatformIO IDE uses `clang <http://clang.llvm.org>`_ for the code completion.
|
||||
PlatformIO IDE uses `clang <http://clang.llvm.org>`_ for the Intelligent Code Autocompletion.
|
||||
To check that ``clang`` is available in your system, please open
|
||||
Terminal and run ``clang --version``. If ``clang`` is not installed, then install it:
|
||||
|
||||
@ -158,13 +295,16 @@ Terminal and run ``clang --version``. If ``clang`` is not installed, then instal
|
||||
not be reflected in code linter. You need ``Menu: PlatformIO >
|
||||
Rebuild C/C++ Project Index (Autocomplete, Linter)``.
|
||||
|
||||
Code linter
|
||||
~~~~~~~~~~~
|
||||
.. _ide_atom_smart_code_linter:
|
||||
|
||||
PlatformIO IDE uses PlatformIO's pre-built GCC toolchains for code linting. The
|
||||
settings for Linter are located in ``.gcc-flags.json``. This file will be
|
||||
Smart Code Linter
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
PlatformIO IDE uses PlatformIO's pre-built GCC toolchains for Smart Code Linter
|
||||
and rapid professional development.
|
||||
The configuration data are located in ``.gcc-flags.json``. This file will be
|
||||
automatically created and preconfigured when you initialize project using
|
||||
``Menu: PlatformIO > Initialize new Project (or update existing)``.
|
||||
``Menu: PlatformIO > Initialize new PlatformIO Project or update existing...``.
|
||||
|
||||
.. warning::
|
||||
The libraries which are added/installed after initializing process will
|
||||
@ -175,7 +315,7 @@ automatically created and preconfigured when you initialize project using
|
||||
.. error::
|
||||
If you have error like ``linter-gcc: Executable not found`` and
|
||||
``"***/.platformio/packages/toolchain-atmelavr/bin/avr-g++" not found``
|
||||
please ``Menu: PlatformIO > Initialize new Project (or update existing)``.
|
||||
please ``Menu: PlatformIO > Initialize new PlatformIO Project or update existing...``.
|
||||
|
||||
Install Shell Commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
@ -185,6 +325,101 @@ PlatformIO > Install Shell Commands``. It will allow you to call PlatformIO from
|
||||
other process, terminal and etc.
|
||||
|
||||
Known issues
|
||||
~~~~~~~~~~~~
|
||||
------------
|
||||
|
||||
* Built-in Terminal doesn't support ``STDIN`` interaction
|
||||
Smart Code Linter is disabled for Arduino files
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
:ref:`ide_atom_smart_code_linter` is disabled by default for Arduino files
|
||||
(``*.ino`` and ``.pde``) because they are not valid C/C++ based
|
||||
source files:
|
||||
|
||||
1. Missing includes such as ``#include <Arduino.h>``
|
||||
2. Function declarations are omitted.
|
||||
|
||||
There are two solutions:
|
||||
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
.. _ide_atom_knownissues_sclarduino_manually:
|
||||
|
||||
Convert Arduino file to C++ manually
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
For example, we have the next ``Demo.ino`` file:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
void function setup () {
|
||||
someFunction(13);
|
||||
}
|
||||
|
||||
void function loop() {
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void someFunction(int num) {
|
||||
}
|
||||
|
||||
Let's convert it to ``Demo.cpp``:
|
||||
|
||||
1. Add ``#include <Arduino.h>`` at the top of the source file
|
||||
2. Declare each custom function (excluding built-in, such as ``setup`` and ``loop``)
|
||||
before it will be called.
|
||||
|
||||
The final ``Demo.cpp``:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
#include <Arduino.h>
|
||||
|
||||
void someFunction(int num);
|
||||
|
||||
void function setup () {
|
||||
someFunction(13);
|
||||
}
|
||||
|
||||
void function loop() {
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
void someFunction(int num) {
|
||||
}
|
||||
|
||||
Force Arduino file as C++
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
To force Smart Code Linter to use Arduino files as C++ please
|
||||
|
||||
1. Open ``.gcc-flags.json`` file from the Initialized/Imported project and add
|
||||
``-x c++`` flag at the beginning of the value of ``gccDefaultCppFlags`` field:
|
||||
|
||||
.. code-block:: json
|
||||
|
||||
{
|
||||
"execPath": "...",
|
||||
"gccDefaultCFlags": "...",
|
||||
"gccDefaultCppFlags": "-x c++ -fsyntax-only ...",
|
||||
"gccErrorLimit": 15,
|
||||
"gccIncludePaths": "...",
|
||||
"gccSuppressWarnings": false
|
||||
}
|
||||
|
||||
2. Perform all steps from :ref:`ide_atom_knownissues_sclarduino_manually`
|
||||
(without renaming to ``.cpp``).
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* Feb 28, 2016 - **Alex Bloggt** - `PlatformIO vorgestellt (Introduction to PlatformIO IDE, German) <https://alexbloggt.com/platformio-vorgestellt/>`_
|
||||
* Mar 04, 2016 - **Ricardo Vega** - `Programa tu Arduino desde Atom (Program your Arduino from Atom, Spanish) <http://ricveal.com/blog/programa-arduino-desde-atom/>`_
|
||||
* Feb 25, 2016 - **NutDIY** - `PlatformIO Blink On Nodemcu Dev Kit V1.0 (Thai) <http://nutdiy.blogspot.com/2016/02/platformio-blink-on-nodemcu-dev-kit-v10.html>`_
|
||||
|
||||
See a full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
.. image:: ../_static/ide-atom-platformio.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-atom-platformio.png
|
||||
|
@ -20,12 +20,7 @@ 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/>`_
|
||||
Refer to the `CLion Documentation <https://www.jetbrains.com/clion/documentation/>`_
|
||||
page for more detailed information.
|
||||
|
||||
.. contents::
|
||||
|
@ -24,11 +24,6 @@ with syntax highlighting, folding and hyperlink navigation, source code
|
||||
refactoring and code generation, visual debugging tools, including memory,
|
||||
registers, and disassembly viewers.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `CDT Documentation <https://eclipse.org/cdt/documentation.php>`_
|
||||
page for more detailed information.
|
||||
|
||||
|
@ -19,12 +19,6 @@ an interpreter for Emacs Lisp, a dialect of the
|
||||
`Lisp programming language <http://en.wikipedia.org/wiki/Lisp_programming_language>`_
|
||||
with extensions to support text editing.
|
||||
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `Emacs Documentation <https://www.gnu.org/software/emacs/#Manuals>`_
|
||||
page for more detailed information.
|
||||
|
||||
|
@ -1,50 +0,0 @@
|
||||
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
.. _ide_energia:
|
||||
|
||||
Energia
|
||||
=======
|
||||
|
||||
The open-source `Energia Software (IDE) <http://energia.nu>`_
|
||||
makes it easy to write code and upload it to the board. It runs on *Windows,
|
||||
Mac OS X, and Linux*. The environment is written in *Java* and based on
|
||||
*Processing* and other open-source software.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* :ref:`platform_timsp430`
|
||||
* :ref:`platform_titiva`
|
||||
* :ref:`framework_energia`
|
||||
|
||||
Refer to the `Energia Getting Started <http://energia.nu/guide/>`_
|
||||
page for Installation instructions.
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
More detailed information is located in PlatformIO blog:
|
||||
`Integration of PlatformIO library manager to Energia IDE <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_.
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* `Integration of PlatformIO library manager to Arduino and Energia IDEs <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_
|
||||
|
||||
See the full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
-----------
|
||||
|
||||
.. image:: ../_static/ide-platformio-energia.png
|
||||
:target: http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides
|
66
docs/ide/netbeans.rst
Normal file
@ -0,0 +1,66 @@
|
||||
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
.. _ide_netbeans:
|
||||
|
||||
NetBeans
|
||||
========
|
||||
|
||||
NetBeans is a Java-based integrated development environment (IDE). It provides
|
||||
out-of-the-box code analyzers and editors for working with the latest Java 8
|
||||
technologies--Java SE 8, Java SE Embedded 8, and Java ME Embedded 8. The IDE
|
||||
also has a range of new tools for HTML5/JavaScript, in particular for Node.js,
|
||||
KnockoutJS, and AngularJS; enhancements that further improve its support for
|
||||
Maven and Java EE with PrimeFaces; and improvements to PHP and C/C++ support.
|
||||
|
||||
Refer to the `C/C++ Application Learning Trail <https://netbeans.org/kb/trails/cnd.html>`_
|
||||
for details.
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Choose board ``type`` using :ref:`cmd_boards` or `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
command and generate project via :option:`platformio init --ide` command:
|
||||
|
||||
.. code-block:: shell
|
||||
|
||||
platformio init --ide netbeans --board %TYPE%
|
||||
|
||||
# For example, generate project for Arduino UNO
|
||||
platformio init --ide netbeans --board uno
|
||||
|
||||
Then:
|
||||
|
||||
1. Open this project via ``Menu: File > Open Project...``
|
||||
2. Add new files to ``src`` directory (``*.c, *.cpp, *.ino, etc.``) via
|
||||
right-click on ``src`` folder in the "Projects" pane
|
||||
3. Build project using ``Menu: Run > Build Project``
|
||||
4. Upload firmware using ``Menu: Run > Run Project``
|
||||
|
||||
.. warning::
|
||||
The libraries which are added, installed or used in the project
|
||||
after generating process wont be reflected in IDE. To fix it you
|
||||
need to reinitialize project using :ref:`cmd_init` (repeat it).
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* Feb 22, 2016 - **Grzegorz Hołdys** - `How to Integrate PlatformIO with Netbeans <http://www.instructables.com/id/How-to-Integrate-PlatformIO-With-Netbeans/>`_
|
||||
|
||||
See the full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
-----------
|
||||
|
||||
.. image:: ../_static/ide-platformio-netbeans.png
|
||||
:target: http://docs.platformio.org/en/latest/_images/ide-platformio-netbeans.png
|
@ -16,11 +16,6 @@ Qt Creator
|
||||
|
||||
The `Qt Creator <https://github.com/qtproject/qt-creator>`_ is an open source cross-platform integrated development environment. The editor includes such features as syntax highlighting for various languages, project manager, integrated version control systems, rapid code navigation tools and code autocompletion.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `Qt-creator Manual <http://doc.qt.io/qtcreator/>`_
|
||||
page for more detailed information.
|
||||
|
||||
@ -107,7 +102,7 @@ On the next steps select any available kit and click Finish button.
|
||||
|
||||
.. image:: ../_static/ide-platformio-qtcreator-2.png
|
||||
|
||||
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):
|
||||
Secondly, we need to delete default build and clean steps and configure project with PlatformIO Build System (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
|
||||
|
@ -16,11 +16,6 @@ Sublime Text
|
||||
|
||||
The `Sublime Text <http://www.sublimetext.com/>`_ is a cross-platform text and source code editor, with a Python application programming interface (API). Sublime Text is proprietary software. Its functionality is extendable with plugins. Most of the extending packages have free-software licenses and are community-built and maintained. Sublime Text lacks graphical setting dialogues and is entirely configured by editing text files.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `Sublime Text Documentation <http://docs.sublimetext.info/en/latest>`_
|
||||
page for more detailed information.
|
||||
|
||||
|
@ -18,11 +18,6 @@ VIM
|
||||
editor. Vim is designed for use both from a command-line interface and as a
|
||||
standalone application in a graphical user interface.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
|
@ -16,11 +16,6 @@ Visual Studio
|
||||
|
||||
The `Microsoft Visual Studio (Free) <http://visualstudio.com/free>`_ is an integrated development environment (IDE) from Microsoft. Visual Studio includes a code editor supporting IntelliSense (the code completion component) as well as code refactoring.
|
||||
|
||||
This software can be used with:
|
||||
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
Refer to the `Visual Studio Documentation <https://msdn.microsoft.com/library/vstudio>`_
|
||||
page for more detailed information.
|
||||
|
||||
@ -69,7 +64,7 @@ First of all, let's create new project from Visual Studio Start Page: ``Start >
|
||||
|
||||
.. image:: ../_static/ide-vs-platformio-newproject.png
|
||||
|
||||
Secondly, we need to configure project with PlatformIO source code builder:
|
||||
Secondly, we need to configure project with PlatformIO Build System:
|
||||
|
||||
.. image:: ../_static/ide-vs-platformio-newproject-2.png
|
||||
|
||||
@ -95,14 +90,14 @@ First program in Visual Studio
|
||||
|
||||
Simple "Blink" project will consist from two files:
|
||||
|
||||
1. Main "C" source file named ``main.c`` must be located in the ``src`` directory.
|
||||
Let's create new file named ``main.c`` using ``Menu: File > New File`` or shortcut ``Ctrl+N``:
|
||||
1. Main "C++" source file named ``main.cpp`` must be located in the ``src`` directory.
|
||||
Let's create new file named ``main.cpp`` using ``Menu: File > New File`` or shortcut ``Ctrl+N``:
|
||||
|
||||
.. image:: ../_static/ide-vs-platformio-newproject-6.png
|
||||
|
||||
Copy the source code which is described below to file ``main.c``.
|
||||
Copy the source code which is described below to file ``main.cpp``.
|
||||
|
||||
.. code-block:: c
|
||||
.. code-block:: cpp
|
||||
|
||||
#include "Arduino.h"
|
||||
#define WLED 13 // Most Arduino boards already have an LED attached to pin 13 on the board itself
|
||||
@ -162,3 +157,25 @@ Examples
|
||||
^^^^^^^^^^^^^^^
|
||||
|
||||
Source code of `Visual Studio "Blink" Project <https://github.com/platformio/platformio/tree/develop/examples/ide/visualstudio>`_.
|
||||
|
||||
Known issues
|
||||
------------
|
||||
|
||||
IntelliSense Errors
|
||||
^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
VS Studio does not allow to specify for project other toolchain which will
|
||||
be used by IntelliSense. In this case, IntelliSense does not understand
|
||||
GCC-specific definitions.
|
||||
|
||||
However, these errors does not have any influence on PlatformIO Build
|
||||
System. It means that you can ignore them and rely on PlatformIO Build System
|
||||
messages which will be shown in output console after build.
|
||||
|
||||
Nevertheless, you can provide an IntelliSense-friendly definition of problematic
|
||||
GCC constructs and make sure that the GCC will ignore such definitions or
|
||||
disable IntelliSense error reporting at all.
|
||||
See details in `issue #543 <https://github.com/platformio/platformio/issues/543>`_
|
||||
|
||||
.. image:: ../_static/ide-vs-platformio-newproject-9.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-vs-platformio-newproject-9.png
|
||||
|
@ -12,9 +12,14 @@
|
||||
PlatformIO is an open source ecosystem for IoT development
|
||||
==========================================================
|
||||
|
||||
**Cross-platform code builder and library manager. Continuous and IDE
|
||||
**Cross-platform build system and library manager. Continuous and IDE
|
||||
integration. Arduino and MBED compatible. Ready for Cloud compiling.**
|
||||
|
||||
* **PlatformIO IDE** - The next generation integrated development environment for IoT.
|
||||
C/C++ Intelligent Code Completion and Smart Code Linter for the super-fast coding.
|
||||
Multi-projects workflow with Multiple Panes. Themes Support with dark and light colors.
|
||||
Built-in Terminal with PlatformIO CLI tool and support for the powerful Serial Port Monitor.
|
||||
All advanced instruments without leaving your favourite development environment.
|
||||
* **Development Platforms** - Embedded and Desktop development platforms with
|
||||
pre-built toolchains, debuggers, uploaders and frameworks which work under
|
||||
popular host OS: Mac, Windows, Linux (+ARM)
|
||||
@ -38,8 +43,8 @@ libOpenCM3, etc.*
|
||||
`Issues <https://github.com/platformio/platformio/issues>`_
|
||||
* `Blog <http://www.ikravets.com/category/computer-life/platformio>`_ |
|
||||
`Twitter <https://twitter.com/PlatformIO_Org>`_ |
|
||||
`Hackaday <https://hackaday.io/project/7980-platformio>`_ |
|
||||
`Facebook <https://www.facebook.com/platformio>`_ |
|
||||
`Hackaday <https://hackaday.io/project/7980-platformio>`_ |
|
||||
`Reddit <http://www.reddit.com/r/platformio/>`_
|
||||
|
||||
Embedded Development. *Easier Than Ever.*
|
||||
@ -54,7 +59,7 @@ Embedded Development. *Easier Than Ever.*
|
||||
* Pre-built toolchains, :ref:`frameworks` for the
|
||||
:ref:`Development Platforms <platforms>`
|
||||
|
||||
Smart Code Builder. *Fast and Reliable.*
|
||||
Smart Build System. *Fast and Reliable.*
|
||||
----------------------------------------
|
||||
|
||||
* Reliable, automatic dependency analysis and detection of build changes
|
||||
@ -72,16 +77,21 @@ The Missing Library Manager. *It's here!*
|
||||
* It runs on Windows, Mac OS X, and Linux (+ARM).
|
||||
|
||||
For further details, please refer to
|
||||
:ref:`What is PlatformIO? How does it work? <faq_what_is_platformio>`
|
||||
:ref:`What is PlatformIO? How does it work? <what_is_pio>`
|
||||
|
||||
Contents
|
||||
--------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
what-is-platformio
|
||||
demo
|
||||
|
||||
.. toctree::
|
||||
:caption: Getting Started
|
||||
:maxdepth: 2
|
||||
|
||||
demo
|
||||
installation
|
||||
quickstart
|
||||
userguide/index
|
||||
|
@ -14,19 +14,14 @@
|
||||
Installation
|
||||
============
|
||||
|
||||
.. include:: /ide/_platformio_ide_extra.rst
|
||||
|
||||
**PlatformIO** is written in `Python <https://www.python.org/downloads/>`_ and
|
||||
works on Mac OS X, Linux, Windows OS and *ARM*-based credit-card sized
|
||||
computers (`Raspberry Pi <http://www.raspberrypi.org>`_,
|
||||
`BeagleBone <http://beagleboard.org>`_,
|
||||
`CubieBoard <http://cubieboard.org>`_).
|
||||
|
||||
.. note::
|
||||
We are glad to announce official :ref:`ide_atom` which provides
|
||||
comprehensive facilities for IoT development: built-in PlatformIO CLI tool,
|
||||
Terminal and other instruments.
|
||||
|
||||
Try :ref:`ide_atom` for free now!
|
||||
|
||||
.. contents::
|
||||
|
||||
System requirements
|
||||
@ -41,7 +36,8 @@ System requirements
|
||||
**Windows Users**: Please `Download the latest Python 2.7.x
|
||||
<https://www.python.org/downloads/>`_ and install it.
|
||||
**DON'T FORGET** to select ``Add python.exe to Path`` feature on the
|
||||
"Customize" stage, otherwise ``pip`` command will not be available.
|
||||
"Customize" stage, otherwise Python Package Manager ``pip`` command
|
||||
will not be available.
|
||||
|
||||
:Terminal Application:
|
||||
|
||||
@ -55,8 +51,11 @@ Installation Methods
|
||||
|
||||
Please *choose ONE of* the following methods:
|
||||
|
||||
a) Python Package Manager
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
.. contents::
|
||||
:local:
|
||||
|
||||
Python Package Manager
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The latest stable version of PlatformIO may be installed or upgraded via
|
||||
Python Package Manager (`pip <https://pip.pypa.io>`_) as follows:
|
||||
@ -80,8 +79,8 @@ a few options here:
|
||||
|
||||
.. _installation_installer_script:
|
||||
|
||||
b) Installer Script
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
Installer Script
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
Super-Quick (Mac / Linux)
|
||||
'''''''''''''''''''''''''
|
||||
@ -120,8 +119,19 @@ On *Windows OS* it may look like:
|
||||
# run it
|
||||
C:\Python27\python.exe get-platformio.py
|
||||
|
||||
c) Full Guide
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
Mac OS X Homebrew
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
The latest stable version of PlatformIO may be installed or upgraded via
|
||||
Mac OS X Homebrew Packages Manager (`brew <http://brew.sh/>`_) as follows:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
brew install platformio
|
||||
|
||||
Full Guide
|
||||
~~~~~~~~~~
|
||||
|
||||
1. Check a ``python`` version (only 2.6-2.7 is supported):
|
||||
|
||||
@ -149,8 +159,8 @@ For upgrading ``platformio`` to the latest version:
|
||||
|
||||
pip install -U platformio
|
||||
|
||||
d) Development Version
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
Development Version
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Install the latest PlatformIO from the ``develop`` branch:
|
||||
|
||||
|
@ -58,7 +58,7 @@ Frameworks
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_arduino`
|
||||
- Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
- Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
Boards
|
||||
------
|
||||
|
@ -64,7 +64,7 @@ Frameworks
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_arduino`
|
||||
- Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
- Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
* - :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.
|
||||
|
@ -64,7 +64,7 @@ Frameworks
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_arduino`
|
||||
- Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
- Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
Boards
|
||||
------
|
||||
@ -162,6 +162,13 @@ Espressif
|
||||
- 1024 Kb
|
||||
- 80 Kb
|
||||
|
||||
* - ``esp07``
|
||||
- `Espressif Generic ESP8266 ESP-07 <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family#esp-07>`_
|
||||
- ESP8266
|
||||
- 80 MHz
|
||||
- 4096 Kb
|
||||
- 80 Kb
|
||||
|
||||
* - ``esp12e``
|
||||
- `Espressif ESP8266 ESP-12E <http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family>`_
|
||||
- ESP8266
|
||||
|
@ -171,7 +171,7 @@ You can pass additional options/flags to OTA uploader using
|
||||
|
||||
Available flags
|
||||
|
||||
* ``--port=ESP_PORT`` ESP8266 ota Port. Default 8266
|
||||
* ``--port=ESP_PORT`` ESP8266 OTA Port. Default 8266
|
||||
* ``--auth=AUTH`` Set authentication password
|
||||
* ``--spiffs`` Use this option to transmit a SPIFFS image and do not flash
|
||||
the module
|
||||
@ -215,9 +215,32 @@ Demo
|
||||
.. image:: ../_static/platformio-demo-ota-esp8266.jpg
|
||||
:target: https://www.youtube.com/watch?v=lXchL3hpDO4
|
||||
|
||||
|
||||
Using Arduino Framework with Staging version
|
||||
--------------------------------------------
|
||||
|
||||
1. Clone/Copy `main repository <https://github.com/esp8266/Arduino>`_ to
|
||||
:ref:`projectconf_pio_home_dir` + ``packages/framework-arduinoespressif``
|
||||
and create new file ``packages/framework-arduinoespressif/version.txt``
|
||||
with the new version (for example, ``2.2.0``).
|
||||
2. Try to build project
|
||||
3. If you see build errors, then try to build this project using the same
|
||||
``stage`` on Arduino IDE
|
||||
4. If it works with Arduino IDE but doesn't work with PlatformIO, then please
|
||||
`open new issue <https://github.com/platformio/platformio/issues>`_ with
|
||||
attached information:
|
||||
|
||||
- test project/files
|
||||
- detailed log of build process from Arduino IDE (please copy it from
|
||||
console to http://pastebin.com)
|
||||
- detailed log of build process from PlatformIO Build System (
|
||||
please copy it from console to http://pastebin.com)
|
||||
|
||||
Articles
|
||||
--------
|
||||
|
||||
* Feb 25, 2016 - **NutDIY** - `PlatformIO Blink On Nodemcu Dev Kit V1.0 (ESP 12-E) <http://nutdiy.blogspot.com/2016/02/platformio-blink-on-nodemcu-dev-kit-v10.html>`_
|
||||
* Feb 23, 2016 - **Ptarmigan Labs** - `ESP8266 Over The Air updating – what are the options? <https://ptarmiganlabs.com/blog/2016/02/23/esp8266-over-the-air-updating-what-are-the-options/>`_
|
||||
* Jan 16, 2016 - **Dani Eichhorn** - `ESP8266 Arduino IDE Alternative: PlatformIO <http://blog.squix.ch/2016/01/esp8266-arduino-ide-alternative.html>`_
|
||||
* Dec 22, 2015 - **Jan Penninkhof** - `Over-the-Air ESP8266 programming using PlatformIO <http://www.penninkhof.com/2015/12/1610-over-the-air-esp8266-programming-using-platformio/>`_
|
||||
* Dec 01, 2015 - **Tateno Yuichi** - `ESP8266 を CUI で開発する (Develop a ESP8266 in CUI, Japanese) <http://jaywiggins.com/platformio/arduino/avr/es8266/2015/09/30/platformio-investigation/>`_
|
||||
|
@ -58,7 +58,7 @@ Frameworks
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_arduino`
|
||||
- Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
- Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
* - :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.
|
||||
|
@ -64,7 +64,7 @@ Frameworks
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_arduino`
|
||||
- Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
- Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
* - :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.
|
||||
|
@ -58,10 +58,10 @@ Frameworks
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_arduino`
|
||||
- Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
- Arduino Wiring-based Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
* - :ref:`framework_energia`
|
||||
- Energia framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before.
|
||||
- Energia Wiring-based framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before.
|
||||
|
||||
Boards
|
||||
------
|
||||
|
@ -61,7 +61,7 @@ Frameworks
|
||||
- Description
|
||||
|
||||
* - :ref:`framework_energia`
|
||||
- Energia framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before.
|
||||
- Energia Wiring-based framework enables pretty much anyone to start easily creating microcontroller-based projects and applications. Its easy-to-use libraries and functions provide developers of all experience levels to start blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever before.
|
||||
|
||||
* - :ref:`framework_libopencm3`
|
||||
- The libOpenCM3 framework aims to create a free/libre/open-source firmware library for various ARM Cortex-M0(+)/M3/M4 microcontrollers, including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx, 15xx, 17xx parts, Atmel SAM3, Energy Micro EFM32 and others.
|
||||
|
@ -301,7 +301,10 @@ Example:
|
||||
.. code-block:: ini
|
||||
|
||||
[env:specific_defines]
|
||||
build_flags = -Dfoo -Dbar=1
|
||||
build_flags = -DFOO -DBAR=1 -DFLOAT_VALUE=1.23457e+07
|
||||
|
||||
[env:string_defines]
|
||||
build_flags = '-DHELLO="World!"' '-DWIFI_PASS="My password"'
|
||||
|
||||
[env:specific_inclibs]
|
||||
build_flags = -I/opt/include -L/opt/lib -lfoo
|
||||
|
@ -11,61 +11,250 @@
|
||||
|
||||
.. _quickstart:
|
||||
|
||||
Quickstart
|
||||
==========
|
||||
Quick Start
|
||||
===========
|
||||
|
||||
.. hint::
|
||||
Please read `Get Started <http://platformio.org/#!/get-started>`_
|
||||
article from the official WebSite.
|
||||
.. note::
|
||||
If you are looking for a Qucik Start for PlatformIO IDE please follow to
|
||||
:ref:`PlatformIO IDE Quick Start <atom_ide_quickstart>` page.
|
||||
|
||||
1. :ref:`Install PlatformIO <installation>`.
|
||||
This tutorial introduces you to the basics of PlatformIO Command Line Interface
|
||||
(CLI) workflow and shows you a creation process of a simple cross-platform
|
||||
“Blink” Project. After finishing you will have a general understanding of how
|
||||
to work with the multiple development platforms and embedded boards.
|
||||
|
||||
2. Find board ``type`` using `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
or via :ref:`cmd_boards` command.
|
||||
Setting Up the Project
|
||||
----------------------
|
||||
|
||||
3. Initialize new PlatformIO based project via :ref:`cmd_init` command with the
|
||||
pre-configured environments for your boards:
|
||||
PlatformIO CLI provides special :ref:`cmd_init` command for configuring your projects.
|
||||
It allows to initialize new empty project or update existing with the new data.
|
||||
|
||||
What is more, :ref:`cmd_init` can be used for :ref:`ide`. It means that you will
|
||||
be able to import pre-generated PlatformIO project using favourite IDE and
|
||||
extend it with the professional instruments for IoT development.
|
||||
|
||||
This tutorial is based on the next popular embedded boards and development
|
||||
platforms using *Arduino Wiring-based Framework*:
|
||||
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Platform
|
||||
- Board
|
||||
- Framework
|
||||
|
||||
* - Atmel AVR
|
||||
- Arduino Uno (8-bit ATmega328P)
|
||||
- Arduino Wiring-based Framework
|
||||
|
||||
* - Espressif
|
||||
- NodeMCU 1.0 (32-bit ESP8266)
|
||||
- Arduino Wiring-based Framework
|
||||
|
||||
* - Teensy
|
||||
- Teensy 3.1 (32-bit ARM MK20DX256)
|
||||
- Arduino Wiring-based Framework
|
||||
|
||||
Board Identifier
|
||||
----------------
|
||||
|
||||
:ref:`cmd_init` command requires to specify board identifier (ID/TYPE). It can
|
||||
be found using `Embedded Boards Explorer <http://platformio.org/#!/boards>`_
|
||||
or :ref:`cmd_boards` command. For example, using :ref:`cmd_boards` let's try
|
||||
to find Teensy boards:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio init --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
> platformio boards teensy
|
||||
|
||||
The current working directory *** will be used for the new project.
|
||||
You can specify another project directory via
|
||||
`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.
|
||||
Platform: teensy
|
||||
---------------------------------------------------------------------------
|
||||
Type MCU Frequency Flash RAM Name
|
||||
---------------------------------------------------------------------------
|
||||
teensy20 atmega32u4 16Mhz 31kB 2.5kB Teensy 2.0
|
||||
teensy30 mk20dx128 48Mhz 128kB 16kB Teensy 3.0
|
||||
teensy31 mk20dx256 72Mhz 256kB 64kB Teensy 3.1 / 3.2
|
||||
teensylc mkl26z64 48Mhz 62kB 8kB Teensy LC
|
||||
teensy20pp at90usb1286 16Mhz 127kB 8kB Teensy++ 2.0
|
||||
|
||||
The next files/directories will be created in ***
|
||||
platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
|
||||
src - Put your source files here
|
||||
lib - Put here project specific (private) libraries
|
||||
Do you want to continue? [y/N]: y
|
||||
Project has been successfully initialized!
|
||||
Useful commands:
|
||||
`platformio run` - process/build project from the current directory
|
||||
`platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board
|
||||
`platformio run --target clean` - clean project (remove compiled files)
|
||||
According to the table above the ID/TYPE for Teensy 3.1 is ``teensy31``. Also,
|
||||
the ID for Arduino UNO is ``uno`` and for NodeMCU 1.0 (ESP-12E Module)
|
||||
is ``nodemcuv2``.
|
||||
|
||||
Put your source files ``*.h, *.c, *.cpp or *.ino`` to ``src`` directory.
|
||||
|
||||
4. Process the project's environments.
|
||||
Initialize Project
|
||||
------------------
|
||||
|
||||
Change working directory to the project's root where is located
|
||||
:ref:`Project Configuration File (platformio.ini) <projectconf>` and run:
|
||||
PlatformIO ecosystem contains huge database with pre-configured settings for the
|
||||
most popular embedded boards. It helps you to forget about installing
|
||||
toolchains, writing build scripts or configuring uploading process. Just tell
|
||||
PlatformIO the Board ID and you will receive full working project with
|
||||
pre-installed instruments for the professional development.
|
||||
|
||||
1. Create empty folder where you are going to initialize new PlatformIO
|
||||
project. Then open system Terminal and change directory to it:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# create new direcotry
|
||||
> mkdir path_to_the_new_directory
|
||||
|
||||
# go to it
|
||||
> cd path_to_the_new_directory
|
||||
|
||||
2. Initialize project for the boards mentioned above (you can specify more
|
||||
than one board at time):
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
> platformio init --board uno --board nodemcuv2 --board teensy31
|
||||
|
||||
The current working directory *** will be used for the new project.
|
||||
You can specify another project directory via
|
||||
`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.
|
||||
|
||||
The next files/directories will be created in ***
|
||||
platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
|
||||
src - Put your source files here
|
||||
lib - Put here project specific (private) libraries
|
||||
Do you want to continue? [y/N]: y
|
||||
Project has been successfully initialized!
|
||||
Useful commands:
|
||||
`platformio run` - process/build project from the current directory
|
||||
`platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board
|
||||
`platformio run --target clean` - clean project (remove compiled files)
|
||||
|
||||
|
||||
Congrats! You have just created the first PlatformIO based Project with the
|
||||
next structure:
|
||||
|
||||
* :ref:`projectconf`
|
||||
* ``src`` directory where you should place source code
|
||||
(``*.h, *.c, *.cpp, *.S, *.ino, etc.``)
|
||||
* ``lib`` directory can be used for the project specific (private) libraries.
|
||||
More details are located in ``lib/readme.txt`` file.
|
||||
* Miscellaneous files for CVS and :ref:`ci` support.
|
||||
|
||||
|
||||
.. note::
|
||||
If you need to add new board to the existing project please use
|
||||
:ref:`cmd_init` again.
|
||||
|
||||
|
||||
The result of just generated ``platformio.ini``:
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
||||
[env:uno]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = uno
|
||||
|
||||
[env:nodemcuv2]
|
||||
platform = espressif
|
||||
framework = arduino
|
||||
board = nodemcuv2
|
||||
|
||||
[env:teensy31]
|
||||
platform = teensy
|
||||
framework = arduino
|
||||
board = teensy31
|
||||
|
||||
|
||||
Now, we need to create ``main.cpp`` file and place it to ``src`` folder of our
|
||||
newly created project. The contents of ``src/main.cpp``:
|
||||
|
||||
.. code-block:: cpp
|
||||
|
||||
/**
|
||||
* Blink
|
||||
*
|
||||
* Turns on an LED on for one second,
|
||||
* then off for one second, repeatedly.
|
||||
*/
|
||||
#include "Arduino.h"
|
||||
|
||||
void setup()
|
||||
{
|
||||
// initialize LED digital pin as an output.
|
||||
pinMode(LED_BUILTIN, OUTPUT);
|
||||
}
|
||||
|
||||
void loop()
|
||||
{
|
||||
// turn the LED on (HIGH is the voltage level)
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
|
||||
// wait for a second
|
||||
delay(1000);
|
||||
|
||||
// turn the LED off by making the voltage LOW
|
||||
digitalWrite(LED_BUILTIN, LOW);
|
||||
|
||||
// wait for a second
|
||||
delay(1000);
|
||||
}
|
||||
|
||||
|
||||
The final Project structure:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio run
|
||||
|
||||
# if you don't have specified `targets = upload` option for environment,
|
||||
# then you can upload firmware manually with this command:
|
||||
$ platformio run --target upload
|
||||
|
||||
# clean project
|
||||
$ platformio run --target clean
|
||||
project_dir
|
||||
├── lib
|
||||
│ └── readme.txt
|
||||
├── platformio.ini
|
||||
└── src
|
||||
└── main.cpp
|
||||
|
||||
|
||||
Useful links:
|
||||
Process Project
|
||||
---------------
|
||||
|
||||
PlatformIO CLI provides special :ref:`cmd_run` command to process project. If
|
||||
you call it without any arguments, PlatformIO Build System will process all
|
||||
project environments (which were created per each board specified above). Here
|
||||
are a few useful commands:
|
||||
|
||||
* ``platformio run``. Process (build) all environments specified in
|
||||
:ref:`projectconf`
|
||||
* ``platformio run --target upload``. Build project and upload firmware to the
|
||||
all devices specified in :ref:`projectconf`
|
||||
* ``platformio run --target clean``. Clean project (delete compiled objects)
|
||||
* ``platformio run -e uno``. Process only ``uno`` environment
|
||||
* ``platformio run -e uno -t upload``. Build project only for ``uno`` and upload
|
||||
firmware.
|
||||
|
||||
Please follow to :option:`platformio run --target` documentation for the other
|
||||
targets.
|
||||
|
||||
Finally, demo which demonstrates building project and uploading firmware to
|
||||
Arduino Uno:
|
||||
|
||||
.. image:: _static/platformio-demo-wiring.gif
|
||||
|
||||
Further Reading
|
||||
---------------
|
||||
|
||||
* `Project examples <https://github.com/platformio/platformio/tree/develop/examples>`_
|
||||
* :ref:`userguide` for PlatformIO commands
|
||||
* `Quickstart for Espressif ESP8266 <https://github.com/esp8266/Arduino/blob/master/doc/platformio.md>`_
|
||||
* :ref:`userguide` for PlatformIO CLI commands
|
||||
|
@ -33,14 +33,11 @@ Initialize new PlatformIO based project or update existing with new data.
|
||||
This command will create:
|
||||
|
||||
* :ref:`projectconf`
|
||||
* ``src`` - a source directory. Put your source files here
|
||||
* ``lib`` - a directory for the project specific (private) libraries.
|
||||
* ``.travis.yml`` configuration file (template) for Continuous Integration
|
||||
with :ref:`ci_travis`
|
||||
|
||||
.. note::
|
||||
The source code of each library should be placed in separate directory.
|
||||
For example, ``lib/private_lib/[here are source files]``.
|
||||
* ``src`` directory where you should place source code
|
||||
(``*.h, *.c, *.cpp, *.S, *.ino, etc.``)
|
||||
* ``lib`` directory can be used for the project specific (private) libraries.
|
||||
More details are located in ``lib/readme.txt`` file.
|
||||
* Miscellaneous files for CVS and :ref:`ci` support.
|
||||
|
||||
Options
|
||||
-------
|
||||
|
@ -21,6 +21,7 @@ To print all available commands and options use:
|
||||
$ platformio lib --help
|
||||
$ platformio lib COMMAND --help
|
||||
|
||||
.. image:: ../../_static/platformio-demo-lib.gif
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
@ -21,6 +21,7 @@ To print all available commands and options use:
|
||||
$ platformio platforms --help
|
||||
$ platformio platforms COMMAND --help
|
||||
|
||||
.. image:: ../../_static/platformio-demo-platforms.gif
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
105
docs/what-is-platformio.rst
Normal file
@ -0,0 +1,105 @@
|
||||
.. Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
.. _what_is_pio:
|
||||
|
||||
What is PlatformIO?
|
||||
===================
|
||||
|
||||
.. contents::
|
||||
|
||||
Press about PlatformIO
|
||||
----------------------
|
||||
|
||||
"Different microcontrollers normally have different developing tools .
|
||||
For instance Arduino rely on Arduino IDE. Few more advanced users set up different
|
||||
graphical interfaces like Eclipse for better project management. Sometimes
|
||||
it may be hard to keep up with different microcontrollers and tools. You
|
||||
probably thought that single unified development tool could be great. Well
|
||||
this is what PlatformIO open source ecosystem is for.
|
||||
|
||||
This is cross platform code builder and library manager with platforms like
|
||||
Arduino or MBED support. They took care of toolchains, debuggers, frameworks
|
||||
that work on most popular platforms like Windows, Mac and Linux. It supports
|
||||
more than 200 development boards along with more than 15 development platforms
|
||||
and 10 frameworks. So most of popular boards are covered. They’ve done hard
|
||||
work in organizing and managing hundreds of libraries that can be included
|
||||
in to your project. Also lots of examples allow you to start developing
|
||||
quickly. PlatformIO initially was developed with Command line philosophy.
|
||||
It’s been successfully used with other IDE’s like Eclipse or Visual Studio.
|
||||
Recently they’ve released a version with built in IDE based on Atom text editor", -
|
||||
[Embedds]_.
|
||||
|
||||
Awards
|
||||
------
|
||||
|
||||
PlatformIO was nominated for the year's `best Software and Tools in the 2015/16 IoT Awards <http://iotawards.postscapes.com/2015-16/best-iot-software-and-tools>`_.
|
||||
|
||||
Problematic
|
||||
-----------
|
||||
|
||||
* The main problem which repulses people from embedded world is a complicated
|
||||
process to setup development software for a specific MCU/board: toolchains,
|
||||
proprietary vendor’s IDE (which sometimes isn’t free) and what is more,
|
||||
to get a computer with OS where that software is supported.
|
||||
* Multiple hardware platforms (MCUs, boards) require different toolchains,
|
||||
IDEs, etc, and, respectively, spending time on learning new development environments.
|
||||
* Finding proper libraries and code samples showing how to use popular
|
||||
sensors, actuators, etc.
|
||||
* Sharing embedded projects between team members, regardless of operating
|
||||
system they prefer to work with.
|
||||
|
||||
Overview
|
||||
--------
|
||||
|
||||
PlatformIO is independent from the platform, in which it is running. In fact,
|
||||
the only requirement is Python, which exists pretty much everywhere. What this
|
||||
means is that PlatformIO projects can be easily moved from one computer to
|
||||
another, as well as that PlatformIO allows for the easy sharing of projects
|
||||
between team members, regardless of operating system they prefer to work with.
|
||||
Beyond that, PlatformIO can be run not only on commonly used desktops/laptops
|
||||
but also on the servers without X Window System. While PlatformIO itself is a
|
||||
console application, it can be used in combination with one's favorite
|
||||
:ref:`ide` or text editor such as :ref:`ide_atom`, :ref:`ide_clion`,
|
||||
:ref:`ide_eclipse`, :ref:`ide_emacs`, :ref:`ide_netbeans`, :ref:`ide_qtcreator`,
|
||||
:ref:`ide_sublimetext`, :ref:`ide_vim`, :ref:`ide_visualstudio`, etc.
|
||||
|
||||
Alright, so PlatformIO can run on different operating systems. But more
|
||||
importantly, from development perspective at least, is a list of supported
|
||||
boards and MCUs. To keep things short: PlatformIO supports approximately 200
|
||||
`Embedded Boards <http://platformio.org/#!/boards>`_ and all major
|
||||
:ref:`Development Platforms <platforms>`.
|
||||
|
||||
User SHOULD have a choise
|
||||
-------------------------
|
||||
|
||||
* Decide which operation system they want to run development process on.
|
||||
You can even use one OS at home and another at work.
|
||||
* Choose which editor to use for writing the code. It can be pretty simple
|
||||
editor or powerful favorite :ref:`ide`.
|
||||
* Focus on the code development, significantly simplifying support for the
|
||||
:ref:`platforms` and MCUs.
|
||||
|
||||
|
||||
How does it work?
|
||||
-----------------
|
||||
|
||||
Without going too deep into PlatformIO implementation details, work cycle of
|
||||
the project developed using PlatformIO is as follows:
|
||||
|
||||
* Users choose board(s) interested in :ref:`projectconf`
|
||||
* Based on this list of boards, PlatformIO downloads required toolchains and
|
||||
installs them automatically.
|
||||
* Users develop code and PlatformIO makes sure that it is compiled, prepared
|
||||
and uploaded to all the boards of interest.
|
||||
|
||||
|
||||
.. [Embedds] Embedds.com: `Develop easier with PlatformIO ecosystem <http://www.embedds.com/develop-easier-with-platformio-ecosystem/>`_
|
3
examples/ide/clion/.gitignore
vendored
@ -1 +1,2 @@
|
||||
.pioenvs
|
||||
.pioenvs
|
||||
CMakeListsPrivate.txt
|
||||
|
6
examples/ide/clion/.idea/encodings.xml
generated
Normal file
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="Encoding">
|
||||
<file url="PROJECT" charset="UTF-8" />
|
||||
</component>
|
||||
</project>
|
@ -1,58 +1,51 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
project(clion)
|
||||
|
||||
set(PLATFORMIO_CMD platformio)
|
||||
|
||||
include_directories("$ENV{HOME}/.platformio/packages/framework-arduinoavr/variants/standard")
|
||||
include_directories("$ENV{HOME}/.platformio/packages/framework-arduinoavr/cores/arduino")
|
||||
include_directories("$ENV{HOME}/.platformio/packages/toolchain-atmelavr/avr/include")
|
||||
include_directories("$ENV{HOME}/.platformio/packages/toolchain-atmelavr/bfd/include")
|
||||
include_directories("$ENV{HOME}/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/4.8.1/include")
|
||||
include_directories("$ENV{HOME}/.platformio/packages/toolchain-atmelavr/lib/gcc/avr/4.8.1/include-fixed")
|
||||
|
||||
add_definitions(-DF_CPU=16000000L)
|
||||
add_definitions(-DARDUINO_ARCH_AVR)
|
||||
add_definitions(-DARDUINO_AVR_UNO)
|
||||
add_definitions(-DARDUINO=10607)
|
||||
add_definitions(-DPLATFORMIO=020701)
|
||||
add_definitions(-D__AVR_ATmega328P__)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_BUILD ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOAD ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_CLEAN ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_PROGRAM ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target program
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOADFS ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPDATE_ALL ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion update
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_executable(clion
|
||||
src/blink.cpp
|
||||
)
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
project(clion)
|
||||
|
||||
include(CMakeListsPrivate.txt)
|
||||
|
||||
add_definitions(-DF_CPU=16000000L)
|
||||
add_definitions(-DARDUINO_ARCH_AVR)
|
||||
add_definitions(-DARDUINO_AVR_UNO)
|
||||
add_definitions(-DARDUINO=10607)
|
||||
add_definitions(-DPLATFORMIO=020805)
|
||||
add_definitions(-D__AVR_ATmega328P__)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_BUILD ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOAD ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_CLEAN ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_PROGRAM ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target program
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOADFS ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPDATE_ALL ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion update
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_executable(clion
|
||||
src/blink.cpp
|
||||
)
|
||||
|
@ -14,13 +14,13 @@
|
||||
|
||||
import sys
|
||||
|
||||
VERSION = (2, 8, 4)
|
||||
VERSION = (2, 8, 5)
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
__description__ = (
|
||||
"An open source ecosystem for IoT development. "
|
||||
"Cross-platform code builder and library manager. "
|
||||
"Cross-platform build system and library manager. "
|
||||
"Continuous and IDE integration. "
|
||||
"Arduino and MBED compatible. Ready for Cloud compiling."
|
||||
)
|
||||
|
@ -49,6 +49,31 @@
|
||||
"vendor": "Espressif"
|
||||
},
|
||||
|
||||
"esp07": {
|
||||
"build": {
|
||||
"core": "esp8266",
|
||||
"extra_flags": "-DESP8266 -DARDUINO_ARCH_ESP8266 -DARDUINO_ESP8266_ESP07",
|
||||
"f_cpu": "80000000L",
|
||||
"f_flash": "40000000L",
|
||||
"flash_mode": "qio",
|
||||
"ldscript": "esp8266.flash.4m1m.ld",
|
||||
"mcu": "esp8266",
|
||||
"variant": "nodemcu"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "Espressif Generic ESP8266 ESP-07",
|
||||
"platform": "espressif",
|
||||
"upload": {
|
||||
"maximum_ram_size": 81920,
|
||||
"maximum_size": 4194304,
|
||||
"resetmethod": "nodemcu",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
},
|
||||
"url": "http://www.esp8266.com/wiki/doku.php?id=esp8266-module-family#esp-07",
|
||||
"vendor": "Espressif"
|
||||
},
|
||||
|
||||
"esp12e": {
|
||||
"build": {
|
||||
"core": "esp8266",
|
||||
|
@ -120,7 +120,7 @@ if "due" in env.subst("$BOARD"):
|
||||
)
|
||||
elif "zero" in env.subst("$BOARD"):
|
||||
env.Append(
|
||||
CPPFLAGS=[
|
||||
CCFLAGS=[
|
||||
"--param", "max-inline-insns-single=500"
|
||||
],
|
||||
|
||||
|
@ -31,9 +31,9 @@ env.Replace(
|
||||
|
||||
ARFLAGS=["rcs"],
|
||||
|
||||
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
||||
|
||||
CPPFLAGS=[
|
||||
CCFLAGS=[
|
||||
"-g", # include debugging info (so errors include line numbers)
|
||||
"-Os", # optimize for size
|
||||
"-ffunction-sections", # place each function in its own section
|
||||
@ -68,7 +68,10 @@ env.Replace(
|
||||
PROGSUFFIX=".elf"
|
||||
)
|
||||
|
||||
|
||||
env.Append(
|
||||
ASFLAGS=env.get("CCFLAGS", [])[:],
|
||||
|
||||
BUILDERS=dict(
|
||||
ElfToBin=Builder(
|
||||
action=" ".join([
|
||||
|
@ -31,9 +31,9 @@ env.Replace(
|
||||
|
||||
ARFLAGS=["rcs"],
|
||||
|
||||
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
||||
|
||||
CPPFLAGS=[
|
||||
CCFLAGS=[
|
||||
"-g", # include debugging info (so errors include line numbers)
|
||||
"-Os", # optimize for size
|
||||
"-Wall", # show warnings
|
||||
@ -64,6 +64,8 @@ env.Replace(
|
||||
)
|
||||
|
||||
env.Append(
|
||||
ASFLAGS=env.get("CCFLAGS", [])[:],
|
||||
|
||||
BUILDERS=dict(
|
||||
ElfToEep=Builder(
|
||||
action=" ".join([
|
||||
|
@ -64,7 +64,7 @@ env.Replace(
|
||||
|
||||
ARFLAGS=["rcs"],
|
||||
|
||||
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
||||
|
||||
CFLAGS=[
|
||||
"-std=gnu99",
|
||||
@ -75,7 +75,7 @@ env.Replace(
|
||||
"-nostdlib"
|
||||
],
|
||||
|
||||
CPPFLAGS=[
|
||||
CCFLAGS=[
|
||||
"-Os", # optimize for size
|
||||
"-mlongcalls",
|
||||
"-mtext-section-literals",
|
||||
@ -99,6 +99,7 @@ env.Replace(
|
||||
],
|
||||
|
||||
LINKFLAGS=[
|
||||
"-Os",
|
||||
"-nostdlib",
|
||||
"-Wl,--no-check-sections",
|
||||
"-u", "call_user_start",
|
||||
@ -141,6 +142,8 @@ env.Replace(
|
||||
)
|
||||
|
||||
env.Append(
|
||||
ASFLAGS=env.get("CCFLAGS", [])[:],
|
||||
|
||||
BUILDERS=dict(
|
||||
ElfToBin=Builder(
|
||||
action=" ".join([
|
||||
|
@ -15,8 +15,8 @@
|
||||
"""
|
||||
Arduino
|
||||
|
||||
Arduino Framework allows writing cross-platform software to control
|
||||
devices attached to a wide range of Arduino boards to create all
|
||||
Arduino Wiring-based Framework allows writing cross-platform software to
|
||||
control devices attached to a wide range of Arduino boards to create all
|
||||
kinds of creative coding, interactive objects, spaces or physical experiences.
|
||||
|
||||
http://arduino.cc/en/Reference/HomePage
|
||||
@ -57,7 +57,7 @@ elif env.get("PLATFORM") == "espressif":
|
||||
env.Prepend(
|
||||
CPPPATH=[join("$PLATFORMFW_DIR", "tools", "sdk", "include")],
|
||||
LIBPATH=[join("$PLATFORMFW_DIR", "tools", "sdk", "lib")],
|
||||
LIBS=["smartconfig", "pp", "main", "wpa", "lwip",
|
||||
LIBS=["mesh", "wpa2", "smartconfig", "pp", "main", "wpa", "lwip",
|
||||
"net80211", "wps", "crypto", "phy", "hal", "axtls", "gcc", "m"]
|
||||
)
|
||||
elif env.get("PLATFORM") == "nordicnrf51":
|
||||
|
@ -15,9 +15,9 @@
|
||||
"""
|
||||
Energia
|
||||
|
||||
Energia framework enables pretty much anyone to start easily creating
|
||||
microcontroller-based projects and applications. Its easy-to-use libraries
|
||||
and functions provide developers of all experience levels to start
|
||||
Energia Wiring-based framework enables pretty much anyone to start easily
|
||||
creating microcontroller-based projects and applications. Its easy-to-use
|
||||
libraries and functions provide developers of all experience levels to start
|
||||
blinking LEDs, buzzing buzzers and sensing sensors more quickly than ever
|
||||
before.
|
||||
|
||||
|
@ -188,10 +188,10 @@ def get_build_flags(data):
|
||||
flags = {}
|
||||
cflags = set(data.get("CFLAGS", []))
|
||||
cxxflags = set(data.get("CXXFLAGS", []))
|
||||
cppflags = set(cflags & cxxflags)
|
||||
flags['CPPFLAGS'] = list(cppflags)
|
||||
flags['CXXFLAGS'] = list(cxxflags - cppflags)
|
||||
flags['CFLAGS'] = list(cflags - cppflags)
|
||||
ccflags = set(cflags & cxxflags)
|
||||
flags['CCFLAGS'] = list(ccflags)
|
||||
flags['CXXFLAGS'] = list(cxxflags - ccflags)
|
||||
flags['CFLAGS'] = list(cflags - ccflags)
|
||||
return flags
|
||||
|
||||
|
||||
@ -221,7 +221,7 @@ variant_dir = join("$PLATFORMFW_DIR", "variant", variant)
|
||||
env.Replace(
|
||||
_mbed_whole_archive_hook=_mbed_whole_archive_hook,
|
||||
_LIBFLAGS="${_mbed_whole_archive_hook(%s)}" % env.get("_LIBFLAGS")[2:-1],
|
||||
CPPFLAGS=build_flags.get("CPPFLAGS", []),
|
||||
CCFLAGS=build_flags.get("CCFLAGS", []),
|
||||
CFLAGS=build_flags.get("CFLAGS", []),
|
||||
CXXFLAGS=build_flags.get("CXXFLAGS", []),
|
||||
LINKFLAGS=eixdata.get("LINKFLAGS", []),
|
||||
|
@ -27,7 +27,7 @@ SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
|
||||
|
||||
if env.subst("$BOARD") == "rfduino":
|
||||
env.Append(
|
||||
CPPFLAGS=["-fno-builtin"],
|
||||
CCFLAGS=["-fno-builtin"],
|
||||
LINKFLAGS=["--specs=nano.specs"]
|
||||
)
|
||||
env.Replace(
|
||||
|
@ -31,7 +31,7 @@ elif env.get("BOARD_OPTIONS", {}).get("build", {}).get("core") == "teensy3":
|
||||
LINKFLAGS=[
|
||||
"-Wl,--defsym=__rtc_localtime=$UNIX_TIME"
|
||||
],
|
||||
CPPFLAGS=[
|
||||
CCFLAGS=[
|
||||
"-fsingle-precision-constant"
|
||||
]
|
||||
)
|
||||
|
@ -36,7 +36,7 @@ env.Replace(
|
||||
|
||||
ARFLAGS=["rcs"],
|
||||
|
||||
ASPPFLAGS=["-x", "assembler-with-cpp"],
|
||||
ASFLAGS=["-x", "assembler-with-cpp"],
|
||||
|
||||
CCFLAGS=[
|
||||
"-g", # include debugging info (so errors include line numbers)
|
||||
@ -74,6 +74,8 @@ env.Replace(
|
||||
)
|
||||
|
||||
env.Append(
|
||||
ASFLAGS=env.get("CCFLAGS", [])[:],
|
||||
|
||||
BUILDERS=dict(
|
||||
ElfToHex=Builder(
|
||||
action=" ".join([
|
||||
|
@ -213,14 +213,15 @@ def DumpIDEData(env):
|
||||
)
|
||||
return defines
|
||||
|
||||
LINTCCOM = "$CFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS"
|
||||
LINTCXXCOM = "$CXXFLAGS $CCFLAGS $CPPFLAGS $_CPPDEFFLAGS"
|
||||
env_ = env.Clone()
|
||||
|
||||
data = {
|
||||
"defines": get_defines(env_),
|
||||
"includes": get_includes(env_),
|
||||
"cc_flags": env_.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"),
|
||||
"cxx_flags": env_.subst(
|
||||
"$SHCXXFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"),
|
||||
"cc_flags": env_.subst(LINTCCOM),
|
||||
"cxx_flags": env_.subst(LINTCXXCOM),
|
||||
"cxx_path": where_is_program(
|
||||
env_.subst("$CXX"), env_.subst("${ENV['PATH']}"))
|
||||
}
|
||||
@ -228,6 +229,8 @@ def DumpIDEData(env):
|
||||
# https://github.com/platformio/platformio-atom-ide/issues/34
|
||||
_new_defines = []
|
||||
for item in env_.get("CPPDEFINES", []):
|
||||
if isinstance(item, list):
|
||||
item = "=".join(item)
|
||||
item = item.replace('\\"', '"')
|
||||
if " " in item:
|
||||
_new_defines.append(item.replace(" ", "\\\\ "))
|
||||
@ -236,9 +239,8 @@ def DumpIDEData(env):
|
||||
env_.Replace(CPPDEFINES=_new_defines)
|
||||
|
||||
data.update({
|
||||
"cc_flags": env_.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"),
|
||||
"cxx_flags": env_.subst(
|
||||
"$SHCXXFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS")
|
||||
"cc_flags": env_.subst(LINTCCOM),
|
||||
"cxx_flags": env_.subst(LINTCXXCOM)
|
||||
})
|
||||
|
||||
return data
|
||||
@ -254,9 +256,10 @@ def GetCompilerType(env):
|
||||
if result['returncode'] != 0:
|
||||
return None
|
||||
output = "".join([result['out'], result['err']]).lower()
|
||||
for type_ in ("clang", "gcc"):
|
||||
if type_ in output:
|
||||
return type_
|
||||
if "clang" in output and "LLVM" in output:
|
||||
return "clang"
|
||||
elif "gcc" in output:
|
||||
return "gcc"
|
||||
return None
|
||||
|
||||
|
||||
|
@ -97,17 +97,31 @@ def BuildProgram(env):
|
||||
|
||||
def ProcessFlags(env, flags):
|
||||
for f in flags:
|
||||
if f:
|
||||
env.MergeFlags(str(f))
|
||||
if not f:
|
||||
continue
|
||||
parsed_flags = env.ParseFlags(str(f))
|
||||
for flag in parsed_flags.pop("CPPDEFINES"):
|
||||
if not isinstance(flag, list):
|
||||
env.Append(CPPDEFINES=flag)
|
||||
continue
|
||||
if '\"' in flag[1]:
|
||||
flag[1] = flag[1].replace('\"', '\\\"')
|
||||
env.Append(CPPDEFINES=[flag])
|
||||
env.Append(**parsed_flags)
|
||||
|
||||
# fix relative CPPPATH
|
||||
for i, p in enumerate(env.get("CPPPATH", [])):
|
||||
if isdir(p):
|
||||
env['CPPPATH'][i] = realpath(p)
|
||||
# fix relative path for "-include"
|
||||
for i, f in enumerate(env.get("CCFLAGS", [])):
|
||||
if isinstance(f, tuple) and f[0] == "-include":
|
||||
env['CCFLAGS'][i] = (f[0], env.File(realpath(f[1].get_path())))
|
||||
|
||||
# Cancel any previous definition of name, either built in or
|
||||
# provided with a -D option // Issue #191
|
||||
undefines = [u for u in env.get("CCFLAGS", []) if u.startswith("-U")]
|
||||
undefines = [u for u in env.get("CCFLAGS", [])
|
||||
if isinstance(u, basestring) and u.startswith("-U")]
|
||||
if undefines:
|
||||
for undef in undefines:
|
||||
env['CCFLAGS'].remove(undef)
|
||||
|
@ -18,7 +18,7 @@ from shutil import copyfile
|
||||
|
||||
import click
|
||||
|
||||
from platformio import app, exception
|
||||
from platformio import app, exception, util
|
||||
from platformio.commands.platforms import \
|
||||
platforms_install as cli_platforms_install
|
||||
from platformio.ide.projectgenerator import ProjectGenerator
|
||||
@ -75,26 +75,12 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
|
||||
not click.confirm("Do you want to continue?")):
|
||||
raise exception.AbortedByUser()
|
||||
|
||||
project_file = join(project_dir, "platformio.ini")
|
||||
src_dir = join(project_dir, "src")
|
||||
lib_dir = join(project_dir, "lib")
|
||||
|
||||
for d in (src_dir, lib_dir):
|
||||
if not isdir(d):
|
||||
makedirs(d)
|
||||
|
||||
init_lib_readme(lib_dir)
|
||||
init_ci_conf(project_dir)
|
||||
init_cvs_ignore(project_dir)
|
||||
|
||||
if not isfile(project_file):
|
||||
copyfile(join(get_source_dir(), "projectconftpl.ini"),
|
||||
project_file)
|
||||
init_base_project(project_dir)
|
||||
|
||||
if board:
|
||||
fill_project_envs(
|
||||
ctx, project_file, board, enable_auto_uploading, env_prefix,
|
||||
ide is not None
|
||||
ctx, join(project_dir, "platformio.ini"), board,
|
||||
enable_auto_uploading, env_prefix, ide is not None
|
||||
)
|
||||
|
||||
if ide:
|
||||
@ -126,58 +112,26 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
|
||||
)
|
||||
|
||||
|
||||
def fill_project_envs( # pylint: disable=too-many-arguments,too-many-locals
|
||||
ctx, project_file, board_types, enable_auto_uploading,
|
||||
env_prefix, force_download):
|
||||
builtin_boards = get_boards()
|
||||
content = []
|
||||
used_envs = []
|
||||
used_platforms = []
|
||||
def init_base_project(project_dir):
|
||||
platformio_ini = join(project_dir, "platformio.ini")
|
||||
if not isfile(platformio_ini):
|
||||
copyfile(join(get_source_dir(), "projectconftpl.ini"),
|
||||
platformio_ini)
|
||||
|
||||
with open(project_file) as f:
|
||||
used_envs = [l.strip() for l in f.read().splitlines() if
|
||||
l.strip().startswith("[env:")]
|
||||
lib_dir = join(project_dir, "lib")
|
||||
src_dir = join(project_dir, "src")
|
||||
with util.cd(project_dir):
|
||||
config = util.get_project_config()
|
||||
if config.has_option("platformio", "src_dir"):
|
||||
src_dir = join(project_dir, config.get("platformio", "src_dir"))
|
||||
|
||||
for type_ in board_types:
|
||||
data = builtin_boards[type_]
|
||||
used_platforms.append(data['platform'])
|
||||
env_name = "[env:%s%s]" % (env_prefix, type_)
|
||||
for d in (src_dir, lib_dir):
|
||||
if not isdir(d):
|
||||
makedirs(d)
|
||||
|
||||
if env_name in used_envs:
|
||||
continue
|
||||
|
||||
content.append("")
|
||||
content.append(env_name)
|
||||
content.append("platform = %s" % data['platform'])
|
||||
|
||||
# find default framework for board
|
||||
frameworks = data.get("frameworks")
|
||||
if frameworks:
|
||||
content.append("framework = %s" % frameworks[0])
|
||||
|
||||
content.append("board = %s" % type_)
|
||||
if enable_auto_uploading:
|
||||
content.append("targets = upload")
|
||||
|
||||
if force_download and used_platforms:
|
||||
_install_dependent_platforms(ctx, used_platforms)
|
||||
|
||||
if not content:
|
||||
return
|
||||
|
||||
with open(project_file, "a") as f:
|
||||
content.append("")
|
||||
f.write("\n".join(content))
|
||||
|
||||
|
||||
def _install_dependent_platforms(ctx, platforms):
|
||||
installed_platforms = PlatformFactory.get_platforms(installed=True).keys()
|
||||
if set(platforms) <= set(installed_platforms):
|
||||
return
|
||||
ctx.invoke(
|
||||
cli_platforms_install,
|
||||
platforms=list(set(platforms) - set(installed_platforms))
|
||||
)
|
||||
init_lib_readme(lib_dir)
|
||||
init_ci_conf(project_dir)
|
||||
init_cvs_ignore(project_dir)
|
||||
|
||||
|
||||
def init_lib_readme(lib_dir):
|
||||
@ -302,3 +256,57 @@ def init_cvs_ignore(project_dir):
|
||||
return
|
||||
with open(join(project_dir, ".gitignore"), "w") as f:
|
||||
f.write(".pioenvs")
|
||||
|
||||
|
||||
def fill_project_envs( # pylint: disable=too-many-arguments,too-many-locals
|
||||
ctx, platformio_ini, board_types, enable_auto_uploading,
|
||||
env_prefix, force_download):
|
||||
builtin_boards = get_boards()
|
||||
content = []
|
||||
used_envs = []
|
||||
used_platforms = []
|
||||
|
||||
with open(platformio_ini) as f:
|
||||
used_envs = [l.strip() for l in f.read().splitlines() if
|
||||
l.strip().startswith("[env:")]
|
||||
|
||||
for type_ in board_types:
|
||||
data = builtin_boards[type_]
|
||||
used_platforms.append(data['platform'])
|
||||
env_name = "[env:%s%s]" % (env_prefix, type_)
|
||||
|
||||
if env_name in used_envs:
|
||||
continue
|
||||
|
||||
content.append("")
|
||||
content.append(env_name)
|
||||
content.append("platform = %s" % data['platform'])
|
||||
|
||||
# find default framework for board
|
||||
frameworks = data.get("frameworks")
|
||||
if frameworks:
|
||||
content.append("framework = %s" % frameworks[0])
|
||||
|
||||
content.append("board = %s" % type_)
|
||||
if enable_auto_uploading:
|
||||
content.append("targets = upload")
|
||||
|
||||
if force_download and used_platforms:
|
||||
_install_dependent_platforms(ctx, used_platforms)
|
||||
|
||||
if not content:
|
||||
return
|
||||
|
||||
with open(platformio_ini, "a") as f:
|
||||
content.append("")
|
||||
f.write("\n".join(content))
|
||||
|
||||
|
||||
def _install_dependent_platforms(ctx, platforms):
|
||||
installed_platforms = PlatformFactory.get_platforms(installed=True).keys()
|
||||
if set(platforms) <= set(installed_platforms):
|
||||
return
|
||||
ctx.invoke(
|
||||
cli_platforms_install,
|
||||
platforms=list(set(platforms) - set(installed_platforms))
|
||||
)
|
||||
|
2
platformio/ide/tpls/clion/.gitignore.tpl
Normal file
@ -0,0 +1,2 @@
|
||||
.pioenvs
|
||||
CMakeListsPrivate.txt
|
@ -1,73 +1,60 @@
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
project({{project_name}})
|
||||
|
||||
set(ENV{PATH} "{{env_path}}")
|
||||
set(PLATFORMIO_CMD "{{platformio_path}}")
|
||||
|
||||
% for include in includes:
|
||||
% if include.startswith(user_home_dir):
|
||||
% if "windows" in systype:
|
||||
include_directories("$ENV{HOMEDRIVE}$ENV{HOMEPATH}{{include.replace(user_home_dir, '').replace("\\", "/")}}")
|
||||
% else:
|
||||
include_directories("$ENV{HOME}{{include.replace(user_home_dir, '').replace("\\", "/")}}")
|
||||
% end
|
||||
% else:
|
||||
include_directories("{{include.replace("\\", "/")}}")
|
||||
% end
|
||||
% end
|
||||
|
||||
% for define in defines:
|
||||
add_definitions(-D{{!define}})
|
||||
% end
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_BUILD ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOAD ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_CLEAN ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_PROGRAM ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target program
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOADFS ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPDATE_ALL ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion update
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
% if src_files and any([f.endswith((".c", ".cpp")) for f in src_files]):
|
||||
add_executable({{project_name}}
|
||||
% for f in src_files:
|
||||
% if f.endswith((".c", ".cpp")):
|
||||
{{f.replace("\\", "/")}}
|
||||
% end
|
||||
% end
|
||||
)
|
||||
% else:
|
||||
#
|
||||
# To enable code auto-completion, please specify path
|
||||
# to main source file (*.c, *.cpp) and uncomment line below
|
||||
#
|
||||
# add_executable({{project_name}} src/main_change_me.cpp)
|
||||
% end
|
||||
cmake_minimum_required(VERSION 3.2)
|
||||
project({{project_name}})
|
||||
|
||||
include(CMakeListsPrivate.txt)
|
||||
|
||||
% for define in defines:
|
||||
add_definitions(-D{{!define}})
|
||||
% end
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_BUILD ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOAD ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target upload
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_CLEAN ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_PROGRAM ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target program
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPLOADFS ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target uploadfs
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
add_custom_target(
|
||||
PLATFORMIO_UPDATE_ALL ALL
|
||||
COMMAND ${PLATFORMIO_CMD} -f -c clion update
|
||||
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
|
||||
)
|
||||
|
||||
% if src_files and any([f.endswith((".c", ".cpp")) for f in src_files]):
|
||||
add_executable({{project_name}}
|
||||
% for f in src_files:
|
||||
% if f.endswith((".c", ".cpp")):
|
||||
{{f.replace("\\", "/")}}
|
||||
% end
|
||||
% end
|
||||
)
|
||||
% else:
|
||||
#
|
||||
# To enable code auto-completion, please specify path
|
||||
# to main source file (*.c, *.cpp) and uncomment line below
|
||||
#
|
||||
# add_executable({{project_name}} src/main_change_me.cpp)
|
||||
% end
|
||||
|
14
platformio/ide/tpls/clion/CMakeListsPrivate.txt.tpl
Normal file
@ -0,0 +1,14 @@
|
||||
set(ENV{PATH} "{{env_path}}")
|
||||
set(PLATFORMIO_CMD "{{platformio_path}}")
|
||||
|
||||
% for include in includes:
|
||||
% if include.startswith(user_home_dir):
|
||||
% if "windows" in systype:
|
||||
include_directories("$ENV{HOMEDRIVE}$ENV{HOMEPATH}{{include.replace(user_home_dir, '').replace("\\", "/")}}")
|
||||
% else:
|
||||
include_directories("$ENV{HOME}{{include.replace(user_home_dir, '').replace("\\", "/")}}")
|
||||
% end
|
||||
% else:
|
||||
include_directories("{{include.replace("\\", "/")}}")
|
||||
% end
|
||||
% end
|
@ -0,0 +1,72 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="97">
|
||||
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
|
||||
<df root="." name="0">
|
||||
<in>platformio.ini</in>
|
||||
</df>
|
||||
<logicalFolder name="ExternalFiles"
|
||||
displayName="Important Files"
|
||||
projectFiles="false"
|
||||
kind="IMPORTANT_FILES_FOLDER">
|
||||
<itemPath>nbproject/private/launcher.properties</itemPath>
|
||||
</logicalFolder>
|
||||
</logicalFolder>
|
||||
<sourceFolderFilter>^(nbproject|.pioenvs)$</sourceFolderFilter>
|
||||
<sourceRootList>
|
||||
<Elem>.</Elem>
|
||||
</sourceRootList>
|
||||
<projectmakefile></projectmakefile>
|
||||
<confs>
|
||||
<conf name="Default" type="0">
|
||||
<toolsSet>
|
||||
<compilerSet>default</compilerSet>
|
||||
<dependencyChecking>false</dependencyChecking>
|
||||
<rebuildPropChanged>false</rebuildPropChanged>
|
||||
</toolsSet>
|
||||
<codeAssistance>
|
||||
<buildAnalyzer>true</buildAnalyzer>
|
||||
<includeAdditional>true</includeAdditional>
|
||||
</codeAssistance>
|
||||
<makefileType>
|
||||
<makeTool>
|
||||
<buildCommandWorkingDir>.</buildCommandWorkingDir>
|
||||
<buildCommand>{{platformio_path}} -f -c netbeans run</buildCommand>
|
||||
<cleanCommand>{{platformio_path}} -f -c netbeans run --target clean</cleanCommand>
|
||||
<executablePath></executablePath>
|
||||
<cTool>
|
||||
<incDir>
|
||||
<pElem>src</pElem>
|
||||
% for include in includes:
|
||||
<pElem>{{include}}</pElem>
|
||||
% end
|
||||
</incDir>
|
||||
<preprocessorList>
|
||||
% for define in defines:
|
||||
<Elem>{{define}}</Elem>
|
||||
% end
|
||||
</preprocessorList>
|
||||
</cTool>
|
||||
<ccTool>
|
||||
<incDir>
|
||||
<pElem>src</pElem>
|
||||
% for include in includes:
|
||||
<pElem>{{include}}</pElem>
|
||||
% end
|
||||
</incDir>
|
||||
<preprocessorList>
|
||||
% for define in defines:
|
||||
<Elem>{{define}}</Elem>
|
||||
% end
|
||||
</preprocessorList>
|
||||
</ccTool>
|
||||
</makeTool>
|
||||
<preBuild>
|
||||
<preBuildCommandWorkingDir>.</preBuildCommandWorkingDir>
|
||||
<preBuildCommand></preBuildCommand>
|
||||
</preBuild>
|
||||
</makefileType>
|
||||
<item path="platformio.ini" ex="false" tool="3" flavor2="0">
|
||||
</item>
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
@ -0,0 +1,61 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configurationDescriptor version="97">
|
||||
<logicalFolder name="root" displayName="root" projectFiles="true" kind="ROOT">
|
||||
<df root="." name="0">
|
||||
<df name="lib">
|
||||
</df>
|
||||
<df name="src">
|
||||
</df>
|
||||
<in>platformio.ini</in>
|
||||
</df>
|
||||
</logicalFolder>
|
||||
<projectmakefile></projectmakefile>
|
||||
<confs>
|
||||
<conf name="Default" type="0">
|
||||
<toolsSet>
|
||||
<developmentServer>localhost</developmentServer>
|
||||
<platform>{{4 if "darwin" in systype else 2 if "linux" in systype else 3}}</platform>
|
||||
</toolsSet>
|
||||
<compile>
|
||||
<compiledirpicklist>
|
||||
<compiledirpicklistitem>.</compiledirpicklistitem>
|
||||
<compiledirpicklistitem>${AUTO_FOLDER}</compiledirpicklistitem>
|
||||
</compiledirpicklist>
|
||||
<compiledir>${AUTO_FOLDER}</compiledir>
|
||||
<compilecommandpicklist>
|
||||
<compilecommandpicklistitem>${MAKE} ${ITEM_NAME}.o</compilecommandpicklistitem>
|
||||
<compilecommandpicklistitem>${AUTO_COMPILE}</compilecommandpicklistitem>
|
||||
</compilecommandpicklist>
|
||||
<compilecommand>${AUTO_COMPILE}</compilecommand>
|
||||
</compile>
|
||||
<dbx_gdbdebugger version="1">
|
||||
<gdb_pathmaps>
|
||||
</gdb_pathmaps>
|
||||
<gdb_interceptlist>
|
||||
<gdbinterceptoptions gdb_all="false" gdb_unhandled="true" gdb_unexpected="true"/>
|
||||
</gdb_interceptlist>
|
||||
<gdb_options>
|
||||
<DebugOptions>
|
||||
</DebugOptions>
|
||||
</gdb_options>
|
||||
<gdb_buildfirst gdb_buildfirst_overriden="false" gdb_buildfirst_old="false"/>
|
||||
</dbx_gdbdebugger>
|
||||
<nativedebugger version="1">
|
||||
<engine>gdb</engine>
|
||||
</nativedebugger>
|
||||
<runprofile version="9">
|
||||
<runcommandpicklist>
|
||||
<runcommandpicklistitem>"${OUTPUT_PATH}"</runcommandpicklistitem>
|
||||
<runcommandpicklistitem>{{platformio_path}} -f -c netbeans run --target upload</runcommandpicklistitem>
|
||||
</runcommandpicklist>
|
||||
<runcommand>{{platformio_path}} -f -c netbeans run --target upload</runcommand>
|
||||
<rundir>.</rundir>
|
||||
<buildfirst>false</buildfirst>
|
||||
<terminal-type>0</terminal-type>
|
||||
<remove-instrumentation>0</remove-instrumentation>
|
||||
<environment>
|
||||
</environment>
|
||||
</runprofile>
|
||||
</conf>
|
||||
</confs>
|
||||
</configurationDescriptor>
|
@ -0,0 +1,40 @@
|
||||
# Launchers File syntax:
|
||||
#
|
||||
# [Must-have property line]
|
||||
# launcher1.runCommand=<Run Command>
|
||||
# [Optional extra properties]
|
||||
# launcher1.displayName=<Display Name, runCommand by default>
|
||||
# launcher1.buildCommand=<Build Command, Build Command specified in project properties by default>
|
||||
# launcher1.runDir=<Run Directory, ${PROJECT_DIR} by default>
|
||||
# launcher1.symbolFiles=<Symbol Files loaded by debugger, ${OUTPUT_PATH} by default>
|
||||
# launcher1.env.<Environment variable KEY>=<Environment variable VALUE>
|
||||
# (If this value is quoted with ` it is handled as a native command which execution result will become the value)
|
||||
# [Common launcher properties]
|
||||
# common.runDir=<Run Directory>
|
||||
# (This value is overwritten by a launcher specific runDir value if the latter exists)
|
||||
# common.env.<Environment variable KEY>=<Environment variable VALUE>
|
||||
# (Environment variables from common launcher are merged with launcher specific variables)
|
||||
# common.symbolFiles=<Symbol Files loaded by debugger>
|
||||
# (This value is overwritten by a launcher specific symbolFiles value if the latter exists)
|
||||
#
|
||||
# In runDir, symbolFiles and env fields you can use these macroses:
|
||||
# ${PROJECT_DIR} - project directory absolute path
|
||||
# ${OUTPUT_PATH} - linker output path (relative to project directory path)
|
||||
# ${OUTPUT_BASENAME}- linker output filename
|
||||
# ${TESTDIR} - test files directory (relative to project directory path)
|
||||
# ${OBJECTDIR} - object files directory (relative to project directory path)
|
||||
# ${CND_DISTDIR} - distribution directory (relative to project directory path)
|
||||
# ${CND_BUILDDIR} - build directory (relative to project directory path)
|
||||
# ${CND_PLATFORM} - platform name
|
||||
# ${CND_CONF} - configuration name
|
||||
# ${CND_DLIB_EXT} - dynamic library extension
|
||||
#
|
||||
# All the project launchers must be listed in the file!
|
||||
#
|
||||
# launcher1.runCommand=...
|
||||
# launcher2.runCommand=...
|
||||
# ...
|
||||
# common.runDir=...
|
||||
# common.env.KEY=VALUE
|
||||
|
||||
# launcher1.runCommand=<type your run command here>
|
@ -0,0 +1,10 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-private xmlns="http://www.netbeans.org/ns/project-private/1">
|
||||
<code-assistance-data xmlns="http://www.netbeans.org/ns/make-project-private/1">
|
||||
<code-model-enabled>true</code-model-enabled>
|
||||
</code-assistance-data>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project-private/1">
|
||||
<activeConfTypeElem>0</activeConfTypeElem>
|
||||
<activeConfIndexElem>0</activeConfIndexElem>
|
||||
</data>
|
||||
</project-private>
|
26
platformio/ide/tpls/netbeans/nbproject/project.xml.tpl
Normal file
@ -0,0 +1,26 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://www.netbeans.org/ns/project/1">
|
||||
<type>org.netbeans.modules.cnd.makeproject</type>
|
||||
<configuration>
|
||||
<data xmlns="http://www.netbeans.org/ns/make-project/1">
|
||||
<name>{{project_name}}</name>
|
||||
<c-extensions/>
|
||||
<cpp-extensions/>
|
||||
<header-extensions/>
|
||||
<sourceEncoding>UTF-8</sourceEncoding>
|
||||
<make-dep-projects/>
|
||||
<sourceRootList>
|
||||
<sourceRootElem>.</sourceRootElem>
|
||||
</sourceRootList>
|
||||
<confList>
|
||||
<confElem>
|
||||
<name>Default</name>
|
||||
<type>0</type>
|
||||
</confElem>
|
||||
</confList>
|
||||
<formatting>
|
||||
<project-formatting-style>false</project-formatting-style>
|
||||
</formatting>
|
||||
</data>
|
||||
</configuration>
|
||||
</project>
|
@ -21,7 +21,7 @@ from time import time
|
||||
|
||||
import click
|
||||
|
||||
from platformio import __version__, app, exception, telemetry
|
||||
from platformio import __version__, app, exception, telemetry, util
|
||||
from platformio.commands.lib import lib_update as cmd_libraries_update
|
||||
from platformio.commands.platforms import \
|
||||
platforms_install as cmd_platforms_install
|
||||
@ -46,6 +46,8 @@ def on_platformio_start(ctx, force, caller):
|
||||
|
||||
after_upgrade(ctx)
|
||||
|
||||
|
||||
def on_platformio_end(ctx, result): # pylint: disable=W0613
|
||||
try:
|
||||
check_platformio_upgrade()
|
||||
check_internal_updates(ctx, "platforms")
|
||||
@ -55,10 +57,6 @@ def on_platformio_start(ctx, force, caller):
|
||||
"Please check your Internet connection.", fg="red")
|
||||
|
||||
|
||||
def on_platformio_end(ctx, result): # pylint: disable=W0613
|
||||
pass
|
||||
|
||||
|
||||
def on_platformio_exception(e):
|
||||
telemetry.on_exception(e)
|
||||
|
||||
@ -149,12 +147,13 @@ def after_upgrade(ctx):
|
||||
if not getenv("PLATFORMIO_IDE"):
|
||||
click.echo("- %s PlatformIO IDE for IoT development > %s" % (
|
||||
click.style("try", fg="cyan"),
|
||||
click.style("http://platformio.org/", fg="cyan")
|
||||
click.style("http://platformio.org/#!/platformio-ide", fg="cyan")
|
||||
))
|
||||
if not util.is_ci():
|
||||
click.echo("- %s to keep PlatformIO alive! > %s" % (
|
||||
click.style("donate", fg="cyan"),
|
||||
click.style("http://platformio.org/#!/donate", fg="cyan")
|
||||
))
|
||||
click.echo("- %s to keep PlatformIO alive! > %s" % (
|
||||
click.style("donate", fg="cyan"),
|
||||
click.style("http://platformio.org/donate/", fg="cyan")
|
||||
))
|
||||
|
||||
click.echo("*" * terminal_width)
|
||||
click.echo("")
|
||||
|
@ -103,7 +103,7 @@ class PackageManager(object):
|
||||
except (requests.exceptions.ConnectionError,
|
||||
requests.exceptions.ChunkedEncodingError,
|
||||
exception.FDUnrecognizedStatusCode, StopIteration):
|
||||
if info['url'].startswith("http://sourceforge.net"):
|
||||
if not info['url'].startswith("http://dl.platformio.org"):
|
||||
dlpath = self.download(
|
||||
"http://dl.platformio.org/packages/%s" %
|
||||
basename(info['url']), pkg_dir, info['sha1'])
|
||||
@ -126,7 +126,8 @@ class PackageManager(object):
|
||||
click.secho("Not installed", fg="yellow")
|
||||
return False
|
||||
|
||||
rmtree(join(self._package_dir, name))
|
||||
if isdir(join(self._package_dir, name)):
|
||||
rmtree(join(self._package_dir, name))
|
||||
self._unregister(name)
|
||||
click.echo("[%s]" % click.style("OK", fg="green"))
|
||||
|
||||
|
@ -95,7 +95,7 @@ class MeasurementProtocol(TelemetryBase):
|
||||
|
||||
# gather dependent packages
|
||||
dpdata = []
|
||||
dpdata.append("Click/%s" % click.__version__)
|
||||
dpdata.append("PlatformIO/%s" % __version__)
|
||||
if app.get_session_var("caller_id"):
|
||||
dpdata.append("Caller/%s" % app.get_session_var("caller_id"))
|
||||
if getenv("PLATFORMIO_IDE"):
|
||||
|
@ -14,29 +14,10 @@
|
||||
|
||||
import pytest
|
||||
import requests
|
||||
from os.path import basename
|
||||
|
||||
from platformio.util import get_api_result
|
||||
|
||||
|
||||
@pytest.fixture(scope="session")
|
||||
def sfpkglist():
|
||||
result = None
|
||||
r = None
|
||||
|
||||
try:
|
||||
r = requests.get("http://sourceforge.net/projects"
|
||||
"/platformio-storage/files/packages/list")
|
||||
result = r.json()
|
||||
r.raise_for_status()
|
||||
except:
|
||||
pass
|
||||
finally:
|
||||
if r:
|
||||
r.close()
|
||||
return result
|
||||
|
||||
|
||||
def pytest_generate_tests(metafunc):
|
||||
if "package_data" not in metafunc.fixturenames:
|
||||
return
|
||||
@ -52,39 +33,17 @@ def pytest_generate_tests(metafunc):
|
||||
def validate_response(req):
|
||||
assert req.status_code == 200
|
||||
assert int(req.headers['Content-Length']) > 0
|
||||
assert req.headers['Content-Type'] in ("application/gzip",
|
||||
"application/octet-stream")
|
||||
|
||||
|
||||
def validate_package(url, sfpkglist):
|
||||
r = requests.head(url, allow_redirects=True)
|
||||
validate_response(r)
|
||||
assert r.headers['Content-Type'] in ("application/x-gzip",
|
||||
"application/octet-stream")
|
||||
|
||||
|
||||
def test_package(package_data, sfpkglist):
|
||||
def test_package(package_data):
|
||||
assert package_data['url'].endswith("%d.tar.gz" % package_data['version'])
|
||||
sf_package = "sourceforge.net" in package_data['url']
|
||||
|
||||
# check content type and that file exists
|
||||
try:
|
||||
r = requests.head(package_data['url'], allow_redirects=True)
|
||||
if 500 <= r.status_code <= 599:
|
||||
raise requests.exceptions.ConnectionError()
|
||||
except requests.exceptions.ConnectionError as e:
|
||||
if sf_package:
|
||||
return pytest.skip("SF is off-line")
|
||||
raise Exception(e)
|
||||
|
||||
r = requests.head(package_data['url'], allow_redirects=True)
|
||||
validate_response(r)
|
||||
assert r.headers['Content-Type'] in ("application/x-gzip",
|
||||
"application/octet-stream")
|
||||
|
||||
if not sf_package:
|
||||
return
|
||||
if "X-Checksum-Sha1" not in r.headers:
|
||||
return pytest.skip("X-Checksum-Sha1 is not provided")
|
||||
|
||||
# check sha1 sum
|
||||
if sfpkglist is None:
|
||||
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")
|
||||
assert package_data['sha1'] == r.headers.get("X-Checksum-Sha1")
|
||||
|