Compare commits

..

43 Commits

Author SHA1 Message Date
Ivan Kravets
c4a4dcd419 Merge branch 'release/v2.3.4' 2015-10-13 18:40:46 +01:00
Ivan Kravets
b7d2619651 Version bump to 2.3.4 (issues #132, #279, #290, #302, #305, #306) 2015-10-13 18:40:23 +01:00
Ivan Kravets
c07e957e28 Fix FAQ doc 2015-10-13 18:36:37 +01:00
Ivan Kravets
b183431c27 Install SCons automatically and avoid error: option --single-version-externally-managed not recognized 2015-10-13 18:24:40 +01:00
Ivan Kravets
177353bf7a PlatformIO command completion in Terminal for bash and zsh // Resolve #290 2015-10-13 17:44:28 +01:00
Ivan Kravets
de2d6818c1 Full support of CLion IDE including code auto-completion // Resolve #132 2015-10-13 14:01:16 +01:00
Ivan Kravets
f758d8607a Use teensy CLI loader for upload of .hex files on OSX // Resolve #306 2015-10-12 16:29:24 +01:00
Ivan Kravets
1164ef31ca Fix missing of framework-mbed package for teensy platform // Resolve #305 2015-10-12 13:24:42 +01:00
Ivan Kravets
20edf7de41 Add support for @ubIQio Ardhat board // Resolve #302 2015-10-10 11:35:01 +01:00
Ivan Kravets
7467c281cc Add support for @ubIQio Ardhat board 2015-10-10 11:33:38 +01:00
Ivan Kravets
3b8d7304ff Propose upgrading via pip 2015-10-09 14:12:30 +01:00
Ivan Kravets
6e274cbf20 Correct social links 2015-10-08 16:59:12 +01:00
Ivan Kravets
3a0614641b Add links for Hackaday 2015-10-08 16:50:47 +01:00
Ivan Kravets
c395dd5ebd Update requests to 2.8.0 2015-10-07 11:57:46 +01:00
Ivan Kravets
1c9dc2ba3d Handle WindowsError when can't remove .pioenvs directory 2015-10-06 17:06:47 +01:00
Ivan Kravets
52b98dd159 Add "Commands completion in Terminal" 2015-10-04 15:20:49 +01:00
Ivan Kravets
1426e78793 Show valid environment names when user typed unknown values 2015-10-03 15:38:33 +01:00
Ivan Kravets
ec6af9a460 Merge branch 'release/v2.3.3' 2015-10-02 16:24:02 +01:00
Ivan Kravets
ec844961c7 Merge branch 'release/v2.3.3' into develop 2015-10-02 16:24:02 +01:00
Ivan Kravets
e1c9cb2c00 Version bump to 2.3.3 (issues #263, #288, #292, #295, #296, #297) 2015-10-02 16:23:46 +01:00
Ivan Kravets
2c0d26e06d Skip empty serial ports // Issue #294 2015-10-02 16:20:07 +01:00
Ivan Kravets
3c36eafdfa Avoid pip cache when problem occurs for upgrade process // Issue #295 2015-10-02 16:14:04 +01:00
Ivan Kravets
e22ab787dd Fix ESP8266 compile errors about RAM size when adding 1 library // Resolve #297 2015-10-02 15:34:36 +01:00
Ivan Kravets
948b75aeda Merge pull request #299 from valeros/develop
Update espressif platform // Resolve #296, #297
2015-10-02 15:22:09 +01:00
Valeriy Koval
4dcef89301 Update espressif platform // Resolve #296, #297 2015-10-02 16:11:00 +03:00
Ivan Kravets
12b29a760a More explanations about NotPlatformProject 2015-10-01 17:04:26 +01:00
Ivan Kravets
43ca0e149f Remove debug info 2015-09-30 16:56:13 +01:00
Ivan Kravets
ad1666dd0a Fix double quotes in defines for Project Generator // Issue #294 2015-09-30 16:54:12 +01:00
Ivan Kravets
1b4d4f5695 Handle Atom & Vim as IDE 2015-09-30 14:54:07 +01:00
Ivan Kravets
a714e6084a Add to FAQ "Unable to install PlatformIO: [Errno 1] Operation not permitted" // Resolve #295 2015-09-28 16:57:28 +01:00
Ivan Kravets
a8dd5d85a5 Add support for ST Nucleo F446RE board // Pull #293 2015-09-28 13:19:07 +01:00
Ivan Kravets
83363c7077 Merge pull request #293 from dkuku/patch-1
Add support for ST Nucleo F446RE board
2015-09-28 13:12:48 +01:00
Ivan Kravets
d99a57365f Add support for LightBlue Bean board // Issue #292 2015-09-28 12:09:03 +01:00
Daniel Kuku
3cb41cf6b0 Update ststm32.json
added nucleo_f446re
2015-09-27 03:02:34 +01:00
Ivan Kravets
5201626d6a Merge pull request #292 from mplewis/add-lightblue-boards
config: add LightBlue Bean board definition and docs
2015-09-24 09:43:57 +02:00
Matthew Lewis
f812e74324 config: fix Punch Through vendor name 2015-09-23 11:57:54 -05:00
Matthew Lewis
0668d6d290 docs: remove LightBlue Bean docs 2015-09-23 11:54:00 -05:00
Ivan Kravets
46d1c2c86c Fix broken lock file for "appstate" storage // Resolve #288 2015-09-23 16:35:31 +03:00
Ivan Kravets
ee7fe1fc10 Add to FAQ info about Archlinux issue with libncurses.so.5 // Resolve #291 2015-09-23 15:55:19 +03:00
Matthew Lewis
c997495b5d docs: fix underline length 2015-09-22 15:04:06 -05:00
Matthew Lewis
605b5755bf config: add LightBlue Bean board definition and docs 2015-09-22 14:54:32 -05:00
Ivan Kravets
b60c761cce Fix firmware uploading to Arduino Leonardo board using Mac OS // Resolve #287 2015-09-11 12:53:04 +03:00
Ivan Kravets
34972c77f5 Merge branch 'release/v2.3.2' into develop 2015-09-10 20:44:53 +03:00
43 changed files with 600 additions and 248 deletions

View File

@@ -4,6 +4,36 @@ Release History
PlatformIO 2.0
--------------
2.3.4 (2015-10-13)
~~~~~~~~~~~~~~~~~~
* Full support of `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`_
including code auto-completion
(`issue #132 <https://github.com/platformio/platformio/issues/132>`_)
* PlatformIO `command completion in Terminal <http://docs.platformio.org/en/latest/faq.html#command-completion-in-terminal>`_ for ``bash`` and ``zsh``
* Added support for ubIQio Ardhat board
(`pull #302 <https://github.com/platformio/platformio/pull/302>`_)
* Install SCons automatically and avoid ``error: option --single-version-externally-managed not recognized``
(`issue #279 <https://github.com/platformio/platformio/issues/279>`_)
* Use Teensy CLI Loader for upload of .hex files on Mac OS X
(`issue #306 <https://github.com/platformio/platformio/issues/306>`_)
* Fixed missing `framework-mbed <http://docs.platformio.org/en/latest/frameworks/mbed.html>`_
package for `teensy <http://docs.platformio.org/en/latest/platforms/teensy.html>`_
platform
(`issue #305 <https://github.com/platformio/platformio/issues/305>`_)
2.3.3 (2015-10-02)
~~~~~~~~~~~~~~~~~~
* Added support for LightBlue Bean board
(`pull #292 <https://github.com/platformio/platformio/pull/292>`_)
* Added support for ST Nucleo F446RE board
(`pull #293 <https://github.com/platformio/platformio/pull/293>`_)
* Fixed broken lock file for "appstate" storage
(`issue #288 <https://github.com/platformio/platformio/issues/288>`_)
* Fixed ESP8266 compile errors about RAM size when adding 1 library
(`issue #296 <https://github.com/platformio/platformio/issues/296>`_)
2.3.2 (2015-09-10)
~~~~~~~~~~~~~~~~~~
@@ -16,6 +46,8 @@ PlatformIO 2.0
* 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 firmware uploading to Arduino Leonardo board using Mac OS
(`issue #287 <https://github.com/platformio/platformio/issues/287>`_)
* Fixed `SConsNotInstalled` error for Linux Debian-based distributives
2.3.1 (2015-09-06)

View File

@@ -31,12 +31,13 @@ PlatformIO
`Home & Demo <http://platformio.org>`_ |
`Project Examples <https://github.com/platformio/platformio/tree/develop/examples>`_ |
`Code <https://github.com/platformio/platformio>`_ |
`Source Code <https://github.com/platformio>`_ |
`Documentation <http://docs.platformio.org>`_ ||
`Blog <http://www.ikravets.com/category/computer-life/platformio>`_ |
`Reddit <http://www.reddit.com/r/platformio/>`_ |
`Twitter <https://twitter.com/PlatformIO_Org>`_ |
`Hackaday <https://hackaday.io/project/7980-platformio>`_ |
`Facebook <https://www.facebook.com/platformio>`_ |
`Twitter <https://twitter.com/PlatformIO_Org>`_
`Reddit <http://www.reddit.com/r/platformio/>`_
.. image:: https://raw.githubusercontent.com/platformio/platformio/develop/docs/_static/platformio-logo.png
:target: http://platformio.org

View File

@@ -24,13 +24,14 @@ between team members, regardless of operating system they prefer to work with.
Beyond that, PlatformIO can be run not only on commonly used desktops/laptops
but also on the servers without X Window System. While PlatformIO itself is a
console application, it can be used in combination with one's favorite
:ref:`ide` or text editor such as :ref:`ide_arduino`, :ref:`ide_eclipse`,
:ref:`ide_visualstudio`, :ref:`ide_vim`, :ref:`ide_sublimetext`, etc.
:ref:`ide` or text editor such as :ref:`ide_arduino`, :ref:`ide_atom`,
:ref:`ide_clion`, :ref:`ide_eclipse`, :ref:`ide_qtcreator`,
:ref:`ide_sublimetext`, :ref:`ide_vim`, :ref:`ide_visualstudio`, etc.
Alright, so PlatformIO can run on different operating systems. But more
importantly, from development perspective at least, is a list of supported
boards and MCUs. To keep things short: PlatformIO supports over 100
:ref:`Embedded Boards <platforms>` and all major
boards and MCUs. To keep things short: PlatformIO supports over 150+
`Embedded Boards <http://platformio.org/#!/boards>`_ and all major
:ref:`Development Platforms <platforms>`.
PlatformIO allows users to:
@@ -55,11 +56,71 @@ the project developed using PlatformIO is as follows:
* Users develop code and PlatformIO makes sure that it is compiled, prepared
and uploaded to all the boards of interest.
Command completion in Terminal
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Bash completion
'''''''''''''''
Bash completion support will complete subcommands and parameters. To enable
Bash completion for `platformio` subcommands you need to put into your `.bashrc`:
.. code-block:: bash
eval "$(_PLATFORMIO_COMPLETE=source platformio)"
ZSH completion
''''''''''''''
To enable ``zsh`` completion please run these commands:
.. code-block:: bash
autoload bashcompinit && bashcompinit
eval "$(_PLATFORMIO_COMPLETE=source platformio)"
.. note::
For permanent command completion you need to place commands above to
``~/.bashrc`` or ``~/.zshrc`` file.
.. _faq_troubleshooting:
Troubleshooting
---------------
Installation
~~~~~~~~~~~~
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
# if you have "error: option --single-version-externally-managed not recognized", then
[sudo] pip install --egg 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>`_.
[Errno 1] Operation not permitted
'''''''''''''''''''''''''''''''''
Answered in `issue #295 <https://github.com/platformio/platformio/issues/295#issuecomment-143772005>`_.
.. _faq_troubleshooting_pioblocksprompt:
PlatformIO blocks command execution using user prompt
@@ -75,27 +136,6 @@ There are a few options:
- masking under Continuous Integration system via environment variable
: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:
Program ``platformio`` not found in PATH
@@ -156,3 +196,8 @@ ARM toolchain: cc1plus: error while loading shared libraries
See related answers for
`error while loading shared libraries <https://github.com/platformio/platformio/issues?utf8=✓&q=error+while+loading+shared+libraries>`_.
Archlinux: libncurses.so.5: cannot open shared object file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Answered in `issue #291 <https://github.com/platformio/platformio/issues/291>`_.

View File

@@ -476,7 +476,7 @@ Espressif
* - ``esp01``
- `Espressif ESP8266 board <https://nurdspace.nl/ESP8266>`_
- ESP8266
- 80 MHz
- 40 MHz
- 512 Kb
- 32 Kb
@@ -630,6 +630,26 @@ PanStamp
- 32 Kb
- 4 Kb
Punch Through
~~~~~~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``lightblue-bean``
- `LightBlue Bean <https://punchthrough.com/bean>`_
- ATMEGA328P
- 8 MHz
- 32 Kb
- 2 Kb
Quirkbot
~~~~~~~~
@@ -956,3 +976,23 @@ Wicked Device
- 16 MHz
- 128 Kb
- 16 Kb
ubIQio
~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``ardhat``
- `ubIQio Ardhat <http://ardhat.com>`_
- ATMEGA328P
- 16 MHz
- 32 Kb
- 2 Kb

View File

@@ -31,6 +31,9 @@ Platforms
* - :ref:`platform_ststm32`
- The STM32 family of 32-bit Flash MCUs based on the ARM Cortex-M processor is designed to offer new degrees of freedom to MCU users. It offers a 32-bit product range that combines very high performance, real-time capabilities, digital signal processing, and low-power, low-voltage operation, while maintaining full integration and ease of development.
* - :ref:`platform_teensy`
- Teensy is a complete USB-based microcontroller development system, in a very small footprint, capable of implementing many types of projects. All programming is done via the USB port. No special programmer is needed, only a standard "Mini-B" USB cable and a PC or Macintosh with a USB port.
Boards
------
@@ -469,6 +472,13 @@ ST
- 512 Kb
- 128 Kb
* - ``nucleo_f446re``
- `ST Nucleo F446RE <https://developer.mbed.org/platforms/ST-Nucleo-F446RE/>`_
- STM32F446RET6
- 180 MHz
- 512 Kb
- 128 Kb
* - ``nucleo_l053r8``
- `ST Nucleo L053R8 <https://developer.mbed.org/platforms/ST-Nucleo-L053R8/>`_
- STM32L053R8T6

View File

@@ -47,11 +47,19 @@ There are 3 predefined targets for building:
* ``PLATFORMIO_CLEAN`` - clean compiled objects and etc.
.. warning::
CLion is still in the development stage, so some of the features (like,
auto-complete) probably will not work with PlatformIO. See
`CLion issue #CPP-3977 <https://youtrack.jetbrains.com/issue/CPP-3977>`_.
PlatformIO generates empty project by default and **code auto-completion
will not work!** To enable auto-completion please choose one of:
Active discussion located in
* Add source files ``*.c, *.cpp, etc`` to ``src`` directory and re-initialize
project with command above
* Manually correct ``add_executable`` command in ``CMakeLists.txt`` file
(will be created in project directory after initialization).
``*.ino`` file isn't acceptable for ``add_executable`` command. You should
convert it manually to ``*.cpp``. See `project example <https://github.com/platformio/platformio/tree/develop/examples/ide/clion>`_.
More info `CLion issue #CPP-3977 <https://youtrack.jetbrains.com/issue/CPP-3977>`_.
Active discussion is located in
`PlatformIO issue #132 <https://github.com/platformio/platformio/issues/132>`_.
Screenshot

View File

@@ -18,9 +18,10 @@ libOpenCM3, etc.*
* `Source Code <https://github.com/platformio/platformio>`_ |
`Issues <https://github.com/platformio/platformio/issues>`_
* `Blog <http://www.ikravets.com/category/computer-life/platformio>`_ |
`Reddit <http://www.reddit.com/r/platformio/>`_ |
`Twitter <https://twitter.com/PlatformIO_Org>`_ |
`Hackaday <https://hackaday.io/project/7980-platformio>`_ |
`Facebook <https://www.facebook.com/platformio>`_ |
`Twitter <https://twitter.com/PlatformIO_Org>`_
`Reddit <http://www.reddit.com/r/platformio/>`_
You have **no need** to install any *IDE* or compile any tool chains. *PlatformIO*
has pre-built different development platforms and pre-configured settings for

View File

@@ -601,6 +601,26 @@ PanStamp
- 32 Kb
- 2 Kb
Punch Through
~~~~~~~~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``lightblue-bean``
- `LightBlue Bean <https://punchthrough.com/bean>`_
- ATMEGA328P
- 8 MHz
- 32 Kb
- 2 Kb
Quirkbot
~~~~~~~~
@@ -852,3 +872,23 @@ Wicked Device
- 16 MHz
- 128 Kb
- 16 Kb
ubIQio
~~~~~~
.. list-table::
:header-rows: 1
* - Type ``board``
- Name
- Microcontroller
- Frequency
- Flash
- RAM
* - ``ardhat``
- `ubIQio Ardhat <http://ardhat.com>`_
- ATMEGA328P
- 16 MHz
- 32 Kb
- 2 Kb

View File

@@ -77,6 +77,6 @@ Espressif
* - ``esp01``
- `Espressif ESP8266 board <https://nurdspace.nl/ESP8266>`_
- ESP8266
- 80 MHz
- 40 MHz
- 512 Kb
- 32 Kb

View File

@@ -256,6 +256,13 @@ ST
- 512 Kb
- 128 Kb
* - ``nucleo_f446re``
- `ST Nucleo F446RE <https://developer.mbed.org/platforms/ST-Nucleo-F446RE/>`_
- STM32F446RET6
- 180 MHz
- 512 Kb
- 128 Kb
* - ``nucleo_l053r8``
- `ST Nucleo L053R8 <https://developer.mbed.org/platforms/ST-Nucleo-L053R8/>`_
- STM32L053R8T6

View File

@@ -17,21 +17,24 @@ Packages
* - Name
- Contents
* - ``framework-arduinoteensy``
- `Arduino Wiring-based Framework <http://arduino.cc/en/Reference/HomePage>`_
* - ``tool-teensy``
- `Teensy Loader <https://www.pjrc.com/teensy/loader.html>`_
* - ``toolchain-gccarmnoneeabi``
- `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_
* - ``framework-mbed``
- `mbed Framework <http://mbed.org>`_
* - ``toolchain-atmelavr``
- `avr-gcc <https://gcc.gnu.org/wiki/avr-gcc>`_, `GDB <http://www.gnu.org/software/gdb/>`_, `AVaRICE <http://avarice.sourceforge.net/>`_, `SimulAVR <http://www.nongnu.org/simulavr/>`_
* - ``ldscripts``
- `Linker Scripts <https://sourceware.org/binutils/docs/ld/Scripts.html>`_
* - ``framework-arduinoteensy``
- `Arduino Wiring-based Framework <http://arduino.cc/en/Reference/HomePage>`_
* - ``toolchain-gccarmnoneeabi``
- `gcc-arm-embedded <https://launchpad.net/gcc-arm-embedded>`_, `GDB <http://www.gnu.org/software/gdb/>`_
* - ``tool-teensy``
- `Teensy Loader <https://www.pjrc.com/teensy/loader.html>`_
.. warning::
**Linux Users:** Don't forget to install "udev" rules file
`99-platformio-udev.rules <https://github.com/platformio/platformio/blob/develop/scripts/99-platformio-udev.rules>`_ (an instruction is located in the file).
@@ -52,6 +55,9 @@ Frameworks
* - :ref:`framework_arduino`
- Arduino Framework allows writing cross-platform software to control devices attached to a wide range of Arduino boards to create all kinds of creative coding, interactive objects, spaces or physical experiences.
* - :ref:`framework_mbed`
- The mbed framework The mbed SDK has been designed to provide enough hardware abstraction to be intuitive and concise, yet powerful enough to build complex projects. It is built on the low-level ARM CMSIS APIs, allowing you to code down to the metal if needed. In addition to RTOS, USB and Networking libraries, a cookbook of hundreds of reusable peripheral and module libraries have been built on top of the SDK by the mbed Developer Community.
Boards
------

View File

@@ -28,7 +28,7 @@ Quickstart
The next files/directories will be created in ***
platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
src - Put your source code here
src - Put your source files here
lib - Put here project specific (private) libraries
Do you want to continue? [y/N]: y
Project has been successfully initialized!
@@ -37,7 +37,7 @@ Quickstart
`platformio run --target upload` or `platformio run -t upload` - upload firmware to embedded board
`platformio run --target clean` - clean project (remove compiled files)
Put your source code ``*.h, *.c, *.cpp or *.ino`` files to ``src`` directory.
Put your source files ``*.h, *.c, *.cpp or *.ino`` to ``src`` directory.
4. Process the project's environments.

View File

@@ -22,7 +22,7 @@ Initialize new PlatformIO based project.
This command will create:
* :ref:`projectconf`
* ``src`` - a source directory. Put your source code here
* ``src`` - a source directory. Put your source files here
* ``lib`` - a directory for the project specific (private) libraries.
PlatformIO will compile them to static libraries and link to executable file
@@ -94,7 +94,7 @@ Examples
The next files/directories will be created in ***
platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
src - Put your source code here
src - Put your source files here
lib - Put here project specific (private) libraries
Do you want to continue? [y/N]: y
Project has been successfully initialized!
@@ -112,7 +112,7 @@ Examples
The next files/directories will be created in ***
platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
src - Put your source code here
src - Put your source files here
lib - Put here project specific (private) libraries
Do you want to continue? [y/N]: y
Project has been successfully initialized!
@@ -136,7 +136,7 @@ Examples
The next files/directories will be created in ***
platformio.ini - Project Configuration File. |-> PLEASE EDIT ME <-|
src - Put your source code here
src - Put your source files here
lib - Put here project specific (private) libraries
Do you want to continue? [y/N]: y
Project has been successfully initialized!

View File

@@ -1,9 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="CPP_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/CMakeLists.txt" isTestSource="false" />
</content>
<content url="file://$MODULE_DIR$" />
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>

View File

@@ -2,13 +2,13 @@
<project version="4">
<component name="CMakeRunConfigurationManager" shouldGenerate="true" assignedExecutableTargets="true" buildAllGenerated="true">
<generated>
<config projectName="PlatformIO" targetName="DEBUG" />
<config projectName="PlatformIO" targetName="PLATFORMIO_RUN" />
<config projectName="PlatformIO" targetName="PlatformIO" />
<config projectName="PlatformIO" targetName="PLATFORMIO_UPLOAD" />
<config projectName="PlatformIO" targetName="PLATFORMIO_CLEAN" />
<config projectName="PlatformIO" targetName="PLATFORMIO_BUILD" />
<config projectName="PlatformIO" targetName="PLATFORMIO" />
<config projectName="clion" targetName="PLATFORMIO_CLEAN" />
<config projectName="clion" targetName="PLATFORMIO_RUN" />
<config projectName="clion" targetName="PLATFORMIO" />
<config projectName="clion" targetName="clion" />
<config projectName="clion" targetName="DEBUG" />
<config projectName="clion" targetName="PLATFORMIO_BUILD" />
<config projectName="clion" targetName="PLATFORMIO_UPLOAD" />
</generated>
</component>
<component name="CMakeSettings" AUTO_RELOAD="true" GENERATION_PASS_SYSTEM_ENVIRONMENT="true">
@@ -33,25 +33,25 @@
</component>
<component name="ExecutionTargetManager" SELECTED_TARGET="default_target" />
<component name="FavoritesManager">
<favorites_list name="PlatformIO" />
<favorites_list name="clion" />
</component>
<component name="FileEditorManager">
<leaf>
<file leaf-file-name="CMakeLists.txt" pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/CMakeLists.txt">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.45302013">
<caret line="18" column="20" selection-start-line="18" selection-start-column="20" selection-end-line="18" selection-end-column="20" />
<state vertical-scroll-proportion="0.15758981">
<caret line="8" column="49" selection-start-line="8" selection-start-column="49" selection-end-line="8" selection-end-column="49" />
<folding />
</state>
</provider>
</entry>
</file>
<file leaf-file-name="blink.cpp" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/blink.cpp">
<file leaf-file-name="src/blink.cpp" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR/$src/blink.cpp">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="13" selection-start-line="0" selection-start-column="13" selection-end-line="0" selection-end-column="13" />
<caret line="24" column="4" selection-start-line="24" selection-start-column="4" selection-end-line="24" selection-end-column="4" />
<folding />
</state>
</provider>
@@ -67,8 +67,8 @@
<order />
</component>
<component name="ProjectFrameBounds">
<option name="x" value="162" />
<option name="y" value="23" />
<option name="x" value="252" />
<option name="y" value="21" />
<option name="width" value="1400" />
<option name="height" value="1000" />
</component>
@@ -116,13 +116,13 @@
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="clion" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
</PATH_ELEMENT>
</PATH>
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="clion" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="clion" />
@@ -132,7 +132,7 @@
<PATH>
<PATH_ELEMENT>
<option name="myItemId" value="clion" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$MyProjectTreeStructure$1" />
<option name="myItemType" value="com.jetbrains.cidr.projectView.CidrFilesViewHelper$1$1" />
</PATH_ELEMENT>
<PATH_ELEMENT>
<option name="myItemId" value="clion" />
@@ -155,8 +155,8 @@
<property name="restartRequiresConfirmation" value="true" />
<property name="FullScreen" value="false" />
</component>
<component name="RunManager" selected="Application.PLATFORMIO_CLEAN">
<configuration default="true" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="PlatformIO" TARGET_NAME="PlatformIO" CONFIG_NAME="Debug">
<component name="RunManager" selected="Application.PLATFORMIO_BUILD">
<configuration default="true" type="CMakeRunConfiguration" factoryName="Application" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="clion" TARGET_NAME="clion" CONFIG_NAME="Debug">
<envs />
<method />
</configuration>
@@ -173,15 +173,15 @@
<envs />
<method />
</configuration>
<configuration default="false" name="PLATFORMIO_BUILD" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="PlatformIO" TARGET_NAME="PLATFORMIO_BUILD" CONFIG_NAME="Debug">
<configuration default="false" name="PLATFORMIO_BUILD" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="clion" TARGET_NAME="PLATFORMIO_BUILD" CONFIG_NAME="Debug">
<envs />
<method />
</configuration>
<configuration default="false" name="PLATFORMIO_CLEAN" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="PlatformIO" TARGET_NAME="PLATFORMIO_CLEAN" CONFIG_NAME="Debug">
<configuration default="false" name="PLATFORMIO_CLEAN" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="clion" TARGET_NAME="PLATFORMIO_CLEAN" CONFIG_NAME="Debug">
<envs />
<method />
</configuration>
<configuration default="false" name="PLATFORMIO_UPLOAD" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="PlatformIO" TARGET_NAME="PLATFORMIO_UPLOAD" CONFIG_NAME="Debug">
<configuration default="false" name="PLATFORMIO_UPLOAD" type="CMakeRunConfiguration" factoryName="Application" WORKING_DIR="" PASS_PARENT_ENVS="FALSE" PROJECT_NAME="clion" TARGET_NAME="PLATFORMIO_UPLOAD" CONFIG_NAME="Debug">
<envs />
<method />
</configuration>
@@ -206,27 +206,27 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="162" y="23" width="1400" height="1000" extended-state="0" />
<frame x="252" y="21" width="1400" height="1000" extended-state="0" />
<editor active="true" />
<layout>
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32975295" sideWeight="0.53684974" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Project" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.25" sideWeight="0.5" order="0" side_tool="false" content_ui="combo" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="TODO" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="6" side_tool="false" content_ui="tabs" />
<window_info id="CMake" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Event Log" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.4631503" order="7" side_tool="true" content_ui="tabs" />
<window_info id="Version Control" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Run" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="2" side_tool="false" content_ui="tabs" />
<window_info id="Structure" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Terminal" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.32996634" sideWeight="0.5" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Favorites" active="false" anchor="left" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="2" side_tool="true" content_ui="tabs" />
<window_info id="Debug" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="3" side_tool="false" content_ui="tabs" />
<window_info id="Cvs" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="4" side_tool="false" content_ui="tabs" />
<window_info id="Messages" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="true" weight="0.32996634" sideWeight="0.53684974" order="7" side_tool="false" content_ui="tabs" />
<window_info id="Message" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Commander" active="false" anchor="right" auto_hide="false" internal_type="SLIDING" type="SLIDING" visible="false" weight="0.4" sideWeight="0.5" order="0" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Inspection" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.4" sideWeight="0.5" order="5" side_tool="false" content_ui="tabs" />
<window_info id="Hierarchy" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="2" side_tool="false" content_ui="combo" />
<window_info id="Find" active="false" anchor="bottom" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.33" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
<window_info id="Ant Build" active="false" anchor="right" auto_hide="false" internal_type="DOCKED" type="DOCKED" visible="false" weight="0.25" sideWeight="0.5" order="1" side_tool="false" content_ui="tabs" />
</layout>
</component>
<component name="Vcs.Log.UiProperties">
@@ -240,35 +240,12 @@
<component name="VcsContentAnnotationSettings">
<option name="myLimit" value="2678400000" />
</component>
<component name="VcsManagerConfiguration">
<ignored-roots>
<path value="$PROJECT_DIR$/../../.." />
</ignored-roots>
</component>
<component name="XDebuggerManager">
<breakpoint-manager>
<option name="time" value="4" />
</breakpoint-manager>
<watches-manager />
</component>
<component name="editorHistoryManager">
<entry file="file://$PROJECT_DIR$/src/blink.cpp">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.0">
<caret line="0" column="13" selection-start-line="0" selection-start-column="13" selection-end-line="0" selection-end-column="13" />
<folding />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/CMakeLists.txt">
<provider selected="true" editor-type-id="text-editor">
<state vertical-scroll-proportion="0.45302013">
<caret line="18" column="20" selection-start-line="18" selection-start-column="20" selection-end-line="18" selection-end-column="20" />
<folding />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
<state key="ScopeChooserConfigurable.UI">

View File

@@ -1,7 +1,8 @@
cmake_minimum_required(VERSION 3.2)
project(PlatformIO)
project(clion)
set(PLATFORMIO_CMD platformio)
set(ENV{PATH} "/Volumes/SOFT/Projects/GitHub/platformio/origin/.tox/develop/bin:/usr/local/opt/pyenv/shims:/Users/ikravets/.pyenv/shims:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/sbin")
set(PLATFORMIO_CMD "/Volumes/SOFT/Projects/GitHub/platformio/origin/.tox/develop/bin/platformio")
include_directories("$ENV{HOME}/.platformio/packages/framework-arduinoavr/variants/standard")
include_directories("$ENV{HOME}/.platformio/packages/framework-arduinoavr/cores/arduino")
@@ -14,7 +15,7 @@ add_definitions(-DF_CPU=16000000L)
add_definitions(-DARDUINO_ARCH_AVR)
add_definitions(-DARDUINO_AVR_UNO)
add_definitions(-DARDUINO=10605)
add_definitions(-DPLATFORMIO=020300)
add_definitions(-DPLATFORMIO=020304)
add_definitions(-D__AVR_ATmega328P__)
add_custom_target(
@@ -33,4 +34,6 @@ add_custom_target(
PLATFORMIO_CLEAN ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
)
add_executable(clion src/blink.cpp)

View File

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

View File

@@ -3,7 +3,8 @@
import json
from os import environ, getenv
from os.path import isfile, join
from os.path import getmtime, isfile, join
from time import time
from lockfile import LockFile
@@ -68,9 +69,8 @@ class State(object):
def __enter__(self):
try:
self._lock_state_file()
if isfile(self.path):
self._lock = LockFile(self.path)
self._lock.acquire()
with open(self.path, "r") as fp:
self._state = json.load(fp)
except ValueError:
@@ -85,6 +85,18 @@ class State(object):
json.dump(self._state, fp, indent=4)
else:
json.dump(self._state, fp)
self._unlock_state_file()
def _lock_state_file(self):
self._lock = LockFile(self.path)
if (self._lock.is_locked() and
(time() - getmtime(self._lock.lock_file)) > 10):
self._lock.break_lock()
self._lock.acquire()
def _unlock_state_file(self):
if self._lock:
self._lock.release()

View File

@@ -3,7 +3,7 @@
"build": {
"core": "esp8266",
"extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266",
"f_cpu": "80000000L",
"f_cpu": "40000000L",
"ldscript": "esp8266.flash.512k.ld",
"mcu": "esp8266",
"variant": "generic"

View File

@@ -1,4 +1,26 @@
{
"ardhat": {
"build": {
"core": "arduino",
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_ARDHAT",
"f_cpu": "16000000L",
"mcu": "atmega328p",
"variant": "standard"
},
"frameworks": ["arduino"],
"name": "ubIQio Ardhat",
"platform": "atmelavr",
"upload": {
"maximum_ram_size": 2048,
"maximum_size": 32256,
"protocol": "arduino",
"require_upload_port" : true,
"speed": 115200
},
"url": "http://ardhat.com",
"vendor": "ubIQio"
},
"raspduino": {
"build": {
"core": "arduino",

View File

@@ -0,0 +1,22 @@
{
"lightblue-bean": {
"name": "LightBlue Bean",
"vendor": "Punch Through",
"url": "https://punchthrough.com/bean",
"platform": "atmelavr",
"frameworks": ["arduino"],
"build": {
"core": "bean",
"variant": "bean",
"extra_flags": "-DARDUINO_ARCH_AVR",
"mcu": "atmega328p",
"f_cpu": "8000000L"
},
"upload": {
"maximum_size": 32256,
"maximum_ram_size": 2048
}
}
}

View File

@@ -299,6 +299,22 @@
"url": "https://developer.mbed.org/platforms/ST-Nucleo-F411RE/",
"vendor": "ST"
},
"nucleo_f446re": {
"build": {
"f_cpu": "180000000L",
"cpu": "cortex-m4",
"mcu": "stm32f446ret6"
},
"frameworks": ["mbed"],
"name": "ST Nucleo F446RE",
"platform": "ststm32",
"upload": {
"maximum_ram_size": 131072,
"maximum_size": 524288
},
"url": "https://developer.mbed.org/platforms/ST-Nucleo-F446RE/",
"vendor": "ST"
},
"nucleo_l053r8": {
"build": {
"f_cpu": "48000000L",

View File

@@ -31,7 +31,7 @@ env.Replace(
ASPPFLAGS=["-x", "assembler-with-cpp"],
CFLAGS=[
"-std=c99",
"-std=gnu99",
"-Wpointer-arith",
"-Wno-implicit-function-declaration",
"-Wl,-EL",
@@ -76,9 +76,7 @@ env.Replace(
"-cb", "$UPLOAD_SPEED",
"-cp", "$UPLOAD_PORT",
"-ca", "0x00000",
"-cf", "${SOURCES[0]}",
"-ca", "0x40000" if "FRAMEWORK" not in env else "0x10000",
"-cf", "${SOURCES[1]}"
"-cf", "$SOURCE"
],
UPLOADCMD='$UPLOADER $UPLOADERFLAGS',
@@ -86,23 +84,35 @@ env.Replace(
PROGSUFFIX=".elf"
)
if "FRAMEWORK" in env:
env.Append(
LINKFLAGS=[
"-Wl,-wrap,system_restart_local",
"-Wl,-wrap,register_chipv6_phy"
]
)
env.Append(
BUILDERS=dict(
ElfToBin=Builder(
action=" ".join([
"$UPLOADER",
"-eo", join("$PLATFORMFW_DIR", "bootloaders",
"eboot", "eboot.elf"),
"-bo", "$TARGET",
"-bm", "dio",
"-bf", "${BOARD_OPTIONS['build']['f_cpu'][:2]}",
"-bz", str(int(env.get("BOARD_OPTIONS", {}).get(
"upload", {}).get("maximum_size") / 1024)) + "K",
"-bs", ".text",
"-bp", "4096",
"-ec",
"-eo", "$SOURCES",
"-bo", "${TARGETS[0]}",
"-bm", "qio",
"-bf", "40",
"-bz", "512K",
"-bs", ".irom0.text",
"-bs", ".text",
"-bs", ".data",
"-bs", ".rodata",
"-bc", "-ec",
"-eo", "$SOURCES",
"-es", ".irom0.text", "${TARGETS[1]}",
"-ec", "-v"
"-bc", "-ec"
]),
suffix=".bin"
)
@@ -119,13 +129,43 @@ if "FRAMEWORK" not in env:
join("$PIOPACKAGES_DIR", "sdk-esp8266", "include"),
"$PROJECTSRC_DIR"
],
LIBPATH=[join("$PIOPACKAGES_DIR", "sdk-esp8266", "lib")]
LIBPATH=[join("$PIOPACKAGES_DIR", "sdk-esp8266", "lib")],
BUILDERS=dict(
ElfToBin=Builder(
action=" ".join([
"$UPLOADER",
"-eo", "$SOURCES",
"-bo", "${TARGETS[0]}",
"-bm", "qio",
"-bf", "40",
"-bz", "512K",
"-bs", ".text",
"-bs", ".data",
"-bs", ".rodata",
"-bc", "-ec",
"-eo", "$SOURCES",
"-es", ".irom0.text", "${TARGETS[1]}",
"-ec", "-v"
]),
suffix=".bin"
)
)
)
env.Replace(
LDSCRIPT_PATH=join(
"$PIOPACKAGES_DIR", "sdk-esp8266", "ld", "eagle.app.v6.ld"),
LIBS=["c", "gcc", "phy", "pp", "net80211", "lwip", "wpa", "main",
"json", "upgrade", "smartconfig", "pwm", "at", "ssl"]
"json", "upgrade", "smartconfig", "pwm", "at", "ssl"],
UPLOADERFLAGS=[
"-vv",
"-cd", "ck",
"-cb", "$UPLOAD_SPEED",
"-cp", "$UPLOAD_PORT",
"-ca", "0x00000",
"-cf", "${SOURCES[0]}",
"-ca", "0x40000",
"-cf", "${SOURCES[1]}"
]
)
#
@@ -139,17 +179,20 @@ target_elf = env.BuildProgram()
#
if "uploadlazy" in COMMAND_LINE_TARGETS:
target_firm = [
join("$BUILD_DIR", "firmware_00000.bin"),
join("$BUILD_DIR", "firmware_%s.bin" %
("40000" if "FRAMEWORK" not in env else "10000"))
]
if "FRAMEWORK" not in env:
target_firm = [
join("$BUILD_DIR", "firmware_00000.bin"),
join("$BUILD_DIR", "firmware_40000.bin")
]
else:
target_firm = join("$BUILD_DIR", "firmware.bin")
else:
target_firm = env.ElfToBin(
[join("$BUILD_DIR", "firmware_00000"),
join("$BUILD_DIR", "firmware_%s" %
("40000" if "FRAMEWORK" not in env else "10000"))], target_elf)
if "FRAMEWORK" not in env:
target_firm = env.ElfToBin(
[join("$BUILD_DIR", "firmware_00000"),
join("$BUILD_DIR", "firmware_40000")], target_elf)
else:
target_firm = env.ElfToBin(join("$BUILD_DIR", "firmware"), target_elf)
#
# Target: Print binary size

View File

@@ -47,7 +47,7 @@ elif env.get("PLATFORM") == "espressif":
CPPPATH=[join("$PLATFORMFW_DIR", "sdk", "include")],
LIBPATH=[join("$PLATFORMFW_DIR", "sdk", "lib")],
LIBS=["smartconfig", "pp", "main", "wpa", "lwip",
"net80211", "phy", "hal", "gcc", "m"]
"net80211", "wps", "crypto", "phy", "hal", "gcc", "m"]
)
env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR)

View File

@@ -147,7 +147,7 @@ def DumpIDEData(env):
for item in env.get("CPPDEFINES", []):
if isinstance(item, list):
item = "=".join(item)
data['defines'].append(env.subst(item))
data['defines'].append(env.subst(item).replace('\\"', '"'))
# special symbol for Atmel AVR MCU
board = env.get("BOARD_OPTIONS", {})

View File

@@ -65,7 +65,7 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
click.style(project_dir, fg="cyan"))
click.echo("%s - Project Configuration File. |-> PLEASE EDIT ME <-|" %
click.style("platformio.ini", fg="cyan"))
click.echo("%s - Put your source code here" %
click.echo("%s - Put your source files here" %
click.style("src", fg="cyan"))
click.echo("%s - Put here project specific (private) libraries" %
click.style("lib", fg="cyan"))

View File

@@ -36,13 +36,19 @@ def cli(ctx, environment, target, upload_port, # pylint: disable=R0913,R0914
if not config.sections():
raise exception.ProjectEnvsNotAvailable()
unknown = set(environment) - set([s[4:] for s in config.sections()])
known = set([s[4:] for s in config.sections()
if s.startswith("env:")])
unknown = set(environment) - known
if unknown:
raise exception.UnknownEnvNames(", ".join(unknown))
raise exception.UnknownEnvNames(
", ".join(unknown), ", ".join(known))
# clean obsolete .pioenvs dir
if not disable_auto_clean:
_clean_pioenvs_dir()
try:
_clean_pioenvs_dir(util.get_pioenvs_dir())
except Exception:
raise exception.CleanPioenvsDirError(util.get_pioenvs_dir())
results = []
for section in config.sections():
@@ -221,8 +227,7 @@ def _autoinstall_libs(ctx, libids_list):
ctx.invoke(cmd_lib_install, libid=not_intalled_libs)
def _clean_pioenvs_dir():
pioenvs_dir = util.get_pioenvs_dir()
def _clean_pioenvs_dir(pioenvs_dir):
structhash_file = join(pioenvs_dir, "structure.hash")
proj_hash = calculate_project_hash()

View File

@@ -32,6 +32,11 @@ def cli():
for cmd in cmds:
r = None
r = util.exec_command(cmd)
# try pip with disabled cache
if r['returncode'] != 0 and cmd[0] == "pip":
r = util.exec_command(["pip", "--no-cache-dir"] + cmd[1:])
assert r['returncode'] == 0
assert last in r['out'].strip()
click.secho(

View File

@@ -33,14 +33,14 @@ class UnknownPlatform(PlatformioException):
class PlatformNotInstalledYet(PlatformioException):
MESSAGE = ("The platform '%s' has not been installed yet. "
"Use `platformio platforms install` command")
MESSAGE = "The platform '%s' has not been installed yet. "\
"Use `platformio platforms install` command"
class UnknownCLICommand(PlatformioException):
MESSAGE = ("Unknown command '%s'. Please use `platformio --help`"
" to see all available commands")
MESSAGE = "Unknown command '%s'. Please use `platformio --help`"\
" to see all available commands"
class UnknownBoard(PlatformioException):
@@ -75,19 +75,21 @@ class FDUnrecognizedStatusCode(PlatformioException):
class FDSizeMismatch(PlatformioException):
MESSAGE = ("The size (%d bytes) of downloaded file '%s' "
"is not equal to remote size (%d bytes)")
MESSAGE = "The size (%d bytes) of downloaded file '%s' "\
"is not equal to remote size (%d bytes)"
class FDSHASumMismatch(PlatformioException):
MESSAGE = ("The 'sha1' sum '%s' of downloaded file '%s' "
"is not equal to remote '%s'")
MESSAGE = "The 'sha1' sum '%s' of downloaded file '%s' "\
"is not equal to remote '%s'"
class NotPlatformProject(PlatformioException):
MESSAGE = "Not a PlatformIO project (%s). Use `platformio init` command"
MESSAGE = "Not a PlatformIO project. `platformio.ini` file has not been "\
"found in current working directory (%s). To initialize new project "\
"please use `platformio init` command"
class UndefinedEnvPlatform(PlatformioException):
@@ -102,17 +104,23 @@ class UnsupportedArchiveType(PlatformioException):
class ProjectEnvsNotAvailable(PlatformioException):
MESSAGE = "Please setup environments in `platformio.ini` file."
MESSAGE = "Please setup environments in `platformio.ini` file"
class InvalidEnvName(PlatformioException):
MESSAGE = "Invalid environment '%s'. The name must start " "with 'env:'."
MESSAGE = "Invalid environment '%s'. The name must start with 'env:'"
class UnknownEnvNames(PlatformioException):
MESSAGE = "Unknown environment names '%s'."
MESSAGE = "Unknown environment names '%s'. Valid names are '%s'"
class CleanPioenvsDirError(PlatformioException):
MESSAGE = "Can not remove temporary directory `%s`. "\
"Please remove it manually"
class GetSerialPortsError(PlatformioException):
@@ -122,7 +130,7 @@ class GetSerialPortsError(PlatformioException):
class GetLatestVersionError(PlatformioException):
MESSAGE = "Can't retrieve the latest PlatformIO version"
MESSAGE = "Can not retrieve the latest PlatformIO version"
class APIRequestError(PlatformioException):
@@ -171,36 +179,28 @@ class UpgraderFailed(PlatformioException):
class CIBuildEnvsEmpty(PlatformioException):
MESSAGE = (
"Can't find PlatformIO build environments.\nPlease specify `--board` "
"or path to `platformio.ini` with predefined environments using "
"`--project-conf` option"
)
MESSAGE = "Can't find PlatformIO build environments.\n"\
"Please specify `--board` or path to `platformio.ini` with "\
"predefined environments using `--project-conf` option"
class SConsNotInstalled(PlatformioException):
MESSAGE = (
"The PlatformIO and `scons` aren't installed properly. "
"More details in FAQ/Troubleshooting section: "
MESSAGE = "The PlatformIO and `scons` aren't installed properly. "\
"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: "
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. "
MESSAGE = "PlatformIO does not work within Cygwin environment. "\
"Use native Terminal instead."
)

View File

@@ -7,6 +7,7 @@ import re
from os.path import abspath, basename, expanduser, isdir, join, relpath
import bottle
import click
from platformio import util
@@ -72,7 +73,7 @@ class ProjectGenerator(object):
def get_project_name(self):
return basename(self.project_dir)
def get_srcfiles(self):
def get_src_files(self):
result = []
with util.cd(self.project_dir):
for root, _, files in os.walk(util.get_projectsrc_dir()):
@@ -80,6 +81,14 @@ class ProjectGenerator(object):
result.append(relpath(join(root, f)))
return result
@staticmethod
def get_main_src_file(src_files):
for f in src_files:
for ext in ("c", "cpp"):
if f.endswith(".%s" % ext):
return f
return None
def get_tpls(self):
tpls = []
tpls_dir = join(util.get_source_dir(), "ide", "tpls", self.ide)
@@ -112,11 +121,23 @@ class ProjectGenerator(object):
return bottle.template(content, **self._tplvars)
def _gather_tplvars(self):
src_files = self.get_src_files()
main_src_file = self.get_main_src_file(src_files)
if not main_src_file and self.ide == "clion":
click.secho(
"Warning! Can not find main source file (*.c, *.cpp). So, "
"code auto-completion is disabled. Please add source files "
"to `src` directory and re-initialize project or edit "
"`CMakeLists.txt` file manually (`add_executable` command).",
fg="yellow")
self._tplvars.update(self.get_project_env())
self._tplvars.update(self.get_project_build_data())
self._tplvars.update({
"project_name": self.get_project_name(),
"srcfiles": self.get_srcfiles(),
"src_files": src_files,
"main_src_file": main_src_file,
"user_home_dir": abspath(expanduser("~")),
"project_dir": self.project_dir,
"systype": util.get_systype(),

View File

@@ -47,7 +47,7 @@
</provider>
</entry>
</file>
% for file in srcfiles:
% for file in src_files:
<file leaf-file-name="{{file}}" pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR/${{file}}">
<provider selected="true" editor-type-id="text-editor">

View File

@@ -8,12 +8,12 @@ set(PLATFORMIO_CMD "{{platformio_path}}")
% if include.startswith(user_home_dir):
include_directories("$ENV{HOME}{{include.replace(user_home_dir, '').replace("\\", "/")}}")
% else:
include_directories("{{include}}")
include_directories("{{include.replace("\\", "/")}}")
% end
% end
% for define in defines:
add_definitions(-D{{define}})
add_definitions(-D{{!define}})
% end
add_custom_target(
@@ -32,4 +32,14 @@ add_custom_target(
PLATFORMIO_CLEAN ALL
COMMAND ${PLATFORMIO_CMD} -f -c clion run --target clean
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
)
)
% if main_src_file:
add_executable({{project_name}} {{main_src_file}})
% else:
#
# To enable code auto-completion, please specify path
# to main source file (*.c, *.cpp) and uncomment line below
#
# add_executable({{project_name}} src/main_change_me.cpp)
% end

View File

@@ -21,6 +21,6 @@ OTHER_FILES += \
platformio.ini
SOURCES += \
% for file in srcfiles:
% for file in src_files:
{{file}}
% end

View File

@@ -13,7 +13,7 @@
<ItemGroup>
<None Include="platformio.ini" />
</ItemGroup>
% for file in srcfiles:
% for file in src_files:
<ItemGroup>
% if any([file.endswith(".%s" % e) for e in ("h", "hh", "hpp", "inc")]):
<ClInclude Include="{{file}}">

View File

@@ -41,13 +41,13 @@
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<NMakeBuildCommandLine>platformio -f -c visualstudio run</NMakeBuildCommandLine>
<NMakeCleanCommandLine>platformio -f -c visualstudio run --target clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>{{";".join(defines)}}</NMakePreprocessorDefinitions>
<NMakePreprocessorDefinitions>{{!";".join(defines)}}</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>{{";".join(["$(HOMEDRIVE)$(HOMEPATH)%s" % i.replace(user_home_dir, "") if i.startswith(user_home_dir) else i for i in includes])}}</NMakeIncludeSearchPath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
<NMakeBuildCommandLine>platformio run</NMakeBuildCommandLine>
<NMakeCleanCommandLine>platformio run --target clean</NMakeCleanCommandLine>
<NMakePreprocessorDefinitions>{";".join(defines)}}</NMakePreprocessorDefinitions>
<NMakePreprocessorDefinitions>{{!";".join(defines)}}</NMakePreprocessorDefinitions>
<NMakeIncludeSearchPath>{{";".join(["$(HOMEDRIVE)$(HOMEPATH)%s" % i.replace(user_home_dir, "") if i.startswith(user_home_dir) else i for i in includes])}}</NMakeIncludeSearchPath>
</PropertyGroup>
<ItemDefinitionGroup>
@@ -58,7 +58,7 @@
<ItemGroup>
<None Include="platformio.ini" />
</ItemGroup>
% for file in srcfiles:
% for file in src_files:
<ItemGroup>
% if any([file.endswith(".%s" % e) for e in ("h", "hh", "hpp", "inc")]):
<ClInclude Include="{{file}}">

View File

@@ -184,10 +184,12 @@ def check_platformio_upgrade():
click.echo("")
click.echo("*" * terminal_width)
click.secho("There is a new version %s of PlatformIO available.\n"
"Please upgrade it via " % latest_version,
"Please upgrade it via `" % latest_version,
fg="yellow", nl=False)
click.secho("platformio upgrade", fg="cyan", nl=False)
click.secho(" command.\nChanges: ", fg="yellow", nl=False)
click.secho("` or `", fg="yellow", nl=False)
click.secho("pip install -U platformio", fg="cyan", nl=False)
click.secho("` command.\nChanges: ", fg="yellow", nl=False)
click.secho("http://docs.platformio.org/en/latest/history.html",
fg="cyan")
click.echo("*" * terminal_width)

View File

@@ -3,8 +3,6 @@
import os
import re
import sys
from glob import glob
from imp import load_source
from os.path import isdir, isfile, join
@@ -374,7 +372,7 @@ class BasePlatform(object):
self._found_error = False
try:
# test that SCons is installed correctly
assert self.test_scons()
assert util.test_scons()
result = util.exec_command(
[
@@ -397,39 +395,6 @@ class BasePlatform(object):
return result
@staticmethod
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):
for p in sys.path:
try:
r = util.exec_command([join(p, "scons"), "--version"])
assert r['returncode'] == 0
os.environ['PATH'] += os.pathsep + p
return True
except (OSError, AssertionError):
pass
return False
def on_run_out(self, line):
self._echo_line(line, level=3)

View File

@@ -35,6 +35,10 @@ class TeensyPlatform(BasePlatform):
"default": True
},
"framework-mbed": {
"default": True
},
"tool-teensy": {
"alias": "uploader",
"default": True

View File

@@ -248,7 +248,7 @@ def measure_caller(calller_id):
"action": "Misc",
"label": calller_id
}
if calller_id in ProjectGenerator.get_supported_ides():
if calller_id in (["atom", "vim"] + ProjectGenerator.get_supported_ides()):
event['action'] = "IDE"
on_event(**event)

View File

@@ -7,13 +7,13 @@ import json
import os
import re
import subprocess
import sys
from glob import glob
from os.path import (abspath, basename, dirname, expanduser, isdir, isfile,
join, realpath)
from platform import system, uname
from threading import Thread
import requests
from platformio import __apiurl__, __version__, exception
try:
@@ -249,7 +249,8 @@ def get_serialports():
from serial.tools.list_ports_posix import comports
else:
raise exception.GetSerialPortsError(os.name)
return [{"port": p, "description": d, "hwid": h} for p, d, h in comports()]
return [{"port": p, "description": d, "hwid": h}
for p, d, h in comports() if p]
def get_logicaldisks():
@@ -276,12 +277,14 @@ def get_logicaldisks():
def get_request_defheaders():
import requests
return {"User-Agent": "PlatformIO/%s CI/%d %s" % (
__version__, int(is_ci()), requests.utils.default_user_agent()
)}
def get_api_result(path, params=None, data=None):
import requests
result = None
r = None
@@ -311,6 +314,53 @@ def get_api_result(path, params=None, data=None):
return result
def test_scons():
try:
r = 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 = exec_command(["scons", "--version"])
assert r['returncode'] == 0
return True
except (OSError, AssertionError):
for p in sys.path:
try:
r = exec_command([join(p, "scons"), "--version"])
assert r['returncode'] == 0
os.environ['PATH'] += os.pathsep + p
return True
except (OSError, AssertionError):
pass
return False
def install_scons():
r = exec_command(["pip", "install", "-U", "scons"])
if r['returncode'] != 0:
r = exec_command(["pip", "install", "--egg", "scons"])
return r['returncode'] == 0
def scons_in_pip():
r = exec_command(["pip", "list"])
if r['returncode'] != 0:
return False
return "scons (" in r['out'].lower()
@memoized
def _lookup_boards():
boards = {}

View File

@@ -3,5 +3,5 @@ click==5.1
colorama==0.3.3
lockfile==0.10.2
pyserial==2.7
requests==2.7.0
requests==2.8.0
scons==2.3.6

View File

@@ -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", "virtualenv", "platformio"]])
[["setuptools", "platformio"]])
]
if not IS_WINDOWS:

View File

@@ -6,7 +6,21 @@ from platform import system
from setuptools import find_packages, setup
from platformio import (__author__, __description__, __email__, __license__,
__title__, __url__, __version__)
__title__, __url__, __version__, util)
install_requires = [
"bottle",
"click>=3.2",
"lockfile>=0.9.1",
"pyserial<3",
"requests>=2.4.0"
]
if system() == "Windows":
install_requires.append("colorama")
if (not util.test_scons() and not util.install_scons()) or util.scons_in_pip():
install_requires.append("scons")
setup(
name=__title__,
@@ -17,14 +31,7 @@ setup(
author_email=__email__,
url=__url__,
license=__license__,
install_requires=[
"bottle",
"click>=3.2",
"lockfile>=0.9.1",
"pyserial",
"requests>=2.4.0",
"SCons"
] + (["colorama"] if system() == "Windows" else []),
install_requires=install_requires,
packages=find_packages(),
package_data={
"platformio": [