diff --git a/HISTORY.rst b/HISTORY.rst index 5120115578..d1137dcc87 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,20 @@ Release History 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 `__ + command + (`issue #273 `_) +* Found solution for "pip/scons error: option --single-version-externally-managed not + recognized" when install PlatformIO using ``pip`` package manager + (`issue #279 `_) +* Fixed `SConsNotInstalled` error for Linux Debian-based distributives + 2.3.1 (2015-09-06) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/faq.rst b/docs/faq.rst index bea8d298bb..d1d7550a60 100644 --- a/docs/faq.rst +++ b/docs/faq.rst @@ -75,6 +75,27 @@ There are a few options: - masking under Continuous Integration system via environment variable :envvar:`CI=true `. +PlatformIO and ``scons`` aren't installed properly +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Try these solutions: + +1. Upgrade SCons via `pip `_ + +.. 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 `_. + .. _faq_troubleshooting_pionotfoundinpath: 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, see `issue #272 `_. -Windows: ``UnicodeDecodeError: 'ascii' codec can't decode byte`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Windows UnicodeDecodeError: 'ascii' codec can't decode byte +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Answered in `issue #143 `_. @@ -118,20 +139,20 @@ Please upgrade *SetupTools* package: .. code-block:: bash - $ [sudo] pip uninstall setuptools - $ [sudo] pip install setuptools + [sudo] pip uninstall setuptools + [sudo] pip install setuptools # Then re-install PlatformIO - $ [sudo] pip uninstall platformio - $ [sudo] pip install platformio + [sudo] pip uninstall 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 `_. -ARM toolchain: ``cc1plus: error while loading shared libraries`` -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +ARM toolchain: cc1plus: error while loading shared libraries +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ See related answers for `error while loading shared libraries `_. diff --git a/docs/installation.rst b/docs/installation.rst index 939994937f..8d071240d1 100644 --- a/docs/installation.rst +++ b/docs/installation.rst @@ -49,9 +49,12 @@ The latest stable version of PlatformIO may be done via # update dependent packages to the latest versions pip install -U pip setuptools - # install the latest version of PlatformIO + # install/upgrade the latest version of 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 a few options here: @@ -61,6 +64,8 @@ a few options here: * Run the command in a `virtualenv `_ local to a specific project working set. +.. _installation_installer_script: + Installer Script ~~~~~~~~~~~~~~~~ @@ -134,9 +139,6 @@ For upgrading ``platformio`` to the latest version: Development Version ~~~~~~~~~~~~~~~~~~~ -.. warning:: - We don't recommend to use ``develop`` version in production. - Install the latest PlatformIO from the ``develop`` branch: .. code-block:: bash @@ -163,4 +165,5 @@ Troubleshooting **Windows OS**: Please check that you have correctly installed USB driver 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`. diff --git a/docs/projectconf.rst b/docs/projectconf.rst index a3641e5cb8..da5fb058ae 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -475,39 +475,7 @@ Examples targets = upload -2. :ref:`platform_atmelavr`: Microduino Core (ATmega168P, 3.3V) board 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 +2. :ref:`platform_atmelavr`: Embedded board that is based on ATmega168 MCU with "arduino" bootloader .. code-block:: ini @@ -527,7 +495,7 @@ Examples 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 .. code-block:: ini @@ -536,44 +504,25 @@ Examples platform = atmelavr framework = arduino board = pro8MHzatmega328 - upload_protocol = usbasp -B5 + upload_protocol = usbasp - B5 -6. :ref:`platform_timsp430`: TI MSP430G2553 LaunchPad with auto pre-configured - ``board_*`` and ``upload_*`` options (use only ``board`` option) and Energia - Wiring-based Framework +4. :ref:`platform_ststm32`: Upload firmware using GDB script ``upload.gdb``, + `issue #175 `_ .. code-block:: ini - [env:timsp430_g2553_launchpad] - platform = timsp430 - framework = energia - board = lpmsp430g2553 + [env:st_via_gdb] + platform = ststm32 + board = armstrap_eagle512 + upload_protocol = gdb - -7. :ref:`platform_timsp430`: Embedded board that is based on MSP430G2553 MCU +5. :ref:`platform_ststm32`: Upload firmware using ST-Link instead mbed's media + disk .. code-block:: ini - [env:timsp430_g2553_board] - platform = timsp430 - board_mcu = msp430g2553 - board_f_cpu = 16000000L - - 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 - + [env:stlink_for_mbed] + platform = ststm32 + board = disco_f100rb + upload_protocol = stlink diff --git a/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt b/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/atmelavr-and-arduino/adafruit-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/atmelavr-and-arduino/arduino-external-libs/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/atmelavr-and-arduino/arduino-internal-libs/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt b/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/atmelavr-and-arduino/arduino-own-src_dir/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt b/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/atmelavr-and-arduino/atmelavr-native-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt b/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/atmelavr-and-arduino/digitstump-mouse/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt b/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/atmelavr-and-arduino/engduino-magnetometer/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt b/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/atmelavr-and-arduino/panstamp-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/desktop/hello-world/lib/readme.txt b/examples/desktop/hello-world/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/desktop/hello-world/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/espressif/esp8266-native/lib/readme.txt b/examples/espressif/esp8266-native/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/espressif/esp8266-native/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/espressif/esp8266-webserver/lib/readme.txt b/examples/espressif/esp8266-webserver/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/espressif/esp8266-webserver/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/espressif/esp8266-wifiscan/lib/readme.txt b/examples/espressif/esp8266-wifiscan/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/espressif/esp8266-wifiscan/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/ide/clion/lib/readme.txt b/examples/ide/clion/lib/readme.txt index 413c26e526..b06c94085a 100644 --- a/examples/ide/clion/lib/readme.txt +++ b/examples/ide/clion/lib/readme.txt @@ -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. -The source code of each library should be placed in separate directory. -For example, "lib/private_lib/[here are source files]". +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 +#include + +// 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 + diff --git a/examples/ide/eclipse/lib/readme.txt b/examples/ide/eclipse/lib/readme.txt index 413c26e526..b06c94085a 100644 --- a/examples/ide/eclipse/lib/readme.txt +++ b/examples/ide/eclipse/lib/readme.txt @@ -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. -The source code of each library should be placed in separate directory. -For example, "lib/private_lib/[here are source files]". +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 +#include + +// 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 + diff --git a/examples/ide/qtcreator/lib/readme.txt b/examples/ide/qtcreator/lib/readme.txt index 413c26e526..b06c94085a 100644 --- a/examples/ide/qtcreator/lib/readme.txt +++ b/examples/ide/qtcreator/lib/readme.txt @@ -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. -The source code of each library should be placed in separate directory. -For example, "lib/private_lib/[here are source files]". +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 +#include + +// 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 + diff --git a/examples/ide/sublimetext/lib/readme.txt b/examples/ide/sublimetext/lib/readme.txt index 413c26e526..b06c94085a 100644 --- a/examples/ide/sublimetext/lib/readme.txt +++ b/examples/ide/sublimetext/lib/readme.txt @@ -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. -The source code of each library should be placed in separate directory. -For example, "lib/private_lib/[here are source files]". +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 +#include + +// 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 + diff --git a/examples/ide/visualstudio/lib/readme.txt b/examples/ide/visualstudio/lib/readme.txt index fa10918bbe..b06c94085a 100644 --- a/examples/ide/visualstudio/lib/readme.txt +++ b/examples/ide/visualstudio/lib/readme.txt @@ -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. - -The source code of each library should be placed in separate directory. -For example, "lib/private_lib/[here are source files]". + +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 +#include + +// 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 + diff --git a/examples/mbed/mbed-blink/lib/readme.txt b/examples/mbed/mbed-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/mbed/mbed-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/mbed/mbed-dsp/lib/readme.txt b/examples/mbed/mbed-dsp/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/mbed/mbed-dsp/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/mbed/mbed-http-client/lib/readme.txt b/examples/mbed/mbed-http-client/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/mbed/mbed-http-client/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/mbed/mbed-rtos/lib/readme.txt b/examples/mbed/mbed-rtos/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/mbed/mbed-rtos/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/mbed/mbed-serial/lib/readme.txt b/examples/mbed/mbed-serial/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/mbed/mbed-serial/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/stm32/stm32-cmsis-blink/lib/readme.txt b/examples/stm32/stm32-cmsis-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/stm32/stm32-cmsis-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/stm32/stm32-opencm3-blink/lib/readme.txt b/examples/stm32/stm32-opencm3-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/stm32/stm32-opencm3-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/stm32/stm32-spl-blink/lib/readme.txt b/examples/stm32/stm32-spl-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/stm32/stm32-spl-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt b/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/teensy/teensy-hid-usb-mouse/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/teensy/teensy-internal-libs/lib/readme.txt b/examples/teensy/teensy-internal-libs/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/teensy/teensy-internal-libs/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/timsp430/panstamp-blink/lib/readme.txt b/examples/timsp430/panstamp-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/timsp430/panstamp-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/timsp430/timsp430-energia-blink/lib/readme.txt b/examples/timsp430/timsp430-energia-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/timsp430/timsp430-energia-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/timsp430/timsp430-native-blink/lib/readme.txt b/examples/timsp430/timsp430-native-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/timsp430/timsp430-native-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/titiva/titiva-energia-blink/lib/readme.txt b/examples/titiva/titiva-energia-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/titiva/titiva-energia-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/titiva/titiva-native-blink/lib/readme.txt b/examples/titiva/titiva-native-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/titiva/titiva-native-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/titiva/titiva-opencm3-blink/lib/readme.txt b/examples/titiva/titiva-opencm3-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/titiva/titiva-opencm3-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/examples/wiring-blink/lib/readme.txt b/examples/wiring-blink/lib/readme.txt new file mode 100644 index 0000000000..b06c94085a --- /dev/null +++ b/examples/wiring-blink/lib/readme.txt @@ -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 +#include + +// 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 + diff --git a/platformio/__init__.py b/platformio/__init__.py index 3531ec67af..90f3918563 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -1,7 +1,7 @@ # Copyright (C) Ivan Kravets # See LICENSE for details. -VERSION = (2, 3, 1) +VERSION = (2, 3, 2) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/__main__.py b/platformio/__main__.py index d667429771..011f85497f 100644 --- a/platformio/__main__.py +++ b/platformio/__main__.py @@ -3,6 +3,7 @@ from os import listdir from os.path import join +from platform import system from sys import exit as sys_exit from traceback import format_exc @@ -70,6 +71,9 @@ def process_result(ctx, result, force, caller): # pylint: disable=W0613 def main(): try: + if "cygwin" in system().lower(): + raise exception.CygwinEnvDetected() + # https://urllib3.readthedocs.org # /en/latest/security.html#insecureplatformwarning try: diff --git a/platformio/builder/main.py b/platformio/builder/main.py index 0dd206f3f2..4495e15b1b 100644 --- a/platformio/builder/main.py +++ b/platformio/builder/main.py @@ -6,13 +6,16 @@ except ImportError: import sys for p in sys.path: - _new_path = None - if not p.endswith("site-packages") and "site-packages" in p: - _new_path = p[:p.rfind("site-packages") + 13] - elif "platformio" in p: - _new_path = p[:p.rfind("platformio") - 1] - if _new_path and _new_path not in sys.path: - sys.path.insert(0, _new_path) + _new_paths = [] + for item in ("dist-packages", "site-packages"): + if not p.endswith(item) and item in p: + _new_paths.append(p[:p.rfind(item) + len(item)]) + if "platformio" in p: + _new_paths.append(p[:p.rfind("platformio") - 1]) + + for _p in _new_paths: + if _p not in sys.path: + sys.path.insert(0, _p) try: from platformio import util break diff --git a/platformio/builder/scripts/ststm32.py b/platformio/builder/scripts/ststm32.py index aeff2818d2..d9e7f6f53a 100644 --- a/platformio/builder/scripts/ststm32.py +++ b/platformio/builder/scripts/ststm32.py @@ -15,7 +15,7 @@ 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")): Exit( "You are using GDB as firmware uploader. " @@ -50,7 +50,8 @@ env.Append( CPPDEFINES=[ - "${BOARD_OPTIONS['build']['variant'].upper()}" + env.get("BOARD_OPTIONS", {}).get( + "build", {}).get("variant", "").upper() ], LIBS=["stdc++", "nosys"], @@ -87,8 +88,9 @@ # Target: Upload by default .bin file # -disable_msd = (platform.system() == "Darwin" and - platform.release().startswith("14.")) +disable_msd = ( + (platform.system() == "Darwin" and platform.release().startswith("14.")) or + env.subst("$UPLOAD_PROTOCOL")) if "mbed" in env.subst("$FRAMEWORK") and not disable_msd: upload = env.Alias(["upload", "uploadlazy"], target_firm, env.UploadToDisk) diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index ddd82e2582..4a416c097d 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -2,14 +2,13 @@ # See LICENSE for details. from os.path import join -from platform import system from shutil import copyfile from time import sleep from SCons.Script import Exit 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): @@ -24,7 +23,7 @@ def FlushSerialBuffer(env, port): def TouchSerialPort(env, port, baudrate): - if system() == "Linux": + if "windows" not in get_systype(): try: s = Serial(env.subst(port)) s.close() diff --git a/platformio/commands/boards.py b/platformio/commands/boards.py index 0681623ae2..dcec8f6995 100644 --- a/platformio/commands/boards.py +++ b/platformio/commands/boards.py @@ -56,7 +56,10 @@ def cli(query, json_output): # pylint: disable=R0912 if "maximum_ram_size" in data.get("upload", None): ram_size = int(data['upload']['maximum_ram_size']) 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: ram_size = "%dB" % ram_size diff --git a/platformio/commands/init.py b/platformio/commands/init.py index eac1e7c01b..319f79b3ed 100644 --- a/platformio/commands/init.py +++ b/platformio/commands/init.py @@ -85,13 +85,43 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913 if not isfile(join(lib_dir, "readme.txt")): with open(join(lib_dir, "readme.txt"), "w") as f: f.write(""" -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. -The source code of each library should be placed in separate directory. -For example, "lib/private_lib/[here are source files]". +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 +#include + +// 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): diff --git a/platformio/commands/serialports.py b/platformio/commands/serialports.py index 2e1571101a..f4232a1bc5 100644 --- a/platformio/commands/serialports.py +++ b/platformio/commands/serialports.py @@ -81,4 +81,4 @@ def serialports_monitor(**kwargs): try: miniterm.main() except Exception as e: # pylint: disable=W0702 - raise MinitermException("Miniterm: %s" % e) + raise MinitermException(e) diff --git a/platformio/commands/upgrade.py b/platformio/commands/upgrade.py index 1140b096a0..dbfbee8655 100644 --- a/platformio/commands/upgrade.py +++ b/platformio/commands/upgrade.py @@ -42,7 +42,7 @@ def cli(): fg="cyan") except (OSError, AssertionError) as e: if not r: - raise exception.PlatformioException( + raise exception.PlatformioUpgradeError( "\n".join([str(cmd), str(e)])) if ("Permission denied" in r['err'] and "windows" not in util.get_systype()): @@ -58,7 +58,7 @@ def cli(): """, fg="yellow", err=True) raise exception.ReturnErrorCode() else: - raise exception.PlatformioException( + raise exception.PlatformioUpgradeError( "\n".join([str(cmd), r['out'], r['err']])) diff --git a/platformio/exception.py b/platformio/exception.py index 233e591a8f..ce26801887 100644 --- a/platformio/exception.py +++ b/platformio/exception.py @@ -182,6 +182,25 @@ class SConsNotInstalled(PlatformioException): MESSAGE = ( "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" ) + + +class CygwinEnvDetected(PlatformioException): + + MESSAGE = ( + "PlatformIO does not work within Cygwin environment. " + "Use native Terminal instead." + ) diff --git a/platformio/platforms/base.py b/platformio/platforms/base.py index 6a71da0a93..ddc21a5b1b 100644 --- a/platformio/platforms/base.py +++ b/platformio/platforms/base.py @@ -4,6 +4,7 @@ import os import re import sys +from glob import glob from imp import load_source from os.path import isdir, isfile, join @@ -400,6 +401,22 @@ def run(self, variables, targets, verbose): def test_scons(): try: 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 return True except (OSError, AssertionError): diff --git a/platformio/util.py b/platformio/util.py index 6fb9597ebc..f9ba07f98f 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -113,10 +113,9 @@ def get_instance(*args, **kwargs): def get_systype(): data = uname() - systype = data[0] - if data[4]: - systype += "_" + data[4] - return systype.lower() + type_ = data[0].lower() + arch = data[4].lower() if data[4] else "" + return "%s_%s" % (type_, arch) if arch else type_ def pioversion_to_intstr(): diff --git a/scripts/get-platformio.py b/scripts/get-platformio.py index bcab3d14cb..1fad5117e8 100644 --- a/scripts/get-platformio.py +++ b/scripts/get-platformio.py @@ -97,7 +97,7 @@ def main(): ("Fixing Windows %PATH% Environment", fix_winpython_pathenv, []), ("Installing Python Package Manager", install_pip, []), ("Installing PlatformIO and dependencies", install_pypi_packages, - [["setuptools", "platformio"]]) + [["setuptools", "virtualenv", "platformio"]]) ] if not IS_WINDOWS: diff --git a/setup.py b/setup.py index fcf664e2f0..668ada4a52 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ install_requires=[ "bottle", "click>=3.2", - "lockfile", + "lockfile>=0.9.1", "pyserial", "requests>=2.4.0", "SCons"