Merge branch 'release/v2.3.2'

This commit is contained in:
Ivan Kravets
2015-09-10 20:44:53 +03:00
52 changed files with 1450 additions and 135 deletions

View File

@ -4,6 +4,20 @@ Release History
PlatformIO 2.0 PlatformIO 2.0
-------------- --------------
2.3.2 (2015-09-10)
~~~~~~~~~~~~~~~~~~
* Allowed to use ST-Link uploader for mbed-based projects
* Explained how to use ``lib`` directory from the PlatformIO based project in
``readme.txt`` which will be automatically generated using
`platformio init <http://docs.platformio.org/en/latest/userguide/cmd_init.html>`__
command
(`issue #273 <https://github.com/platformio/platformio/issues/273>`_)
* Found solution for "pip/scons error: option --single-version-externally-managed not
recognized" when install PlatformIO using ``pip`` package manager
(`issue #279 <https://github.com/platformio/platformio/issues/279>`_)
* Fixed `SConsNotInstalled` error for Linux Debian-based distributives
2.3.1 (2015-09-06) 2.3.1 (2015-09-06)
~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~

View File

@ -75,6 +75,27 @@ There are a few options:
- masking under Continuous Integration system via environment variable - masking under Continuous Integration system via environment variable
:envvar:`CI=true <CI>`. :envvar:`CI=true <CI>`.
PlatformIO and ``scons`` aren't installed properly
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Try these solutions:
1. Upgrade SCons via `pip <https://pip.pypa.io>`_
.. code-block:: bash
[sudo] pip uninstall scons
[sudo] pip install scons
2. Install PlatformIO using :ref:`installation_installer_script`.
.. _faq_troubleshooting_sconssingverextmanaged:
PIP & SCons Error: option --single-version-externally-managed not recognized
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Answered in `issue #279 <https://github.com/platformio/platformio/issues/279>`_.
.. _faq_troubleshooting_pionotfoundinpath: .. _faq_troubleshooting_pionotfoundinpath:
Program ``platformio`` not found in PATH Program ``platformio`` not found in PATH
@ -100,8 +121,8 @@ should contain ``/usr/local/bin`` directory.
programs to the ``bin`` directory which is included in ``$PATH``. For example, programs to the ``bin`` directory which is included in ``$PATH``. For example,
see `issue #272 <https://github.com/platformio/platformio/issues/272#issuecomment-133626112>`_. see `issue #272 <https://github.com/platformio/platformio/issues/272#issuecomment-133626112>`_.
Windows: ``UnicodeDecodeError: 'ascii' codec can't decode byte`` Windows UnicodeDecodeError: 'ascii' codec can't decode byte
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Answered in `issue #143 <https://github.com/platformio/platformio/issues/143#issuecomment-88060906>`_. Answered in `issue #143 <https://github.com/platformio/platformio/issues/143#issuecomment-88060906>`_.
@ -118,20 +139,20 @@ Please upgrade *SetupTools* package:
.. code-block:: bash .. code-block:: bash
$ [sudo] pip uninstall setuptools [sudo] pip uninstall setuptools
$ [sudo] pip install setuptools [sudo] pip install setuptools
# Then re-install PlatformIO # Then re-install PlatformIO
$ [sudo] pip uninstall platformio [sudo] pip uninstall platformio
$ [sudo] pip install platformio [sudo] pip install platformio
Windows: ``AttributeError: 'module' object has no attribute 'packages'`` Windows AttributeError: 'module' object has no attribute 'packages'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Answered in `issue #252 <https://github.com/platformio/platformio/issues/252#issuecomment-127072039>`_. Answered in `issue #252 <https://github.com/platformio/platformio/issues/252#issuecomment-127072039>`_.
ARM toolchain: ``cc1plus: error while loading shared libraries`` ARM toolchain: cc1plus: error while loading shared libraries
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
See related answers for See related answers for
`error while loading shared libraries <https://github.com/platformio/platformio/issues?utf8=✓&q=error+while+loading+shared+libraries>`_. `error while loading shared libraries <https://github.com/platformio/platformio/issues?utf8=✓&q=error+while+loading+shared+libraries>`_.

View File

@ -49,9 +49,12 @@ The latest stable version of PlatformIO may be done via
# update dependent packages to the latest versions # update dependent packages to the latest versions
pip install -U pip setuptools pip install -U pip setuptools
# install the latest version of PlatformIO # install/upgrade the latest version of PlatformIO
pip install -U platformio pip install -U platformio
.. warning::
Known Issue: :ref:`faq_troubleshooting_sconssingverextmanaged`
Note that you may run into permissions issues running these commands. You have Note that you may run into permissions issues running these commands. You have
a few options here: a few options here:
@ -61,6 +64,8 @@ a few options here:
* Run the command in a `virtualenv <https://virtualenv.pypa.io>`_ local to a * Run the command in a `virtualenv <https://virtualenv.pypa.io>`_ local to a
specific project working set. specific project working set.
.. _installation_installer_script:
Installer Script Installer Script
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
@ -134,9 +139,6 @@ For upgrading ``platformio`` to the latest version:
Development Version Development Version
~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~
.. warning::
We don't recommend to use ``develop`` version in production.
Install the latest PlatformIO from the ``develop`` branch: Install the latest PlatformIO from the ``develop`` branch:
.. code-block:: bash .. code-block:: bash
@ -163,4 +165,5 @@ Troubleshooting
**Windows OS**: Please check that you have correctly installed USB driver **Windows OS**: Please check that you have correctly installed USB driver
from board manufacturer from board manufacturer
For further details, frequently questions, please refer to :ref:`faq`. For further details, frequently questions, known issues, please
refer to :ref:`faq`.

View File

@ -475,39 +475,7 @@ Examples
targets = upload targets = upload
2. :ref:`platform_atmelavr`: Microduino Core (ATmega168P, 3.3V) board with 2. :ref:`platform_atmelavr`: Embedded board that is based on ATmega168 MCU with
auto pre-configured ``board_*`` and ``upload_*`` options (use only
``board`` option) and Arduino Wiring-based Framework
.. code-block:: ini
[env:atmelavr_microduino_core_board]
platform = atmelavr
framework = arduino
board = 168pa8m
# enable auto-uploading
targets = upload
3. :ref:`platform_atmelavr`: Raspduino board with
auto pre-configured ``board_*`` and ``upload_*`` options (use only
``board`` option) and Arduino Wiring-based Framework
.. code-block:: ini
[env:atmelavr_raspduino_board]
platform = atmelavr
framework = arduino
board = raspduino
upload_port = /dev/ttyS0
# enable auto-uploading
targets = upload
4. :ref:`platform_atmelavr`: Embedded board that is based on ATmega168 MCU with
"arduino" bootloader "arduino" bootloader
.. code-block:: ini .. code-block:: ini
@ -527,7 +495,7 @@ Examples
targets = upload targets = upload
5. Upload firmware via USB programmer (USBasp) to :ref:`platform_atmelavr` 3. Upload firmware via USB programmer (USBasp) to :ref:`platform_atmelavr`
microcontrollers microcontrollers
.. code-block:: ini .. code-block:: ini
@ -536,44 +504,25 @@ Examples
platform = atmelavr platform = atmelavr
framework = arduino framework = arduino
board = pro8MHzatmega328 board = pro8MHzatmega328
upload_protocol = usbasp -B5 upload_protocol = usbasp - B5
6. :ref:`platform_timsp430`: TI MSP430G2553 LaunchPad with auto pre-configured 4. :ref:`platform_ststm32`: Upload firmware using GDB script ``upload.gdb``,
``board_*`` and ``upload_*`` options (use only ``board`` option) and Energia `issue #175 <https://github.com/platformio/platformio/issues/175>`_
Wiring-based Framework
.. code-block:: ini .. code-block:: ini
[env:timsp430_g2553_launchpad] [env:st_via_gdb]
platform = timsp430 platform = ststm32
framework = energia board = armstrap_eagle512
board = lpmsp430g2553 upload_protocol = gdb
5. :ref:`platform_ststm32`: Upload firmware using ST-Link instead mbed's media
7. :ref:`platform_timsp430`: Embedded board that is based on MSP430G2553 MCU disk
.. code-block:: ini .. code-block:: ini
[env:timsp430_g2553_board] [env:stlink_for_mbed]
platform = timsp430 platform = ststm32
board_mcu = msp430g2553 board = disco_f100rb
board_f_cpu = 16000000L upload_protocol = stlink
upload_protocol = rf2500
# enable auto-uploading
targets = upload
8. :ref:`platform_titiva`: TI Tiva C ARM Series TM4C123G LaunchPad with auto
pre-configured ``board_*`` and ``upload_*`` options (use only ``board``
option) and Energia Wiring-based Framework
.. code-block:: ini
[env:titiva_tm4c1230c3pm_launchpad]
platform = titiva
framework = energia
board = lptm4c1230c3pm

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -1,8 +1,38 @@
Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html
This directory is intended for the project specific (private) libraries. This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file. PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory. The source code of each library should be placed in separate directory, like
For example, "lib/private_lib/[here are source files]". "lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -1,8 +1,38 @@
Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html
This directory is intended for the project specific (private) libraries. This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file. PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory. The source code of each library should be placed in separate directory, like
For example, "lib/private_lib/[here are source files]". "lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -1,8 +1,38 @@
Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html
This directory is intended for the project specific (private) libraries. This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file. PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory. The source code of each library should be placed in separate directory, like
For example, "lib/private_lib/[here are source files]". "lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -1,8 +1,38 @@
Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html
This directory is intended for the project specific (private) libraries. This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file. PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory. The source code of each library should be placed in separate directory, like
For example, "lib/private_lib/[here are source files]". "lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -1,8 +1,38 @@
Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file. The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
The source code of each library should be placed in separate directory.
For example, "lib/private_lib/[here are source files]". For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -0,0 +1,38 @@
This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory, like
"lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install

View File

@ -1,7 +1,7 @@
# Copyright (C) Ivan Kravets <me@ikravets.com> # Copyright (C) Ivan Kravets <me@ikravets.com>
# See LICENSE for details. # See LICENSE for details.
VERSION = (2, 3, 1) VERSION = (2, 3, 2)
__version__ = ".".join([str(s) for s in VERSION]) __version__ = ".".join([str(s) for s in VERSION])
__title__ = "platformio" __title__ = "platformio"

View File

@ -3,6 +3,7 @@
from os import listdir from os import listdir
from os.path import join from os.path import join
from platform import system
from sys import exit as sys_exit from sys import exit as sys_exit
from traceback import format_exc from traceback import format_exc
@ -70,6 +71,9 @@ def process_result(ctx, result, force, caller): # pylint: disable=W0613
def main(): def main():
try: try:
if "cygwin" in system().lower():
raise exception.CygwinEnvDetected()
# https://urllib3.readthedocs.org # https://urllib3.readthedocs.org
# /en/latest/security.html#insecureplatformwarning # /en/latest/security.html#insecureplatformwarning
try: try:

View File

@ -6,13 +6,16 @@ try:
except ImportError: except ImportError:
import sys import sys
for p in sys.path: for p in sys.path:
_new_path = None _new_paths = []
if not p.endswith("site-packages") and "site-packages" in p: for item in ("dist-packages", "site-packages"):
_new_path = p[:p.rfind("site-packages") + 13] if not p.endswith(item) and item in p:
elif "platformio" in p: _new_paths.append(p[:p.rfind(item) + len(item)])
_new_path = p[:p.rfind("platformio") - 1] if "platformio" in p:
if _new_path and _new_path not in sys.path: _new_paths.append(p[:p.rfind("platformio") - 1])
sys.path.insert(0, _new_path)
for _p in _new_paths:
if _p not in sys.path:
sys.path.insert(0, _p)
try: try:
from platformio import util from platformio import util
break break

View File

@ -15,7 +15,7 @@ env = DefaultEnvironment()
SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py"))) SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts", "basearm.py")))
if env['UPLOAD_PROTOCOL'] == "gdb": if env.subst("$UPLOAD_PROTOCOL") == "gdb":
if not isfile(join(env.subst("$PROJECT_DIR"), "upload.gdb")): if not isfile(join(env.subst("$PROJECT_DIR"), "upload.gdb")):
Exit( Exit(
"You are using GDB as firmware uploader. " "You are using GDB as firmware uploader. "
@ -50,7 +50,8 @@ else:
env.Append( env.Append(
CPPDEFINES=[ CPPDEFINES=[
"${BOARD_OPTIONS['build']['variant'].upper()}" env.get("BOARD_OPTIONS", {}).get(
"build", {}).get("variant", "").upper()
], ],
LIBS=["stdc++", "nosys"], LIBS=["stdc++", "nosys"],
@ -87,8 +88,9 @@ AlwaysBuild(target_size)
# Target: Upload by default .bin file # Target: Upload by default .bin file
# #
disable_msd = (platform.system() == "Darwin" and disable_msd = (
platform.release().startswith("14.")) (platform.system() == "Darwin" and platform.release().startswith("14.")) or
env.subst("$UPLOAD_PROTOCOL"))
if "mbed" in env.subst("$FRAMEWORK") and not disable_msd: if "mbed" in env.subst("$FRAMEWORK") and not disable_msd:
upload = env.Alias(["upload", "uploadlazy"], upload = env.Alias(["upload", "uploadlazy"],
target_firm, env.UploadToDisk) target_firm, env.UploadToDisk)

View File

@ -2,14 +2,13 @@
# See LICENSE for details. # See LICENSE for details.
from os.path import join from os.path import join
from platform import system
from shutil import copyfile from shutil import copyfile
from time import sleep from time import sleep
from SCons.Script import Exit from SCons.Script import Exit
from serial import Serial from serial import Serial
from platformio.util import get_logicaldisks, get_serialports from platformio.util import get_logicaldisks, get_serialports, get_systype
def FlushSerialBuffer(env, port): def FlushSerialBuffer(env, port):
@ -24,7 +23,7 @@ def FlushSerialBuffer(env, port):
def TouchSerialPort(env, port, baudrate): def TouchSerialPort(env, port, baudrate):
if system() == "Linux": if "windows" not in get_systype():
try: try:
s = Serial(env.subst(port)) s = Serial(env.subst(port))
s.close() s.close()

View File

@ -56,7 +56,10 @@ def cli(query, json_output): # pylint: disable=R0912
if "maximum_ram_size" in data.get("upload", None): if "maximum_ram_size" in data.get("upload", None):
ram_size = int(data['upload']['maximum_ram_size']) ram_size = int(data['upload']['maximum_ram_size'])
if ram_size >= 1024: if ram_size >= 1024:
ram_size = "%dKb" % (ram_size / 1024) if ram_size % 1024:
ram_size = "%.1fKb" % (ram_size / 1024.0)
else:
ram_size = "%dKb" % (ram_size / 1024)
else: else:
ram_size = "%dB" % ram_size ram_size = "%dB" % ram_size

View File

@ -85,13 +85,43 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
if not isfile(join(lib_dir, "readme.txt")): if not isfile(join(lib_dir, "readme.txt")):
with open(join(lib_dir, "readme.txt"), "w") as f: with open(join(lib_dir, "readme.txt"), "w") as f:
f.write(""" f.write("""
Documentation: http://docs.platformio.org/en/latest/userguide/cmd_init.html
This directory is intended for the project specific (private) libraries. This directory is intended for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file. PlatformIO will compile them to static libraries and link to executable file.
The source code of each library should be placed in separate directory. The source code of each library should be placed in separate directory, like
For example, "lib/private_lib/[here are source files]". "lib/private_lib/[here are source files]".
For example, see how can be organised `Foo` and `Bar` libraries:
|--lib
| |--Bar
| | |--docs
| | |--examples
| | |--src
| | |- Bar.c
| | |- Bar.h
| |--Foo
| | |- Foo.c
| | |- Foo.h
| |- readme.txt --> THIS FILE
|- platformio.ini
|--src
|- main.c
Then in `src/main.c` you should use:
#include <Foo.h>
#include <Bar.h>
// rest H/C/CPP code
PlatformIO will find your libraries automatically, configure preprocessor's
include paths and build them.
See additional options for PlatformIO Library Dependency Finder `lib_*`:
http://docs.platformio.org/en/latest/projectconf.html#lib-install
""") """)
if not isfile(project_file): if not isfile(project_file):

View File

@ -81,4 +81,4 @@ def serialports_monitor(**kwargs):
try: try:
miniterm.main() miniterm.main()
except Exception as e: # pylint: disable=W0702 except Exception as e: # pylint: disable=W0702
raise MinitermException("Miniterm: %s" % e) raise MinitermException(e)

View File

@ -42,7 +42,7 @@ def cli():
fg="cyan") fg="cyan")
except (OSError, AssertionError) as e: except (OSError, AssertionError) as e:
if not r: if not r:
raise exception.PlatformioException( raise exception.PlatformioUpgradeError(
"\n".join([str(cmd), str(e)])) "\n".join([str(cmd), str(e)]))
if ("Permission denied" in r['err'] and if ("Permission denied" in r['err'] and
"windows" not in util.get_systype()): "windows" not in util.get_systype()):
@ -58,7 +58,7 @@ WARNING! Don't use `sudo` for the rest PlatformIO commands.
""", fg="yellow", err=True) """, fg="yellow", err=True)
raise exception.ReturnErrorCode() raise exception.ReturnErrorCode()
else: else:
raise exception.PlatformioException( raise exception.PlatformioUpgradeError(
"\n".join([str(cmd), r['out'], r['err']])) "\n".join([str(cmd), r['out'], r['err']]))

View File

@ -182,6 +182,25 @@ class SConsNotInstalled(PlatformioException):
MESSAGE = ( MESSAGE = (
"The PlatformIO and `scons` aren't installed properly. " "The PlatformIO and `scons` aren't installed properly. "
"Please use official installation manual: " "More details in FAQ/Troubleshooting section: "
"http://docs.platformio.org/en/latest/faq.html"
)
class PlatformioUpgradeError(PlatformioException):
MESSAGE = (
"%s \n\n"
"1. Please report this issue here: "
"https://github.com/platformio/platformio/issues \n"
"2. Try different installation/upgrading steps: "
"http://docs.platformio.org/en/latest/installation.html" "http://docs.platformio.org/en/latest/installation.html"
) )
class CygwinEnvDetected(PlatformioException):
MESSAGE = (
"PlatformIO does not work within Cygwin environment. "
"Use native Terminal instead."
)

View File

@ -4,6 +4,7 @@
import os import os
import re import re
import sys import sys
from glob import glob
from imp import load_source from imp import load_source
from os.path import isdir, isfile, join from os.path import isdir, isfile, join
@ -400,6 +401,22 @@ class BasePlatform(object):
def test_scons(): def test_scons():
try: try:
r = util.exec_command(["scons", "--version"]) r = util.exec_command(["scons", "--version"])
if "ImportError: No module named SCons.Script" in r['err']:
_PYTHONPATH = []
for p in sys.path:
if not p.endswith("-packages"):
continue
for item in glob(join(p, "scons*")):
if isdir(join(item, "SCons")) and item not in sys.path:
_PYTHONPATH.append(item)
sys.path.insert(0, item)
if _PYTHONPATH:
_PYTHONPATH = str(os.pathsep).join(_PYTHONPATH)
if os.getenv("PYTHONPATH"):
os.environ['PYTHONPATH'] += os.pathsep + _PYTHONPATH
else:
os.environ['PYTHONPATH'] = _PYTHONPATH
r = util.exec_command(["scons", "--version"])
assert r['returncode'] == 0 assert r['returncode'] == 0
return True return True
except (OSError, AssertionError): except (OSError, AssertionError):

View File

@ -113,10 +113,9 @@ def singleton(cls):
def get_systype(): def get_systype():
data = uname() data = uname()
systype = data[0] type_ = data[0].lower()
if data[4]: arch = data[4].lower() if data[4] else ""
systype += "_" + data[4] return "%s_%s" % (type_, arch) if arch else type_
return systype.lower()
def pioversion_to_intstr(): def pioversion_to_intstr():

View File

@ -97,7 +97,7 @@ def main():
("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []), ("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []),
("Installing Python Package Manager", install_pip, []), ("Installing Python Package Manager", install_pip, []),
("Installing PlatformIO and dependencies", install_pypi_packages, ("Installing PlatformIO and dependencies", install_pypi_packages,
[["setuptools", "platformio"]]) [["setuptools", "virtualenv", "platformio"]])
] ]
if not IS_WINDOWS: if not IS_WINDOWS:

View File

@ -20,7 +20,7 @@ setup(
install_requires=[ install_requires=[
"bottle", "bottle",
"click>=3.2", "click>=3.2",
"lockfile", "lockfile>=0.9.1",
"pyserial", "pyserial",
"requests>=2.4.0", "requests>=2.4.0",
"SCons" "SCons"