forked from platformio/platformio-core
Merge branch 'release/v0.10.0'
This commit is contained in:
75
HISTORY.rst
75
HISTORY.rst
@ -1,25 +1,46 @@
|
||||
Release History
|
||||
===============
|
||||
|
||||
0.10.0 (2015-01-01) Happy New Year!
|
||||
-----------------------------------
|
||||
|
||||
* Implemented `platformio boards <http://docs.platformio.org/en/latest/userguide/cmd_boards.html>`_
|
||||
command (`issue #11 <https://github.com/ivankravets/platformio/issues/11>`_)
|
||||
* Added support of *Engduino* boards for
|
||||
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html#engduino>`__
|
||||
platform (`issue #38 <https://github.com/ivankravets/platformio/issues/38>`_)
|
||||
* Added ``--board`` option to `platformio init <http://docs.platformio.org/en/latest/userguide/cmd_init.html>`_
|
||||
command which allows to initialise project with the specified embedded boards
|
||||
(`issue #21 <https://github.com/ivankravets/platformio/issues/21>`_)
|
||||
* Added `example with uploading firmware <http://docs.platformio.org/en/latest/projectconf.html#examples>`_
|
||||
via USB programmer (USBasp) for
|
||||
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html>`_
|
||||
*MCUs* (`issue #35 <https://github.com/ivankravets/platformio/issues/35>`_)
|
||||
* Automatic detection of port on `platformio serialports monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_
|
||||
(`issue #37 <https://github.com/ivankravets/platformio/issues/37>`_)
|
||||
* Allowed auto-installation of platforms when prompts are disabled (`issue #43 <https://github.com/ivankravets/platformio/issues/43>`_)
|
||||
* Fixed urllib3's *SSL* warning under Python <= 2.7.2 (`issue #39 <https://github.com/ivankravets/platformio/issues/39>`_)
|
||||
* Fixed bug with *Arduino USB* boards (`issue #40 <https://github.com/ivankravets/platformio/issues/40>`_)
|
||||
|
||||
|
||||
0.9.2 (2014-12-10)
|
||||
------------------
|
||||
|
||||
* Replaced "dark blue" by "cyan" colour for the texts (`issue #33 <https://github.com/ivankravets/platformio/issues/33>`_)
|
||||
* Added new setting `enable_prompts <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_settings.html>`_
|
||||
* Added new setting `enable_prompts <http://docs.platformio.org/en/latest/userguide/cmd_settings.html>`_
|
||||
and allowed to disable all *PlatformIO* prompts (useful for cloud compilers)
|
||||
(`issue #34 <https://github.com/ivankravets/platformio/issues/34>`_)
|
||||
* Fixed compilation bug on *Windows* with installed *MSVC* (`issue #18 <https://github.com/ivankravets/platformio/issues/18>`_)
|
||||
|
||||
|
||||
0.9.1 (2014-12-05)
|
||||
------------------
|
||||
|
||||
* Ask user to install platform (when it hasn't been installed yet) within
|
||||
`platformio run <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_run.html>`_
|
||||
and `platformio show <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_show.html>`_ commands
|
||||
* Improved main `documentation <http://docs.platformio.ikravets.com>`_
|
||||
`platformio run <http://docs.platformio.org/en/latest/userguide/cmd_run.html>`__
|
||||
and `platformio show <http://docs.platformio.org/en/latest/userguide/cmd_show.html>`_ commands
|
||||
* Improved main `documentation <http://docs.platformio.org>`_
|
||||
* Fixed "*OSError: [Errno 2] No such file or directory*" within
|
||||
`platformio run <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_run.html>`_
|
||||
`platformio run <http://docs.platformio.org/en/latest/userguide/cmd_run.html>`__
|
||||
command when PlatformIO isn't installed properly
|
||||
* Fixed example for `Eclipse IDE with Tiva board <https://github.com/ivankravets/platformio/tree/develop/examples/ide-eclipse>`_
|
||||
(`issue #32 <https://github.com/ivankravets/platformio/issues/32>`_)
|
||||
@ -29,8 +50,8 @@ Release History
|
||||
0.9.0 (2014-12-01)
|
||||
------------------
|
||||
|
||||
* Implemented `platformio settings <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_settings.html>`_ command
|
||||
* Improved `platformio init <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_init.html>`_ command.
|
||||
* Implemented `platformio settings <http://docs.platformio.org/en/latest/userguide/cmd_settings.html>`_ command
|
||||
* Improved `platformio init <http://docs.platformio.org/en/latest/userguide/cmd_init.html>`_ command.
|
||||
Added new option ``--project-dir`` where you can specify another path to
|
||||
directory where new project will be initialized (`issue #31 <https://github.com/ivankravets/platformio/issues/31>`_)
|
||||
* Added *Migration Manager* which simplifies process with upgrading to a
|
||||
@ -47,18 +68,18 @@ Release History
|
||||
0.8.0 (2014-10-19)
|
||||
------------------
|
||||
|
||||
* Avoided trademark issues in `library.json <http://docs.platformio.ikravets.com/en/latest/librarymanager/config.html>`_
|
||||
with the new fields: `frameworks <http://docs.platformio.ikravets.com/en/latest/librarymanager/config.html#frameworks>`_,
|
||||
`platforms <http://docs.platformio.ikravets.com/en/latest/librarymanager/config.html#platforms>`_
|
||||
and `dependencies <http://docs.platformio.ikravets.com/en/latest/librarymanager/config.html#dependencies>`_
|
||||
* Avoided trademark issues in `library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`_
|
||||
with the new fields: `frameworks <http://docs.platformio.org/en/latest/librarymanager/config.html#frameworks>`_,
|
||||
`platforms <http://docs.platformio.org/en/latest/librarymanager/config.html#platforms>`_
|
||||
and `dependencies <http://docs.platformio.org/en/latest/librarymanager/config.html#dependencies>`_
|
||||
(`issue #17 <https://github.com/ivankravets/platformio/issues/17>`_)
|
||||
* Switched logic from "Library Name" to "Library Registry ID" for all
|
||||
`platformio lib <http://docs.platformio.ikravets.com/en/latest/userguide/lib/index.html>`_
|
||||
`platformio lib <http://docs.platformio.org/en/latest/userguide/lib/index.html>`_
|
||||
commands (install, uninstall, update and etc.)
|
||||
* Renamed ``author`` field to `authors <http://docs.platformio.ikravets.com/en/latest/librarymanager/config.html#authors>`_
|
||||
and allowed to setup multiple authors per library in `library.json <http://docs.platformio.ikravets.com/en/latest/librarymanager/config.html>`_
|
||||
* Added option to specify "maintainer" status in `authors <http://docs.platformio.ikravets.com/en/latest/librarymanager/config.html#authors>`_ field
|
||||
* New filters/options for `platformio lib search <http://docs.platformio.ikravets.com/en/latest/userguide/lib/cmd_search.html>`_
|
||||
* Renamed ``author`` field to `authors <http://docs.platformio.org/en/latest/librarymanager/config.html#authors>`_
|
||||
and allowed to setup multiple authors per library in `library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`_
|
||||
* Added option to specify "maintainer" status in `authors <http://docs.platformio.org/en/latest/librarymanager/config.html#authors>`_ field
|
||||
* New filters/options for `platformio lib search <http://docs.platformio.org/en/latest/userguide/lib/cmd_search.html>`_
|
||||
command: ``--framework`` and ``--platform``
|
||||
|
||||
0.7.1 (2014-10-06)
|
||||
@ -72,15 +93,15 @@ Release History
|
||||
0.7.0 (2014-09-24)
|
||||
------------------
|
||||
|
||||
* Implemented new `[platformio] <http://docs.platformio.ikravets.com/en/latest/projectconf.html#platformio>`_
|
||||
section for Configuration File with `home_dir <http://docs.platformio.ikravets.com/en/latest/projectconf.html#home-dir>`_
|
||||
* Implemented new `[platformio] <http://docs.platformio.org/en/latest/projectconf.html#platformio>`_
|
||||
section for Configuration File with `home_dir <http://docs.platformio.org/en/latest/projectconf.html#home-dir>`_
|
||||
option (`issue #14 <https://github.com/ivankravets/platformio/issues/14>`_)
|
||||
* Implemented *Library Manager* (`issue #6 <https://github.com/ivankravets/platformio/issues/6>`_)
|
||||
|
||||
0.6.0 (2014-08-09)
|
||||
------------------
|
||||
|
||||
* Implemented `platformio serialports monitor <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ (`issue #10 <https://github.com/ivankravets/platformio/issues/10>`_)
|
||||
* Implemented `platformio serialports monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ (`issue #10 <https://github.com/ivankravets/platformio/issues/10>`_)
|
||||
* Fixed an issue ``ImportError: No module named platformio.util`` (`issue #9 <https://github.com/ivankravets/platformio/issues/9>`_)
|
||||
* Fixed bug with auto-conversation from Arduino \*.ino to \*.cpp
|
||||
|
||||
@ -93,7 +114,7 @@ Release History
|
||||
frameworks (`issue #7 <https://github.com/ivankravets/platformio/issues/7>`_)
|
||||
* Added `Arduino example <https://github.com/ivankravets/platformio/tree/develop/examples/arduino-adafruit-library>`_
|
||||
with external library (*Adafruit CC3000*)
|
||||
* Implemented `platformio upgrade <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_upgrade.html>`_
|
||||
* Implemented `platformio upgrade <http://docs.platformio.org/en/latest/userguide/cmd_upgrade.html>`_
|
||||
command and "auto-check" for the latest
|
||||
version (`issue #8 <https://github.com/ivankravets/platformio/issues/8>`_)
|
||||
* Fixed an issue with "auto-reset" for *Raspduino* board
|
||||
@ -102,21 +123,21 @@ Release History
|
||||
0.4.0 (2014-07-31)
|
||||
------------------
|
||||
|
||||
* Implemented `platformio serialports <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_serialports.html>`_ command
|
||||
* Implemented `platformio serialports <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html>`_ command
|
||||
* Allowed to put special build flags only for ``src`` files via
|
||||
`srcbuild_flags <http://docs.platformio.ikravets.com/en/latest/projectconf.html#srcbuild-flags>`_
|
||||
`srcbuild_flags <http://docs.platformio.org/en/latest/projectconf.html#srcbuild-flags>`_
|
||||
environment option
|
||||
* Allowed to override some of settings via system environment variables
|
||||
such as: ``$PIOSRCBUILD_FLAGS`` and ``$PIOENVS_DIR``
|
||||
* Added ``--upload-port`` option for `platformio run <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_run.html#cmdoption--upload-port>`_ command
|
||||
* Added ``--upload-port`` option for `platformio run <http://docs.platformio.org/en/latest/userguide/cmd_run.html#cmdoption--upload-port>`__ command
|
||||
* Implemented (especially for `SmartAnthill <http://smartanthill.ikravets.com/>`_)
|
||||
`platformio run -t uploadlazy <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_run.html>`_
|
||||
`platformio run -t uploadlazy <http://docs.platformio.org/en/latest/userguide/cmd_run.html>`_
|
||||
target (no dependencies to framework libs, ELF and etc.)
|
||||
* Allowed to skip default packages via `platformio install --skip-default-package <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_install.html#cmdoption--skip-default>`_
|
||||
* Allowed to skip default packages via `platformio install --skip-default-package <http://docs.platformio.org/en/latest/userguide/cmd_install.html#cmdoption--skip-default>`_
|
||||
option
|
||||
* Added tools for *Raspberry Pi* platform
|
||||
* Added support for *Microduino* and *Raspduino* boards in
|
||||
`atmelavr <http://docs.platformio.ikravets.com/en/latest/platforms/atmelavr.html>`_ platform
|
||||
`atmelavr <http://docs.platformio.org/en/latest/platforms/atmelavr.html>`_ platform
|
||||
|
||||
|
||||
0.3.1 (2014-06-21)
|
||||
|
2
LICENSE
2
LICENSE
@ -1,6 +1,6 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Ivan Kravets
|
||||
Copyright (c) 2014-2015 Ivan Kravets
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
62
README.rst
62
README.rst
@ -17,26 +17,26 @@ PlatformIO
|
||||
:target: https://pypi.python.org/pypi/platformio/
|
||||
:alt: License
|
||||
|
||||
`Website + Library Search <http://platformio.ikravets.com>`_ |
|
||||
`Documentation <http://docs.platformio.ikravets.com>`_ |
|
||||
`Website + Library Search <http://platformio.org>`_ |
|
||||
`Documentation <http://docs.platformio.org>`_ |
|
||||
`Project Examples <https://github.com/ivankravets/platformio/tree/develop/examples>`_ |
|
||||
`Blog <http://www.ikravets.com/category/computer-life/platformio>`_ |
|
||||
`Twitter <https://twitter.com/PlatformIOTool>`_
|
||||
`Twitter <https://twitter.com/PlatformIO_Org>`_
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/ivankravets/platformio/develop/docs/_static/platformio-logo.png
|
||||
:target: http://platformio.ikravets.com
|
||||
:target: http://platformio.org
|
||||
|
||||
`PlatformIO <http://platformio.ikravets.com>`_ is a cross-platform code builder
|
||||
`PlatformIO <http://platformio.org>`_ is a cross-platform code builder
|
||||
and the missing library manager.
|
||||
|
||||
* `Get Started <http://platformio.ikravets.com/#!/get-started>`_
|
||||
* `Web 2.0 Library Search <http://platformio.ikravets.com/#!/lib>`_
|
||||
* `Development Platforms <http://platformio.ikravets.com/#!/platforms>`_
|
||||
* `Embedded Boards <http://platformio.ikravets.com/#!/boards>`_
|
||||
* `Library Manager <http://docs.platformio.ikravets.com/en/latest/librarymanager/index.html>`_
|
||||
* `User Guide <http://docs.platformio.ikravets.com/en/latest/userguide/index.html>`_
|
||||
* `IDE Integration <http://docs.platformio.ikravets.com/en/latest/ide.html>`_
|
||||
* `Release History <http://docs.platformio.ikravets.com/en/latest/history.html>`_
|
||||
* `Get Started <http://platformio.org/#!/get-started>`_
|
||||
* `Web 2.0 Library Search <http://platformio.org/#!/lib>`_
|
||||
* `Development Platforms <http://platformio.org/#!/platforms>`_
|
||||
* `Embedded Boards <http://platformio.org/#!/boards>`_
|
||||
* `Library Manager <http://docs.platformio.org/en/latest/librarymanager/index.html>`_
|
||||
* `User Guide <http://docs.platformio.org/en/latest/userguide/index.html>`_
|
||||
* `IDE Integration <http://docs.platformio.org/en/latest/ide.html>`_
|
||||
* `Release History <http://docs.platformio.org/en/latest/history.html>`_
|
||||
|
||||
You have **no need** to install any *IDE* or compile any tool chains. *PlatformIO*
|
||||
has pre-built different development platforms including: compiler, debugger,
|
||||
@ -52,18 +52,18 @@ sized computers (like *Raspberry Pi*).
|
||||
Embedded Development. *Easier Than Ever.*
|
||||
-----------------------------------------
|
||||
*PlatformIO* is well suited for embedded development and has pre-configured
|
||||
settings for most popular `Embedded Boards <http://platformio.ikravets.com/#!/boards>`_.
|
||||
settings for most popular `Embedded Boards <http://platformio.org/#!/boards>`_.
|
||||
|
||||
* Colourful `command-line output <https://raw.githubusercontent.com/ivankravets/platformio/develop/examples/platformio-examples.png>`_
|
||||
* Built-in `Serial Port Monitor <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_
|
||||
* Configurable `build -flags/-options <http://docs.platformio.ikravets.com/en/latest/projectconf.html#build-flags>`_
|
||||
* Built-in `Serial Port Monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_
|
||||
* Configurable `build -flags/-options <http://docs.platformio.org/en/latest/projectconf.html#build-flags>`_
|
||||
* Automatic **firmware uploading**
|
||||
* Integration with `development environments (IDE) <http://docs.platformio.ikravets.com/en/latest/ide.html>`_
|
||||
* Integration with `development environments (IDE) <http://docs.platformio.org/en/latest/ide.html>`_
|
||||
* Ready for **cloud compilers**
|
||||
* Pre-built tool chains, frameworks for the popular `Hardware Platforms <http://platformio.ikravets.com/#!/platforms>`_
|
||||
* Pre-built tool chains, frameworks for the popular `Hardware Platforms <http://platformio.org/#!/platforms>`_
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/ivankravets/platformio-web/develop/app/images/platformio-embedded-development.png
|
||||
:target: http://platformio.ikravets.com
|
||||
:target: http://platformio.org
|
||||
:alt: PlatformIO Embedded Development Process
|
||||
|
||||
The Missing Library Manager. *It's here!*
|
||||
@ -71,16 +71,16 @@ The Missing Library Manager. *It's here!*
|
||||
*PlatformIO Library Manager* is the missing library manager for development
|
||||
platforms which allows you to organize and have up-to-date external libraries.
|
||||
|
||||
* Friendly `Command-Line Interface <http://docs.platformio.ikravets.com/en/latest/librarymanager/index.html>`_
|
||||
* Modern `Web 2.0 Library Search <http://platformio.ikravets.com/#!/lib>`_
|
||||
* Friendly `Command-Line Interface <http://docs.platformio.org/en/latest/librarymanager/index.html>`_
|
||||
* Modern `Web 2.0 Library Search <http://platformio.org/#!/lib>`_
|
||||
* Open Source `Library Registry API <https://github.com/ivankravets/platformio-api>`_
|
||||
* Library Crawler based on `library.json <http://docs.platformio.ikravets.com/en/latest/librarymanager/config.html>`_
|
||||
* Library Crawler based on `library.json <http://docs.platformio.org/en/latest/librarymanager/config.html>`_
|
||||
specification
|
||||
* Library **dependency management**
|
||||
* Automatic library updating
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/ivankravets/platformio-web/develop/app/images/platformio-library-manager.png
|
||||
:target: http://platformio.ikravets.com
|
||||
:target: http://platformio.org
|
||||
:alt: PlatformIO Library Manager Architecture
|
||||
|
||||
Smart Code Builder. *Fast and Reliable.*
|
||||
@ -93,36 +93,36 @@ cross-platform substitute for the classic *Make* utility.
|
||||
* Reliable detection of *build changes*
|
||||
* Improved support for *parallel builds*
|
||||
* Ability to share *built files in a cache*
|
||||
* Lookup for external libraries which are installed via `Library Manager <http://docs.platformio.ikravets.com/en/latest/librarymanager/index.html>`_
|
||||
* Lookup for external libraries which are installed via `Library Manager <http://docs.platformio.org/en/latest/librarymanager/index.html>`_
|
||||
|
||||
.. image:: https://raw.githubusercontent.com/ivankravets/platformio-web/develop/app/images/platformio-scons-builder.png
|
||||
:target: http://platformio.ikravets.com
|
||||
:target: http://platformio.org
|
||||
:alt: PlatformIO Code Builder Architecture
|
||||
|
||||
Single source code. *Multiple platforms.*
|
||||
-----------------------------------------
|
||||
*PlatformIO* allows developer to compile the same code with different
|
||||
development platforms using the *Only One Command*
|
||||
`platformio run <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_run.html>`_.
|
||||
`platformio run <http://docs.platformio.org/en/latest/userguide/cmd_run.html>`_.
|
||||
This happens due to
|
||||
`Project Configuration File (platformio.ini) <http://docs.platformio.ikravets.com/en/latest/projectconf.html>`_
|
||||
`Project Configuration File (platformio.ini) <http://docs.platformio.org/en/latest/projectconf.html>`_
|
||||
where you can setup different environments with specific options (platform
|
||||
type, firmware uploading settings, pre-built framework, build flags and many
|
||||
more).
|
||||
|
||||
It has support for many popular embedded platforms like these:
|
||||
|
||||
* ``atmelavr`` `Atmel AVR <http://platformio.ikravets.com/#!/platforms/atmelavr>`_
|
||||
* ``atmelavr`` `Atmel AVR <http://platformio.org/#!/platforms/atmelavr>`_
|
||||
(including *Arduino*-based boards, *Microduino, Raspduino, Teensy*)
|
||||
* ``timsp430`` `TI MSP430 <http://platformio.ikravets.com/#!/platforms/timsp430>`_
|
||||
* ``timsp430`` `TI MSP430 <http://platformio.org/#!/platforms/timsp430>`_
|
||||
(including *MSP430* LaunchPads)
|
||||
* ``titiva`` `TI TIVA C <http://platformio.ikravets.com/#!/platforms/titiva>`_
|
||||
* ``titiva`` `TI TIVA C <http://platformio.org/#!/platforms/titiva>`_
|
||||
(including *TIVA C* Series LaunchPads)
|
||||
|
||||
|
||||
Licence
|
||||
-------
|
||||
|
||||
Copyright (C) 2014 Ivan Kravets
|
||||
Copyright (C) 2014-2015 Ivan Kravets
|
||||
|
||||
Licenced under the MIT Licence.
|
||||
|
@ -45,7 +45,7 @@ master_doc = 'index'
|
||||
|
||||
# General information about the project.
|
||||
project = u'PlatformIO'
|
||||
copyright = u'2014, Ivan Kravets'
|
||||
copyright = u'2014-2015, Ivan Kravets'
|
||||
|
||||
# The version info for the project you're documenting, acts as replacement for
|
||||
# |version| and |release|, also used in various other places throughout the
|
||||
|
@ -2,14 +2,14 @@ PlatformIO: A cross-platform code builder and the missing library manager
|
||||
=========================================================================
|
||||
|
||||
.. image:: _static/platformio-logo.png
|
||||
:target: http://platformio.ikravets.com
|
||||
:target: http://platformio.org
|
||||
|
||||
`Website + Library Search <http://platformio.ikravets.com>`_ |
|
||||
`Website + Library Search <http://platformio.org>`_ |
|
||||
`Project Examples <https://github.com/ivankravets/platformio/tree/develop/examples>`_ |
|
||||
`Source Code <https://github.com/ivankravets/platformio>`_ |
|
||||
`Issues <https://github.com/ivankravets/platformio/issues>`_ |
|
||||
`Blog <http://www.ikravets.com/category/computer-life/platformio>`_ |
|
||||
`Twitter <https://twitter.com/PlatformIOTool>`_
|
||||
`Twitter <https://twitter.com/PlatformIO_Org>`_
|
||||
|
||||
You have no need to install any *IDE* or compile any tool chains. *PlatformIO*
|
||||
has pre-built different development platforms including: compiler, debugger,
|
||||
|
@ -9,7 +9,7 @@ Library Manager
|
||||
|
||||
*PlatformIO Library Manager* allows you to organize external embedded libraries.
|
||||
You can search for new libraries via :ref:`Command Line interface <cmd_lib_search>`
|
||||
or `Web 2.0 Library Search <http://platformio.ikravets.com/#!/lib>`_.
|
||||
or `Web 2.0 Library Search <http://platformio.org/#!/lib>`_.
|
||||
|
||||
You don't need to bother for finding the latest version of library. Due to
|
||||
:ref:`cmd_lib_update` command you will have up-to-date external libraries.
|
||||
|
@ -59,8 +59,9 @@ Boards
|
||||
------
|
||||
|
||||
.. note::
|
||||
For more detailed ``board`` information please scroll tables below by
|
||||
horizontal.
|
||||
* You can list pre-configured boards by :ref:`cmd_boards` command
|
||||
* For more detailed ``board`` information please scroll tables below by
|
||||
horizontal.
|
||||
|
||||
Arduino
|
||||
~~~~~~~
|
||||
@ -218,6 +219,41 @@ More detailed information you can find here
|
||||
`Arduino boards <http://arduino.cc/en/Main/Products>`_.
|
||||
|
||||
|
||||
Engduino
|
||||
~~~~~~~~
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
||||
* - Type ``board``
|
||||
- Name
|
||||
- Microcontroller ``board_mcu``
|
||||
- Frequency ``board_f_cpu``
|
||||
- Flash
|
||||
- RAM
|
||||
* - ``engduinov1``
|
||||
- `Engduino 1 <http://www.engduino.org>`_
|
||||
- ATmega32u4 ``atmega32u4``
|
||||
- 8 MHz ``8000000L``
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
* - ``engduinov2``
|
||||
- `Engduino 2 <http://www.engduino.org>`_
|
||||
- ATmega32u4 ``atmega32u4``
|
||||
- 8 MHz ``8000000L``
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
* - ``engduinov3``
|
||||
- `Engduino 3 <http://www.engduino.org>`_
|
||||
- ATmega32u4 ``atmega32u4``
|
||||
- 8 MHz ``8000000L``
|
||||
- 32 Kb
|
||||
- 2.5 Kb
|
||||
|
||||
More detailed information you can find here
|
||||
`Engduino Site <http://www.engduino.org>`_.
|
||||
|
||||
|
||||
Microduino
|
||||
~~~~~~~~~~
|
||||
|
||||
@ -319,5 +355,5 @@ Raspduino
|
||||
- 32 Kb
|
||||
- 2 Kb
|
||||
|
||||
More detailed information you can find in
|
||||
More detailed information you can find here
|
||||
`Wiki <http://www.bitwizard.nl/wiki/index.php/Raspduino>`_.
|
||||
|
@ -56,8 +56,9 @@ Boards
|
||||
------
|
||||
|
||||
.. note::
|
||||
For more detailed ``board`` information please scroll table below by
|
||||
horizontal.
|
||||
* You can list pre-configured boards by :ref:`cmd_boards` command
|
||||
* For more detailed ``board`` information please scroll tables below by
|
||||
horizontal.
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
@ -56,8 +56,9 @@ Boards
|
||||
------
|
||||
|
||||
.. note::
|
||||
For more detailed ``board`` information please scroll table below by
|
||||
horizontal.
|
||||
* You can list pre-configured boards by :ref:`cmd_boards` command
|
||||
* For more detailed ``board`` information please scroll tables below by
|
||||
horizontal.
|
||||
|
||||
.. list-table::
|
||||
:header-rows: 1
|
||||
|
@ -8,7 +8,7 @@ The Project configuration file is named ``platformio.ini``. This is a
|
||||
|
||||
``platformio.ini`` has sections (each denoted by a ``[header]``) and
|
||||
key / value pairs within the sections. A sign ``#`` at the beginning of the
|
||||
line indicate a comment. Comment lines are ignored.
|
||||
line indicates a comment. Comment lines are ignored.
|
||||
|
||||
The sections and their allowable values are described below.
|
||||
|
||||
@ -58,18 +58,24 @@ For example, ``[env:hello_world]``.
|
||||
Options
|
||||
~~~~~~~
|
||||
|
||||
.. _projectconf_env_platform:
|
||||
|
||||
``platform``
|
||||
^^^^^^^^^^^^
|
||||
|
||||
:ref:`Platform <platforms>` type
|
||||
|
||||
|
||||
.. _projectconf_env_framework:
|
||||
|
||||
``framework``
|
||||
^^^^^^^^^^^^^
|
||||
|
||||
See ``framework`` type in *Frameworks* section of :ref:`platforms`
|
||||
|
||||
|
||||
.. _projectconf_env_board:
|
||||
|
||||
``board``
|
||||
^^^^^^^^^
|
||||
|
||||
@ -246,7 +252,7 @@ Examples
|
||||
``board_*`` and ``upload_*`` options (use only ``board`` option) and Arduino
|
||||
Wiring-based Framework
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:atmelavr_arduino_uno_board]
|
||||
platform = atmelavr
|
||||
@ -261,7 +267,7 @@ Examples
|
||||
auto pre-configured ``board_*`` and ``upload_*`` options (use only
|
||||
``board`` option) and Arduino Wiring-based Framework
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:atmelavr_microduino_core_board]
|
||||
platform = atmelavr
|
||||
@ -276,7 +282,7 @@ Examples
|
||||
auto pre-configured ``board_*`` and ``upload_*`` options (use only
|
||||
``board`` option) and Arduino Wiring-based Framework
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:atmelavr_raspduino_board]
|
||||
platform = atmelavr
|
||||
@ -292,7 +298,7 @@ Examples
|
||||
4. :ref:`platform_atmelavr`: Embedded board that is based on ATmega168 MCU with
|
||||
"arduino" bootloader
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:atmelavr_atmega168_board]
|
||||
platform = atmelavr
|
||||
@ -309,11 +315,23 @@ Examples
|
||||
targets = upload
|
||||
|
||||
|
||||
5. :ref:`platform_timsp430`: TI MSP430G2553 LaunchPad with auto pre-configured
|
||||
5. Upload firmware via USB programmer (USBasp) to :ref:`platform_atmelavr`
|
||||
microcontrollers
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
[env:atmelavr_usbasp]
|
||||
platform = atmelavr
|
||||
framework = arduino
|
||||
board = pro8MHzatmega328
|
||||
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
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:timsp430_g2553_launchpad]
|
||||
platform = timsp430
|
||||
@ -321,9 +339,9 @@ Examples
|
||||
board = lpmsp430g2553
|
||||
|
||||
|
||||
6. :ref:`platform_timsp430`: Embedded board that is based on MSP430G2553 MCU
|
||||
7. :ref:`platform_timsp430`: Embedded board that is based on MSP430G2553 MCU
|
||||
|
||||
.. code-block:: ini
|
||||
.. code-block:: ini
|
||||
|
||||
[env:timsp430_g2553_board]
|
||||
platform = timsp430
|
||||
@ -336,11 +354,11 @@ Examples
|
||||
targets = upload
|
||||
|
||||
|
||||
5. :ref:`platform_titiva`: TI Tiva C ARM Series TM4C123G LaunchPad with auto
|
||||
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
|
||||
.. code-block:: ini
|
||||
|
||||
[env:titiva_tm4c1230c3pm_launchpad]
|
||||
platform = titiva
|
||||
|
@ -4,36 +4,21 @@ Quickstart
|
||||
==========
|
||||
|
||||
.. note::
|
||||
Please read `Get Started <http://platformio.ikravets.com/#!/get-started>`_
|
||||
Please read `Get Started <http://platformio.org/#!/get-started>`_
|
||||
article from the official WebSite.
|
||||
|
||||
First, :ref:`Install PlatformIO <installation>`.
|
||||
1. :ref:`Install PlatformIO <installation>`.
|
||||
|
||||
Print all available development platforms for installing
|
||||
2. Find board ``type`` from :ref:`platforms` (you can choose multiple board
|
||||
types).
|
||||
|
||||
3. Initialize new PlatformIO based project with the pre-configured
|
||||
environments for your boards:
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio search
|
||||
[ ... ]
|
||||
$ platformio init --board=TYPE1 --board=TYPE2
|
||||
|
||||
|
||||
Install new development platform
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio install PLATFORM
|
||||
Downloading [####################################] 100%
|
||||
Unpacking [####################################] 100%
|
||||
Installing .....
|
||||
[ ... ]
|
||||
The platform 'PLATFORM' has been successfully installed!
|
||||
|
||||
|
||||
Initialize new PlatformIO based project
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio init
|
||||
The current working directory *** will be used for the new project.
|
||||
You can specify another project directory via
|
||||
`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.
|
||||
@ -46,29 +31,23 @@ Initialize new PlatformIO based project
|
||||
Project has been successfully initialized!
|
||||
Now you can process it with `platformio run` command.
|
||||
|
||||
More detailed information about this command is here :ref:`cmd_init`.
|
||||
|
||||
Setup environments in ``platformio.ini``. For more examples go to
|
||||
:ref:`Project Configuration File <projectconf_examples>`
|
||||
|
||||
.. code-block:: ini
|
||||
|
||||
# Simple and base environment
|
||||
[env:mybaseenv]
|
||||
platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
|
||||
|
||||
Process the project's environments
|
||||
4. Process the project's environments.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio run
|
||||
|
||||
# if embedded project then upload firmware
|
||||
# if you don't have specified `targets = upload` option for environment,
|
||||
# then you can upload firmware manually with this command:
|
||||
$ platformio run --target upload
|
||||
|
||||
# clean project
|
||||
$ platformio run --target clean
|
||||
|
||||
If you don't have installed required platforms, then *PlatformIO* will propose
|
||||
you to install them automatically.
|
||||
|
||||
Further examples can be found in the ``examples/`` directory in the source
|
||||
distribution or `on the web <https://github.com/ivankravets/platformio/tree/develop/examples>`_.
|
||||
|
86
docs/userguide/cmd_boards.rst
Normal file
86
docs/userguide/cmd_boards.rst
Normal file
@ -0,0 +1,86 @@
|
||||
.. _cmd_boards:
|
||||
|
||||
platformio boards
|
||||
=================
|
||||
|
||||
.. contents::
|
||||
|
||||
Usage
|
||||
-----
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Print all available pre-configured embedded boards
|
||||
platformio boards
|
||||
|
||||
# Filter boards by "Query"
|
||||
platformio boards QUERY
|
||||
|
||||
|
||||
Description
|
||||
-----------
|
||||
|
||||
List pre-configured Embedded Boards
|
||||
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
1. Show Arduino-based boards
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio boards arduino
|
||||
|
||||
Platform: atmelavr
|
||||
---------------------------------------------------------------------------
|
||||
Type MCU Frequency Flash RAM Name
|
||||
---------------------------------------------------------------------------
|
||||
btatmega168 atmega168 16Mhz 14Kb 1Kb Arduino BT ATmega168
|
||||
btatmega328 atmega328p 16Mhz 28Kb 2Kb Arduino BT ATmega328
|
||||
diecimilaatmega168 atmega168 16Mhz 14Kb 1Kb Arduino Duemilanove or Diecimila ATmega168
|
||||
diecimilaatmega328 atmega328p 16Mhz 30Kb 2Kb Arduino Duemilanove or Diecimila ATmega328
|
||||
esplora atmega32u4 16Mhz 28Kb 2Kb Arduino Esplora
|
||||
ethernet atmega328p 16Mhz 31Kb 2Kb Arduino Ethernet
|
||||
...
|
||||
|
||||
|
||||
2. Show boards which are based on ``ATmega168`` MCU
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio boards atmega168
|
||||
|
||||
Platform: atmelavr
|
||||
---------------------------------------------------------------------------
|
||||
Type MCU Frequency Flash RAM Name
|
||||
---------------------------------------------------------------------------
|
||||
btatmega168 atmega168 16Mhz 14Kb 1Kb Arduino BT ATmega168
|
||||
diecimilaatmega168 atmega168 16Mhz 14Kb 1Kb Arduino Duemilanove or Diecimila ATmega168
|
||||
miniatmega168 atmega168 16Mhz 14Kb 1Kb Arduino Mini ATmega168
|
||||
atmegangatmega168 atmega168 16Mhz 14Kb 1Kb Arduino NG or older ATmega168
|
||||
nanoatmega168 atmega168 16Mhz 14Kb 1Kb Arduino Nano ATmega168
|
||||
pro8MHzatmega168 atmega168 8Mhz 14Kb 1Kb Arduino Pro or Pro Mini ATmega168 (3.3V, 8 MHz)
|
||||
pro16MHzatmega168 atmega168 16Mhz 14Kb 1Kb Arduino Pro or Pro Mini ATmega168 (5V, 16 MHz)
|
||||
lilypadatmega168 atmega168 8Mhz 14Kb 1Kb LilyPad Arduino ATmega168
|
||||
168pa16m atmega168p 16Mhz 15Kb 1Kb Microduino Core (Atmega168PA@16M,5V)
|
||||
168pa8m atmega168p 8Mhz 15Kb 1Kb Microduino Core (Atmega168PA@8M,3.3V)
|
||||
|
||||
3. Show boards by :ref:`platform_timsp430`
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio boards timsp430
|
||||
|
||||
Platform: timsp430
|
||||
---------------------------------------------------------------------------
|
||||
Type MCU Frequency Flash RAM Name
|
||||
---------------------------------------------------------------------------
|
||||
lpmsp430fr5739 msp430fr5739 16Mhz 15Kb 1Kb FraunchPad w/ msp430fr5739
|
||||
lpmsp430f5529 msp430f5529 16Mhz 128Kb 1Kb LaunchPad w/ msp430f5529 (16MHz)
|
||||
lpmsp430f5529_25 msp430f5529 25Mhz 128Kb 1Kb LaunchPad w/ msp430f5529 (25MHz)
|
||||
lpmsp430fr5969 msp430fr5969 8Mhz 64Kb 1Kb LaunchPad w/ msp430fr5969
|
||||
lpmsp430g2231 msp430g2231 1Mhz 2Kb 128B LaunchPad w/ msp430g2231 (1MHz)
|
||||
lpmsp430g2452 msp430g2452 16Mhz 8Kb 256B LaunchPad w/ msp430g2452 (16MHz)
|
||||
lpmsp430g2553 msp430g2553 16Mhz 16Kb 512B LaunchPad w/ msp430g2553 (16MHz)
|
||||
|
@ -32,8 +32,27 @@ Options
|
||||
.. option::
|
||||
--project-dir, -d
|
||||
|
||||
Specified path to the directory where *PlatformIO* will initialize new project.
|
||||
A path to the directory where *PlatformIO* will initialise new project.
|
||||
|
||||
.. option::
|
||||
--board, -b
|
||||
|
||||
If you specify board ``type`` (you can pass multiple ``--board`` options), then
|
||||
*PlatformIO* will automatically generate environment for :ref:`projectconf` and
|
||||
pre-fill these data:
|
||||
|
||||
* :ref:`projectconf_env_platform`
|
||||
* :ref:`projectconf_env_framework`
|
||||
* :ref:`projectconf_env_board`
|
||||
|
||||
The full list with pre-configured boards is available here :ref:`platforms`.
|
||||
|
||||
.. option::
|
||||
--disable-auto-uploading
|
||||
|
||||
If you initialise project with the specified ``--board``, then *PlatformIO*
|
||||
will create environment with enabled firmware auto-uploading. This option
|
||||
allows you to disable firmware auto-uploading by default.
|
||||
|
||||
Examples
|
||||
--------
|
||||
@ -43,6 +62,7 @@ Examples
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio init
|
||||
|
||||
The current working directory *** will be used for the new project.
|
||||
You can specify another project directory via
|
||||
`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.
|
||||
@ -61,6 +81,21 @@ Examples
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio init -d %PATH_TO_DIR%
|
||||
|
||||
The next files/directories will be created in ***
|
||||
platformio.ini - Project Configuration File
|
||||
src - a source directory. Put your source code here
|
||||
lib - a directory for the project specific libraries
|
||||
Do you want to continue? [y/N]: y
|
||||
Project has been successfully initialized!
|
||||
Now you can process it with `platformio run` command.
|
||||
|
||||
3. Initialise project for Arduino Uno
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio init --board uno
|
||||
|
||||
The next files/directories will be created in ***
|
||||
platformio.ini - Project Configuration File
|
||||
src - a source directory. Put your source code here
|
||||
|
@ -14,6 +14,7 @@ To print all available commands and options use:
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
cmd_boards
|
||||
cmd_init
|
||||
cmd_install
|
||||
platformio lib <lib/index>
|
||||
|
@ -17,7 +17,7 @@ Description
|
||||
-----------
|
||||
|
||||
Install new library by specified
|
||||
`PlatformIO Library Registry ID <http://platformio.ikravets.com/#!/lib>`_.
|
||||
`PlatformIO Library Registry ID <http://platformio.org/#!/lib>`_.
|
||||
|
||||
Options
|
||||
-------
|
||||
@ -35,7 +35,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# IRremote: http://platformio.ikravets.com/#!/lib/show/4/IRremote
|
||||
# IRremote: http://platformio.org/#!/lib/show/4/IRremote
|
||||
$ platformio lib install 4
|
||||
# Installing library [ 4 ]:
|
||||
# Downloading [####################################] 100%
|
||||
@ -47,7 +47,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# XBee: http://platformio.ikravets.com/#!/lib/show/6/XBee
|
||||
# XBee: http://platformio.org/#!/lib/show/6/XBee
|
||||
$ platformio lib install 6 --version=0.5
|
||||
# Installing library [ 6 ]:
|
||||
# Downloading [####################################] 100%
|
||||
@ -59,7 +59,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# Adafruit-ST7735: http://platformio.ikravets.com/#!/lib/show/12/Adafruit-ST7735
|
||||
# Adafruit-ST7735: http://platformio.org/#!/lib/show/12/Adafruit-ST7735
|
||||
$ platformio lib install 12
|
||||
# Installing library [ 12 ]:
|
||||
# Downloading [####################################] 100%
|
||||
|
@ -16,7 +16,7 @@ Usage
|
||||
Description
|
||||
-----------
|
||||
|
||||
Search for library in `PlatformIO Library Registry <http://platformio.ikravets.com/#!/lib>`_
|
||||
Search for library in `PlatformIO Library Registry <http://platformio.org/#!/lib>`_
|
||||
by :ref:`library_config` fields in the boolean mode.
|
||||
|
||||
The boolean search capability supports the following operators:
|
||||
@ -108,7 +108,7 @@ Examples
|
||||
# Show next libraries? [y/N]:
|
||||
# ...
|
||||
|
||||
2. Search for `1-Wire libraries <http://platformio.ikravets.com/#!/lib/search?query=%25221-wire%2522>`_
|
||||
2. Search for `1-Wire libraries <http://platformio.org/#!/lib/search?query=%25221-wire%2522>`_
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -120,7 +120,7 @@ Examples
|
||||
# [ 1 ] OneWire arduino, atmelavr "Paul Stoffregen": Control devices (from Dallas Semiconductor) that use the One Wire protocol (DS18S20, DS18B20, DS2408 and etc)
|
||||
# ...
|
||||
|
||||
3. Search for `Arduino-based "I2C" libraries <http://platformio.ikravets.com/#!/lib/search?query=framework%253Aarduino%2520i2c&page=1>`_
|
||||
3. Search for `Arduino-based "I2C" libraries <http://platformio.org/#!/lib/search?query=framework%253Aarduino%2520i2c>`_
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -135,7 +135,7 @@ Examples
|
||||
# [ 14 ] Adafruit-9DOF-Unified arduino, atmelavr "Adafruit Industries": Unified sensor driver for the Adafruit 9DOF Breakout (L3GD20 / LSM303)
|
||||
# ...
|
||||
|
||||
4. Search for `libraries by "web" and "http" keywords <http://platformio.ikravets.com/#!/lib/search?query=keyword%253A%2522web%2522%2520keyword%253A%2522http%2522&page=1>`_.
|
||||
4. Search for `libraries by "web" and "http" keywords <http://platformio.org/#!/lib/search?query=keyword%253A%2522web%2522%2520keyword%253A%2522http%2522>`_.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -148,7 +148,7 @@ Examples
|
||||
# [ 17 ] Adafruit-CC3000 arduino, atmelavr "Adafruit Industries": Library code for Adafruit's CC3000 Wi-Fi/WiFi breakouts
|
||||
# ...
|
||||
|
||||
5. Search for `libraries from "Adafruit Industries" author <http://platformio.ikravets.com/#!/lib/search?query=author%253A%2522Adafruit%20Industries%2522>`_
|
||||
5. Search for `libraries by "Adafruit Industries" author <http://platformio.org/#!/lib/search?query=author%253A%2522Adafruit%20Industries%2522>`_
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
@ -163,7 +163,7 @@ Examples
|
||||
# [ 26 ] Adafruit-LSM303DLHC-Unified arduino, atmelavr "Adafruit Industries": Unified sensor driver for Adafruit's LSM303 Breakout (Accelerometer + Magnetometer)
|
||||
# ...
|
||||
|
||||
6. Search for `libraries that are compatible with Dallas temperature sensors <http://platformio.ikravets.com/#!/lib/search?query=DS*>`_
|
||||
6. Search for `libraries which are compatible with Dallas temperature sensors <http://platformio.org/#!/lib/search?query=DS*>`_
|
||||
like DS18B20, DS18S20 and etc.
|
||||
|
||||
.. code-block:: bash
|
||||
@ -176,16 +176,38 @@ Examples
|
||||
# [ 1 ] OneWire arduino, atmelavr "Paul Stoffregen": Control devices (from Dallas Semiconductor) that use the One Wire protocol (DS18S20, DS18B20, DS2408 and etc)
|
||||
# ...
|
||||
|
||||
7. Search for `Arduino-based *X10* or *XBee* libraries <http://platformio.ikravets.com/#!/lib/search?query=framework%253Aarduino%2520%252B(x10%2520xbee)&page=1>`_.
|
||||
7. Search for `Energia-based *nRF24* or *HttpClient* libraries <http://platformio.org/#!/lib/search?query=framework%253Aenergia%2520%252B(nRF24%2520HttpClient)>`_.
|
||||
The search query that is described below can be interpreted like
|
||||
``arduino x10 OR arduino xbee``
|
||||
``energia nRF24 OR energia HttpClient``
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio lib search "+(x10 xbee)" --framework="arduino"
|
||||
$ platformio lib search "+(nRF24 HttpClient)" --framework="energia"
|
||||
# Found 2 libraries:
|
||||
#
|
||||
# [ ID ] Name Compatibility "Authors": Description
|
||||
# -------------------------------------------------------------------------------------
|
||||
# [ 36 ] X10 arduino, atmelavr "Doug Clinton": Sending X10 signals over AC power lines (PL513, TW523 and etc)
|
||||
# [ 6 ] XBee arduino, atmelavr "Andrew Rapp": Arduino library for communicating with XBees in API mode
|
||||
# [ 46 ] HttpClient energia, timsp430, titiva "Zack Lalanne": HttpClient is a library to make it easier to interact with web servers
|
||||
# [ 43 ] nRF24 energia, timsp430 "Eric": The nRF24L01 is a low-cost 2.4GHz ISM transceiver module. It supports a number of channel frequencies in the 2.4GHz band and a range of data rates.
|
||||
|
||||
|
||||
8. Search for the `all sensor libraries excluding temperature <http://platformio.org/#!/lib/search?query=sensor%2520-temperature>`_.
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
$ platformio lib search "sensor -temperature"
|
||||
# Found N libraries:
|
||||
#
|
||||
# [ ID ] Name Compatibility "Authors": Description
|
||||
# -------------------------------------------------------------------------------------
|
||||
# [ 31 ] Adafruit-Unified-Sensor arduino, atmelavr "Adafruit Industries": Adafruit Unified Sensor Driver
|
||||
# [ 10 ] I2Cdevlib-AK8975 arduino, atmelavr "Jeff Rowberg": AK8975 is 3-axis electronic compass IC with high sensitive Hall sensor technology
|
||||
# [ 14 ] Adafruit-9DOF-Unified arduino, atmelavr "Adafruit Industries": Unified sensor driver for the Adafruit 9DOF Breakout (L3GD20 / LSM303)
|
||||
# [ 23 ] Adafruit-L3GD20-Unified arduino, atmelavr "Adafruit Industries": Unified sensor driver for the L3GD20 Gyroscope
|
||||
# [ 26 ] Adafruit-LSM303DLHC-Unified arduino, atmelavr "Adafruit Industries": Unified sensor driver for Adafruit's LSM303 Breakout (Accelerometer + Magnetometer)
|
||||
# [ 33 ] Adafruit-TMP006 arduino, atmelavr "Adafruit Industries": A library for the Adafruit TMP006 Infrared Thermopile Sensor
|
||||
# [ 34 ] Adafruit-TSL2561-Unified arduino, atmelavr "Adafruit Industries": Unified light sensor driver for Adafruit's TSL2561 breakouts
|
||||
# [ 97 ] I2Cdevlib-BMA150 arduino, atmelavr "Jeff Rowberg": The BMA150 is a triaxial, low-g acceleration sensor IC with digital output for consumer market applications
|
||||
# [ 106 ] I2Cdevlib-MPR121 arduino, atmelavr "Jeff Rowberg": The MPR121 is a 12-bit proximity capacitive touch sensor
|
||||
# [ 111 ] I2Cdevlib-AK8975 energia, timsp430 "Jeff Rowberg": AK8975 is 3-axis electronic compass IC with high sensitive Hall sensor technology
|
||||
# Show next libraries? [y/N]:
|
||||
|
@ -24,7 +24,7 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# OneWire: http://platformio.ikravets.com/#!/lib/show/1/OneWire
|
||||
# OneWire: http://platformio.org/#!/lib/show/1/OneWire
|
||||
$ platformio lib show 1
|
||||
# OneWire
|
||||
# -------
|
||||
|
@ -24,6 +24,6 @@ Examples
|
||||
|
||||
.. code-block:: bash
|
||||
|
||||
# XBee: http://platformio.ikravets.com/#!/lib/show/6/XBee
|
||||
# XBee: http://platformio.org/#!/lib/show/6/XBee
|
||||
$ platformio lib uninstall 6
|
||||
# The library #6 'XBee' has been successfully uninstalled!
|
||||
|
@ -1,18 +1,18 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
VERSION = (0, 9, 2)
|
||||
VERSION = (0, 10, 0)
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
__description__ = ("A cross-platform code builder and "
|
||||
"the missing library manager")
|
||||
__url__ = "http://platformio.ikravets.com"
|
||||
__url__ = "http://platformio.org"
|
||||
|
||||
__author__ = "Ivan Kravets"
|
||||
__email__ = "me@ikravets.com"
|
||||
|
||||
__license__ = "MIT License"
|
||||
__copyright__ = "Copyright (C) 2014 Ivan Kravets"
|
||||
__copyright__ = "Copyright (C) 2014-2015 Ivan Kravets"
|
||||
|
||||
__apiurl__ = "http://api.platformio.ikravets.com"
|
||||
__apiurl__ = "http://api.platformio.org"
|
||||
|
540
platformio/boards/arduino.json
Normal file
540
platformio/boards/arduino.json
Normal file
@ -0,0 +1,540 @@
|
||||
{
|
||||
"LilyPadUSB": {
|
||||
"build": {
|
||||
"board": "AVR_LILYPAD_USB",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x9208",
|
||||
"usb_product": "LilyPad USB",
|
||||
"variant": "leonardo",
|
||||
"vid": "0x1B4F"
|
||||
},
|
||||
"name": "LilyPad Arduino USB",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"atmegangatmega168": {
|
||||
"build": {
|
||||
"board": "AVR_NG",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega168",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Arduino NG or older ATmega168",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 14336,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"atmegangatmega8": {
|
||||
"build": {
|
||||
"board": "AVR_NG",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega8",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Arduino NG or older ATmega8",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 7168,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"btatmega168": {
|
||||
"build": {
|
||||
"board": "AVR_BT",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega168",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino BT ATmega168",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 14336,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"btatmega328": {
|
||||
"build": {
|
||||
"board": "AVR_BT",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino BT ATmega328",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"diecimilaatmega168": {
|
||||
"build": {
|
||||
"board": "AVR_DUEMILANOVE",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega168",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Arduino Duemilanove or Diecimila ATmega168",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 14336,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"diecimilaatmega328": {
|
||||
"build": {
|
||||
"board": "AVR_DUEMILANOVE",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Arduino Duemilanove or Diecimila ATmega328",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"esplora": {
|
||||
"build": {
|
||||
"board": "AVR_ESPLORA",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x803c",
|
||||
"usb_product": "Arduino Esplora",
|
||||
"variant": "leonardo",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"name": "Arduino Esplora",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"ethernet": {
|
||||
"build": {
|
||||
"board": "AVR_ETHERNET",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "ethernet"
|
||||
},
|
||||
"name": "Arduino Ethernet",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"fio": {
|
||||
"build": {
|
||||
"board": "AVR_FIO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Fio",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"leonardo": {
|
||||
"build": {
|
||||
"board": "AVR_LEONARDO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x8036",
|
||||
"usb_product": "Arduino Leonardo",
|
||||
"variant": "leonardo",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"name": "Arduino Leonardo",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"lilypadatmega168": {
|
||||
"build": {
|
||||
"board": "AVR_LILYPAD",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega168",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "LilyPad Arduino ATmega168",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 14336,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"lilypadatmega328": {
|
||||
"build": {
|
||||
"board": "AVR_LILYPAD",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "LilyPad Arduino ATmega328",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"megaADK": {
|
||||
"build": {
|
||||
"board": "AVR_ADK",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega2560",
|
||||
"variant": "mega"
|
||||
},
|
||||
"name": "Arduino Mega ADK",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 8192,
|
||||
"maximum_size": 253952,
|
||||
"protocol": "wiring",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"megaatmega1280": {
|
||||
"build": {
|
||||
"board": "AVR_MEGA",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1280",
|
||||
"variant": "mega"
|
||||
},
|
||||
"name": "Arduino Mega or Mega 2560 ATmega1280",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 8192,
|
||||
"maximum_size": 126976,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"megaatmega2560": {
|
||||
"build": {
|
||||
"board": "AVR_MEGA2560",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega2560",
|
||||
"variant": "mega"
|
||||
},
|
||||
"name": "Arduino Mega or Mega 2560 ATmega2560 (Mega 2560)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 8192,
|
||||
"maximum_size": 253952,
|
||||
"protocol": "wiring",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"micro": {
|
||||
"build": {
|
||||
"board": "AVR_MICRO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x8037",
|
||||
"usb_product": "Arduino Micro",
|
||||
"variant": "micro",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"name": "Arduino Micro",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"miniatmega168": {
|
||||
"build": {
|
||||
"board": "AVR_MINI",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega168",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Mini ATmega168",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 14336,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"miniatmega328": {
|
||||
"build": {
|
||||
"board": "AVR_MINI",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Mini ATmega328",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "arduino",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"nanoatmega168": {
|
||||
"build": {
|
||||
"board": "AVR_NANO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega168",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Nano ATmega168",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 14336,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"nanoatmega328": {
|
||||
"build": {
|
||||
"board": "AVR_NANO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Nano ATmega328",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"pro16MHzatmega168": {
|
||||
"build": {
|
||||
"board": "AVR_PRO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega168",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Pro or Pro Mini ATmega168 (5V, 16 MHz)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 14336,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"pro16MHzatmega328": {
|
||||
"build": {
|
||||
"board": "AVR_PRO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Pro or Pro Mini ATmega328 (5V, 16 MHz)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"pro8MHzatmega168": {
|
||||
"build": {
|
||||
"board": "AVR_PRO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega168",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Pro or Pro Mini ATmega168 (3.3V, 8 MHz)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 14336,
|
||||
"protocol": "arduino",
|
||||
"speed": 19200
|
||||
}
|
||||
},
|
||||
"pro8MHzatmega328": {
|
||||
"build": {
|
||||
"board": "AVR_PRO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "eightanaloginputs"
|
||||
},
|
||||
"name": "Arduino Pro or Pro Mini ATmega328 (3.3V, 8 MHz)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"robotControl": {
|
||||
"build": {
|
||||
"board": "AVR_ROBOT_CONTROL",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x8038",
|
||||
"usb_product": "Robot Control",
|
||||
"variant": "robot_control",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"name": "Arduino Robot Control",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"robotMotor": {
|
||||
"build": {
|
||||
"board": "AVR_ROBOT_MOTOR",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x8039",
|
||||
"usb_product": "Robot Motor",
|
||||
"variant": "robot_motor",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"name": "Arduino Robot Motor",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"uno": {
|
||||
"build": {
|
||||
"board": "AVR_UNO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Arduino Uno",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"yun": {
|
||||
"build": {
|
||||
"board": "AVR_YUN",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x8041",
|
||||
"usb_product": "Arduino Yun",
|
||||
"variant": "yun",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"name": "Arduino Yun",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"via_ssh": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
}
|
||||
}
|
71
platformio/boards/engduino.json
Normal file
71
platformio/boards/engduino.json
Normal file
@ -0,0 +1,71 @@
|
||||
{
|
||||
"engduinov1": {
|
||||
"build": {
|
||||
"board": "AVR_ENGDUINOV1",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x9208",
|
||||
"usb_product": "EngduinoV1",
|
||||
"variant": "engduinov1",
|
||||
"vid": "0x1B4F"
|
||||
},
|
||||
"name": "Engduino 1",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"engduinov2": {
|
||||
"build": {
|
||||
"board": "AVR_ENGDUINOV2",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x9208",
|
||||
"usb_product": "EngduinoV2",
|
||||
"variant": "engduinov2",
|
||||
"vid": "0x1B4F"
|
||||
},
|
||||
"name": "Engduino 2",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"engduinov3": {
|
||||
"build": {
|
||||
"board": "AVR_ENGDUINOV3",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x9208",
|
||||
"usb_product": "EngduinoV3",
|
||||
"variant": "engduinov3",
|
||||
"vid": "0x1B4F"
|
||||
},
|
||||
"name": "Engduino 3",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
}
|
||||
}
|
160
platformio/boards/microduino.json
Normal file
160
platformio/boards/microduino.json
Normal file
@ -0,0 +1,160 @@
|
||||
{
|
||||
"1284p16m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE_PLUS",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "plus"
|
||||
},
|
||||
"name": "Microduino Core+ (ATmega1284P@16M,5V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 130048,
|
||||
"protocol": "arduino",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"1284p8m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE_PLUS",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "plus"
|
||||
},
|
||||
"name": "Microduino Core+ (ATmega1284P@8M,3.3V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 130048,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"168pa16m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega168p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Microduino Core (Atmega168PA@16M,5V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 15872,
|
||||
"protocol": "arduino",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"168pa8m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega168p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Microduino Core (Atmega168PA@8M,3.3V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 15872,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"328p16m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Microduino Core (Atmega328P@16M,5V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"328p8m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Microduino Core (Atmega328P@8M,3.3V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 32256,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
},
|
||||
"32u416m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE_USB",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega32u4",
|
||||
"pid": "0x8036",
|
||||
"variant": "32u4",
|
||||
"vid": "0x2341"
|
||||
},
|
||||
"name": "Microduino Core USB (ATmega32U4@16M,5V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"disable_flushing": true,
|
||||
"maximum_ram_size": 2560,
|
||||
"maximum_size": 28672,
|
||||
"protocol": "avr109",
|
||||
"speed": 57600,
|
||||
"use_1200bps_touch": true,
|
||||
"wait_for_upload_port": true
|
||||
}
|
||||
},
|
||||
"644pa16m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE_PLUS",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega644p",
|
||||
"variant": "plus"
|
||||
},
|
||||
"name": "Microduino Core+ (Atmega644PA@16M,5V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 4096,
|
||||
"maximum_size": 64512,
|
||||
"protocol": "arduino",
|
||||
"speed": 115200
|
||||
}
|
||||
},
|
||||
"644pa8m": {
|
||||
"build": {
|
||||
"board": "AVR_MICRODUINO_CORE_PLUS",
|
||||
"core": "arduino",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "atmega644p",
|
||||
"variant": "plus"
|
||||
},
|
||||
"name": "Microduino Core+ (Atmega644PA@8M,3.3V)",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 4096,
|
||||
"maximum_size": 64512,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
}
|
||||
}
|
19
platformio/boards/misc.json
Normal file
19
platformio/boards/misc.json
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
"raspduino": {
|
||||
"build": {
|
||||
"board": "AVR_RASPDUINO",
|
||||
"core": "arduino",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega328p",
|
||||
"variant": "standard"
|
||||
},
|
||||
"name": "Raspduino",
|
||||
"platform": "atmelavr",
|
||||
"upload": {
|
||||
"maximum_ram_size": 2048,
|
||||
"maximum_size": 30720,
|
||||
"protocol": "arduino",
|
||||
"speed": 57600
|
||||
}
|
||||
}
|
||||
}
|
107
platformio/boards/timsp430.json
Normal file
107
platformio/boards/timsp430.json
Normal file
@ -0,0 +1,107 @@
|
||||
{
|
||||
"lpmsp430f5529": {
|
||||
"build": {
|
||||
"core": "msp430",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "msp430f5529",
|
||||
"variant": "launchpad_f5529"
|
||||
},
|
||||
"name": "LaunchPad w/ msp430f5529 (16MHz)",
|
||||
"platform": "timsp430",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 131072,
|
||||
"protocol": "tilib"
|
||||
}
|
||||
},
|
||||
"lpmsp430f5529_25": {
|
||||
"build": {
|
||||
"core": "msp430",
|
||||
"f_cpu": "25000000L",
|
||||
"mcu": "msp430f5529",
|
||||
"variant": "launchpad_f5529"
|
||||
},
|
||||
"name": "LaunchPad w/ msp430f5529 (25MHz)",
|
||||
"platform": "timsp430",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 131072,
|
||||
"protocol": "tilib"
|
||||
}
|
||||
},
|
||||
"lpmsp430fr5739": {
|
||||
"build": {
|
||||
"core": "msp430",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "msp430fr5739",
|
||||
"variant": "fraunchpad"
|
||||
},
|
||||
"name": "FraunchPad w/ msp430fr5739",
|
||||
"platform": "timsp430",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 15872,
|
||||
"protocol": "rf2500"
|
||||
}
|
||||
},
|
||||
"lpmsp430fr5969": {
|
||||
"build": {
|
||||
"core": "msp430",
|
||||
"f_cpu": "8000000L",
|
||||
"mcu": "msp430fr5969",
|
||||
"variant": "launchpad_fr5969"
|
||||
},
|
||||
"name": "LaunchPad w/ msp430fr5969",
|
||||
"platform": "timsp430",
|
||||
"upload": {
|
||||
"maximum_ram_size": 1024,
|
||||
"maximum_size": 65536,
|
||||
"protocol": "tilib"
|
||||
}
|
||||
},
|
||||
"lpmsp430g2231": {
|
||||
"build": {
|
||||
"core": "msp430",
|
||||
"f_cpu": "1000000L",
|
||||
"mcu": "msp430g2231",
|
||||
"variant": "launchpad"
|
||||
},
|
||||
"name": "LaunchPad w/ msp430g2231 (1MHz)",
|
||||
"platform": "timsp430",
|
||||
"upload": {
|
||||
"maximum_ram_size": 128,
|
||||
"maximum_size": 2048,
|
||||
"protocol": "rf2500"
|
||||
}
|
||||
},
|
||||
"lpmsp430g2452": {
|
||||
"build": {
|
||||
"core": "msp430",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "msp430g2452",
|
||||
"variant": "launchpad"
|
||||
},
|
||||
"name": "LaunchPad w/ msp430g2452 (16MHz)",
|
||||
"platform": "timsp430",
|
||||
"upload": {
|
||||
"maximum_ram_size": 256,
|
||||
"maximum_size": 8192,
|
||||
"protocol": "rf2500"
|
||||
}
|
||||
},
|
||||
"lpmsp430g2553": {
|
||||
"build": {
|
||||
"core": "msp430",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "msp430g2553",
|
||||
"variant": "launchpad"
|
||||
},
|
||||
"name": "LaunchPad w/ msp430g2553 (16MHz)",
|
||||
"platform": "timsp430",
|
||||
"upload": {
|
||||
"maximum_ram_size": 512,
|
||||
"maximum_size": 16384,
|
||||
"protocol": "rf2500"
|
||||
}
|
||||
}
|
||||
}
|
47
platformio/boards/titiva.json
Normal file
47
platformio/boards/titiva.json
Normal file
@ -0,0 +1,47 @@
|
||||
{
|
||||
"lplm4f120h5qr": {
|
||||
"build": {
|
||||
"core": "lm4f",
|
||||
"f_cpu": "80000000L",
|
||||
"ldscript": "lm4fcpp_blizzard.ld",
|
||||
"mcu": "cortex-m4",
|
||||
"variant": "stellarpad"
|
||||
},
|
||||
"name": "LaunchPad (Stellaris) w/ lm4f120 (80MHz)",
|
||||
"platform": "titiva",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
}
|
||||
},
|
||||
"lptm4c1230c3pm": {
|
||||
"build": {
|
||||
"core": "lm4f",
|
||||
"f_cpu": "80000000L",
|
||||
"ldscript": "lm4fcpp_blizzard.ld",
|
||||
"mcu": "cortex-m4",
|
||||
"variant": "stellarpad"
|
||||
},
|
||||
"name": "LaunchPad (Tiva C) w/ tm4c123 (80MHz)",
|
||||
"platform": "titiva",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
}
|
||||
},
|
||||
"lptm4c1294ncpdt": {
|
||||
"build": {
|
||||
"core": "lm4f",
|
||||
"f_cpu": "120000000L",
|
||||
"ldscript": "lm4fcpp_snowflake.ld",
|
||||
"mcu": "cortex-m4",
|
||||
"variant": "launchpad_129"
|
||||
},
|
||||
"name": "LaunchPad (Tiva C) w/ tm4c129 (120MHz)",
|
||||
"platform": "titiva",
|
||||
"upload": {
|
||||
"maximum_ram_size": 262144,
|
||||
"maximum_size": 1048576
|
||||
}
|
||||
}
|
||||
}
|
@ -2,22 +2,20 @@
|
||||
# See LICENSE for details.
|
||||
|
||||
try:
|
||||
from platformio.util import get_home_dir
|
||||
from platformio import util
|
||||
except ImportError:
|
||||
import sys
|
||||
for _path in sys.path:
|
||||
if "platformio" in _path:
|
||||
sys.path.insert(0, _path[:_path.rfind("platformio")-1])
|
||||
break
|
||||
from platformio.util import get_home_dir
|
||||
from platformio import util
|
||||
|
||||
from os.path import join
|
||||
|
||||
from SCons.Script import (DefaultEnvironment, SConscript, SConscriptChdir,
|
||||
Variables)
|
||||
|
||||
from platformio.util import (get_lib_dir, get_pioenvs_dir, get_project_dir,
|
||||
get_source_dir)
|
||||
|
||||
# AllowSubstExceptions()
|
||||
|
||||
@ -50,28 +48,43 @@ commonvars.AddVariables(
|
||||
)
|
||||
|
||||
DefaultEnvironment(
|
||||
# Temporary fix for the issue #18
|
||||
tools=["default", "gcc", "g++", "ar", "gnulink", "platformio"],
|
||||
tools=["gcc", "g++", "ar", "gnulink", "platformio"],
|
||||
toolpath=[join("$PIOBUILDER_DIR", "tools")],
|
||||
variables=commonvars,
|
||||
|
||||
PIOHOME_DIR=get_home_dir(),
|
||||
PROJECT_DIR=get_project_dir(),
|
||||
PIOENVS_DIR=get_pioenvs_dir(),
|
||||
PIOHOME_DIR=util.get_home_dir(),
|
||||
PROJECT_DIR=util.get_project_dir(),
|
||||
PIOENVS_DIR=util.get_pioenvs_dir(),
|
||||
|
||||
PIOBUILDER_DIR=join(get_source_dir(), "builder"),
|
||||
PIOBUILDER_DIR=join(util.get_source_dir(), "builder"),
|
||||
PIOPACKAGES_DIR=join("$PIOHOME_DIR", "packages"),
|
||||
PLATFORMFW_DIR=join("$PIOPACKAGES_DIR", "$PIOPACKAGE_FRAMEWORK"),
|
||||
|
||||
BUILD_DIR=join("$PIOENVS_DIR", "$PIOENV"),
|
||||
LIBSOURCE_DIRS=[
|
||||
join("$PROJECT_DIR", "lib"),
|
||||
get_lib_dir(),
|
||||
util.get_lib_dir(),
|
||||
join("$PLATFORMFW_DIR", "libraries"),
|
||||
]
|
||||
)
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
||||
if "BOARD" in env:
|
||||
try:
|
||||
env.Replace(BOARD_OPTIONS=util.get_boards(env.subst("$BOARD")))
|
||||
except KeyError:
|
||||
env.Exit("Error: Unknown board '%s'" % env.subst("$BOARD"))
|
||||
|
||||
if "BOARD_MCU" not in env:
|
||||
env.Replace(BOARD_MCU="${BOARD_OPTIONS['build']['mcu']}")
|
||||
if "BOARD_F_CPU" not in env:
|
||||
env.Replace(BOARD_F_CPU="${BOARD_OPTIONS['build']['f_cpu']}")
|
||||
if "UPLOAD_PROTOCOL" not in env:
|
||||
env.Replace(UPLOAD_PROTOCOL="${BOARD_OPTIONS['upload']['protocol']}")
|
||||
if "UPLOAD_SPEED" not in env:
|
||||
env.Replace(UPLOAD_SPEED="${BOARD_OPTIONS['upload']['speed']}")
|
||||
|
||||
env.PrependENVPath(
|
||||
"PATH",
|
||||
env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN", "bin"))
|
||||
|
@ -11,7 +11,7 @@ from time import sleep
|
||||
from SCons.Script import (AlwaysBuild, Builder, COMMAND_LINE_TARGETS, Default,
|
||||
DefaultEnvironment, Exit)
|
||||
|
||||
from platformio.util import get_serialports, reset_serialport
|
||||
from platformio.util import get_serialports
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
||||
@ -41,7 +41,10 @@ env.Replace(
|
||||
"-mmcu=$BOARD_MCU"
|
||||
],
|
||||
|
||||
CXXFLAGS=["-fno-exceptions"],
|
||||
CXXFLAGS=[
|
||||
"-fno-exceptions",
|
||||
"-fno-threadsafe-statics"
|
||||
],
|
||||
|
||||
CPPDEFINES=[
|
||||
"F_CPU=$BOARD_F_CPU"
|
||||
@ -55,7 +58,6 @@ env.Replace(
|
||||
|
||||
UPLOADER=join("$PIOPACKAGES_DIR", "tool-avrdude", "avrdude"),
|
||||
UPLOADERFLAGS=[
|
||||
"-V", # do not verify
|
||||
"-q", # suppress progress output
|
||||
"-D", # disable auto erase for flash memory
|
||||
"-p", "$BOARD_MCU",
|
||||
@ -101,7 +103,7 @@ env.Append(
|
||||
)
|
||||
|
||||
|
||||
def reset_device():
|
||||
def before_upload():
|
||||
|
||||
def rpi_sysgpio(path, value):
|
||||
with open(path, "w") as f:
|
||||
@ -115,7 +117,19 @@ def reset_device():
|
||||
rpi_sysgpio("/sys/class/gpio/gpio18/value", 0)
|
||||
rpi_sysgpio("/sys/class/gpio/unexport", 18)
|
||||
else:
|
||||
return reset_serialport(env.subst("$UPLOAD_PORT"))
|
||||
upload_options = env.get("BOARD_OPTIONS", {}).get("upload", {})
|
||||
|
||||
if not upload_options.get("disable_flushing", False):
|
||||
env.FlushSerialBuffer("$UPLOAD_PORT")
|
||||
|
||||
before_ports = [i['port'] for i in get_serialports()]
|
||||
|
||||
if (upload_options.get("use_1200bps_touch", False) and
|
||||
"UPLOAD_PORT" in env):
|
||||
env.TouchSerialPort("$UPLOAD_PORT", 1200)
|
||||
|
||||
if upload_options.get("wait_for_upload_port", False):
|
||||
env.Replace(UPLOAD_PORT=env.WaitForNewSerialPort(before_ports))
|
||||
|
||||
|
||||
CORELIBS = env.ProcessGeneral()
|
||||
@ -147,7 +161,7 @@ else:
|
||||
#
|
||||
|
||||
upload = env.Alias(["upload", "uploadlazy"], target_hex, [
|
||||
lambda target, source, env: reset_device(), "$UPLOADHEXCMD"])
|
||||
lambda target, source, env: before_upload(), "$UPLOADHEXCMD"])
|
||||
AlwaysBuild(upload)
|
||||
|
||||
#
|
||||
@ -155,7 +169,7 @@ AlwaysBuild(upload)
|
||||
#
|
||||
|
||||
uploadeep = env.Alias("uploadeep", target_eep, [
|
||||
lambda target, source, env: reset_device(), "$UPLOADEEPCMD"])
|
||||
lambda target, source, env: before_upload(), "$UPLOADEEPCMD"])
|
||||
AlwaysBuild(uploadeep)
|
||||
|
||||
#
|
||||
@ -171,7 +185,7 @@ if is_uptarget:
|
||||
for item in get_serialports():
|
||||
if "VID:PID" in item['hwid']:
|
||||
print "Auto-detected UPLOAD_PORT: %s" % item['port']
|
||||
env['UPLOAD_PORT'] = item['port']
|
||||
env.Replace(UPLOAD_PORT=item['port'])
|
||||
break
|
||||
|
||||
if "UPLOAD_PORT" not in env:
|
||||
|
@ -12,34 +12,31 @@ from SCons.Script import Import, Return
|
||||
env = None
|
||||
Import("env")
|
||||
|
||||
BOARD_OPTIONS = env.ParseBoardOptions(
|
||||
join("$PLATFORMFW_DIR", "boards.txt"),
|
||||
"${BOARD}"
|
||||
)
|
||||
ARDUINO_VERSION = int(
|
||||
open(join(env.subst("$PLATFORMFW_DIR"),
|
||||
"version.txt")).read().replace(".", "").strip())
|
||||
|
||||
# usb flags
|
||||
ARDUINO_USBDEFINES = []
|
||||
if "build.usb_product" in BOARD_OPTIONS:
|
||||
if "usb_product" in env.subst("${BOARD_OPTIONS['build']}"):
|
||||
ARDUINO_USBDEFINES = [
|
||||
"USB_VID=%s" % BOARD_OPTIONS['build.vid'],
|
||||
"USB_PID=%s" % BOARD_OPTIONS['build.pid'],
|
||||
"USB_PRODUCT=%s" % BOARD_OPTIONS['build.usb_product'].replace('"', "")
|
||||
"USB_VID=${BOARD_OPTIONS['build']['vid']}",
|
||||
"USB_PID=${BOARD_OPTIONS['build']['pid']}",
|
||||
'USB_PRODUCT=\\"%s\\"' % (env.subst(
|
||||
"${BOARD_OPTIONS['build']['usb_product']}").replace('"', ""))
|
||||
]
|
||||
|
||||
# include board variant
|
||||
env.VariantDir(
|
||||
join("$BUILD_DIR", "FrameworkArduinoVariant"),
|
||||
join("$PLATFORMFW_DIR", "variants", BOARD_OPTIONS['build.variant'])
|
||||
join("$PLATFORMFW_DIR", "variants", "${BOARD_OPTIONS['build']['variant']}")
|
||||
)
|
||||
|
||||
env.Append(
|
||||
CPPDEFINES=[
|
||||
"ARDUINO_ARCH_AVR", # @TODO Should be dynamic
|
||||
"ARDUINO_ARCH_%s" % env.subst("$PLATFORM").upper()[-3:],
|
||||
"ARDUINO=%d" % ARDUINO_VERSION,
|
||||
"ARDUINO_%s" % BOARD_OPTIONS['build.board']
|
||||
"ARDUINO_${BOARD_OPTIONS['build']['board']}"
|
||||
] + ARDUINO_USBDEFINES,
|
||||
CPPPATH=[
|
||||
join("$BUILD_DIR", "FrameworkArduino"),
|
||||
@ -47,25 +44,16 @@ env.Append(
|
||||
]
|
||||
)
|
||||
|
||||
if "BOARD_MCU" not in env:
|
||||
env.Replace(BOARD_MCU=BOARD_OPTIONS['build.mcu'])
|
||||
if "BOARD_F_CPU" not in env:
|
||||
env.Replace(BOARD_F_CPU=BOARD_OPTIONS['build.f_cpu'])
|
||||
if "UPLOAD_PROTOCOL" not in env:
|
||||
env.Replace(UPLOAD_PROTOCOL=BOARD_OPTIONS['upload.protocol'])
|
||||
if "UPLOAD_SPEED" not in env:
|
||||
env.Replace(UPLOAD_SPEED=BOARD_OPTIONS['upload.speed'])
|
||||
|
||||
|
||||
libs = []
|
||||
|
||||
#
|
||||
# Target: Build Core Library
|
||||
#
|
||||
|
||||
libs = []
|
||||
|
||||
libs.append(env.BuildLibrary(
|
||||
join("$BUILD_DIR", "FrameworkArduino"),
|
||||
join("$PLATFORMFW_DIR", "cores", BOARD_OPTIONS['build.core'])
|
||||
join("$PLATFORMFW_DIR", "cores", "${BOARD_OPTIONS['build']['core']}")
|
||||
))
|
||||
|
||||
Return("libs")
|
||||
|
@ -12,10 +12,6 @@ from SCons.Script import Import, Return
|
||||
env = None
|
||||
Import("env")
|
||||
|
||||
BOARD_OPTIONS = env.ParseBoardOptions(
|
||||
join("$PLATFORMFW_DIR", "boards.txt"),
|
||||
"${BOARD}"
|
||||
)
|
||||
ENERGIA_VERSION = int(
|
||||
open(join(env.subst("$PLATFORMFW_DIR"),
|
||||
"version.txt")).read().replace(".", "").strip())
|
||||
@ -23,7 +19,7 @@ ENERGIA_VERSION = int(
|
||||
# include board variant
|
||||
env.VariantDir(
|
||||
join("$BUILD_DIR", "FrameworkEnergiaVariant"),
|
||||
join("$PLATFORMFW_DIR", "variants", BOARD_OPTIONS['build.variant'])
|
||||
join("$PLATFORMFW_DIR", "variants", "${BOARD_OPTIONS['build']['variant']}")
|
||||
)
|
||||
|
||||
env.Append(
|
||||
@ -37,31 +33,25 @@ env.Append(
|
||||
]
|
||||
)
|
||||
|
||||
if "BOARD_MCU" not in env:
|
||||
env.Replace(BOARD_MCU=BOARD_OPTIONS['build.mcu'])
|
||||
if "BOARD_F_CPU" not in env:
|
||||
env.Replace(BOARD_F_CPU=BOARD_OPTIONS['build.f_cpu'])
|
||||
if "UPLOAD_PROTOCOL" not in env and "upload.protocol" in BOARD_OPTIONS:
|
||||
env.Replace(UPLOAD_PROTOCOL=BOARD_OPTIONS['upload.protocol'])
|
||||
|
||||
# specific linker script for TIVA devices
|
||||
if "ldscript" in BOARD_OPTIONS:
|
||||
if "ldscript" in env.subst("${BOARD_OPTIONS['build']}"):
|
||||
env.Append(
|
||||
LINKFLAGS=["-T", join("$PLATFORMFW_DIR", "cores",
|
||||
BOARD_OPTIONS['build.core'],
|
||||
BOARD_OPTIONS['ldscript'])]
|
||||
LINKFLAGS=["-T", join(
|
||||
"$PLATFORMFW_DIR", "cores",
|
||||
"${BOARD_OPTIONS['build']['core']}",
|
||||
"${BOARD_OPTIONS['build']['ldscript']}")]
|
||||
)
|
||||
|
||||
|
||||
libs = []
|
||||
|
||||
#
|
||||
# Target: Build Core Library
|
||||
#
|
||||
|
||||
libs = []
|
||||
|
||||
libs.append(env.BuildLibrary(
|
||||
join("$BUILD_DIR", "FrameworkEnergia"),
|
||||
join("$PLATFORMFW_DIR", "cores", BOARD_OPTIONS['build.core'])
|
||||
join("$PLATFORMFW_DIR", "cores", "${BOARD_OPTIONS['build']['core']}")
|
||||
))
|
||||
|
||||
Return("libs")
|
||||
|
@ -2,11 +2,16 @@
|
||||
# See LICENSE for details.
|
||||
|
||||
import atexit
|
||||
import platform
|
||||
import re
|
||||
from os import getenv, listdir, remove, walk
|
||||
from os.path import basename, isdir, isfile, join
|
||||
from time import sleep
|
||||
|
||||
from SCons.Script import SConscript, SConscriptChdir
|
||||
from SCons.Script import Exit, SConscript, SConscriptChdir
|
||||
from serial import Serial
|
||||
|
||||
from platformio.util import get_serialports
|
||||
|
||||
|
||||
def ProcessGeneral(env):
|
||||
@ -16,7 +21,7 @@ def ProcessGeneral(env):
|
||||
|
||||
if "FRAMEWORK" in env:
|
||||
if env['FRAMEWORK'] in ("arduino", "energia"):
|
||||
env.ConvertInotoCpp()
|
||||
env.ConvertInoToCpp()
|
||||
SConscriptChdir(0)
|
||||
corelibs = SConscript(env.subst(join("$PIOBUILDER_DIR", "scripts",
|
||||
"frameworks", "${FRAMEWORK}.py")),
|
||||
@ -29,7 +34,7 @@ def BuildFirmware(env, corelibs):
|
||||
vdirs = src.VariantDirRecursive(
|
||||
join("$BUILD_DIR", "src"), join("$PROJECT_DIR", "src"))
|
||||
|
||||
# build source's dependent libs
|
||||
# build dependent libs
|
||||
deplibs = []
|
||||
for vdir in vdirs:
|
||||
deplibs += src.BuildDependentLibraries(vdir)
|
||||
@ -78,16 +83,23 @@ def BuildDependentLibraries(env, src_dir):
|
||||
def GetDependentLibraries(env, src_dir):
|
||||
includes = {}
|
||||
regexp = re.compile(r"^\s*#include\s+(?:\<|\")([^\>\"\']+)(?:\>|\")", re.M)
|
||||
for node in env.GlobCXXFiles(src_dir):
|
||||
nodes = env.GlobCXXFiles(src_dir) + env.Glob(join(src_dir, "*.h"))
|
||||
for node in nodes:
|
||||
env.ParseIncludesRecurive(regexp, node, includes)
|
||||
includes = sorted(includes.items(), key=lambda s: s[0])
|
||||
|
||||
result = []
|
||||
for i in includes:
|
||||
item = (i[1][1], i[1][2])
|
||||
if item in result:
|
||||
continue
|
||||
result.append(item)
|
||||
items = [(i[1][1], i[1][2])]
|
||||
|
||||
if isdir(join(items[0][1], "utility")):
|
||||
items.append(("%sUtility" % items[0][0],
|
||||
join(items[0][1], "utility")))
|
||||
|
||||
for item in items:
|
||||
if item in result:
|
||||
continue
|
||||
result.append(item)
|
||||
return result
|
||||
|
||||
|
||||
@ -126,39 +138,7 @@ def VariantDirRecursive(env, variant_dir, src_dir, duplicate=True):
|
||||
return variants
|
||||
|
||||
|
||||
def ParseBoardOptions(env, path, name):
|
||||
path = env.subst(path)
|
||||
name = env.subst(name)
|
||||
if not isfile(path):
|
||||
env.Exit("Invalid path to boards.txt -> %s" % path)
|
||||
|
||||
data = {}
|
||||
with open(path) as f:
|
||||
for line in f:
|
||||
if not line.strip() or line[0] == "#":
|
||||
continue
|
||||
|
||||
_group = line[:line.index(".")]
|
||||
_cpu = name[len(_group):]
|
||||
line = line[len(_group)+1:].strip()
|
||||
if _group != name[:len(_group)]:
|
||||
continue
|
||||
elif "menu.cpu." in line:
|
||||
if _cpu not in line:
|
||||
continue
|
||||
else:
|
||||
line = line[len(_cpu)+10:]
|
||||
|
||||
if "=" in line:
|
||||
opt, value = line.split("=", 1)
|
||||
data[opt] = value
|
||||
if not data:
|
||||
env.Exit("Unknown Board '%s'" % name)
|
||||
else:
|
||||
return data
|
||||
|
||||
|
||||
def ConvertInotoCpp(env):
|
||||
def ConvertInoToCpp(env):
|
||||
|
||||
def delete_tmpcpp(files):
|
||||
for f in files:
|
||||
@ -206,6 +186,47 @@ def ConvertInotoCpp(env):
|
||||
atexit.register(delete_tmpcpp, tmpcpp)
|
||||
|
||||
|
||||
def FlushSerialBuffer(env, port):
|
||||
s = Serial(env.subst(port))
|
||||
s.flushInput()
|
||||
s.setDTR(False)
|
||||
s.setRTS(False)
|
||||
sleep(0.1)
|
||||
s.setDTR(True)
|
||||
s.setRTS(True)
|
||||
s.close()
|
||||
|
||||
|
||||
def TouchSerialPort(env, port, baudrate):
|
||||
s = Serial(port=env.subst(port), baudrate=baudrate)
|
||||
s.close()
|
||||
if platform.system() != "Darwin":
|
||||
sleep(0.3)
|
||||
|
||||
|
||||
def WaitForNewSerialPort(_, before):
|
||||
new_port = None
|
||||
elapsed = 0
|
||||
while elapsed < 10:
|
||||
now = [i['port'] for i in get_serialports()]
|
||||
diff = list(set(now) - set(before))
|
||||
if diff:
|
||||
new_port = diff[0]
|
||||
break
|
||||
|
||||
before = now
|
||||
sleep(0.25)
|
||||
elapsed += 0.25
|
||||
|
||||
if not new_port:
|
||||
Exit("Error: Couldn't find a board on the selected port. "
|
||||
"Check that you have the correct port selected. "
|
||||
"If it is correct, try pressing the board's reset "
|
||||
"button after initiating the upload.")
|
||||
|
||||
return new_port
|
||||
|
||||
|
||||
def exists(_):
|
||||
return True
|
||||
|
||||
@ -219,6 +240,8 @@ def generate(env):
|
||||
env.AddMethod(GetDependentLibraries)
|
||||
env.AddMethod(ParseIncludesRecurive)
|
||||
env.AddMethod(VariantDirRecursive)
|
||||
env.AddMethod(ParseBoardOptions)
|
||||
env.AddMethod(ConvertInotoCpp)
|
||||
env.AddMethod(ConvertInoToCpp)
|
||||
env.AddMethod(FlushSerialBuffer)
|
||||
env.AddMethod(TouchSerialPort)
|
||||
env.AddMethod(WaitForNewSerialPort)
|
||||
return env
|
||||
|
60
platformio/commands/boards.py
Normal file
60
platformio/commands/boards.py
Normal file
@ -0,0 +1,60 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import json
|
||||
|
||||
import click
|
||||
|
||||
from platformio.util import get_boards
|
||||
|
||||
|
||||
@click.command("list", short_help="Pre-configured Embedded Boards")
|
||||
@click.argument("query", required=False)
|
||||
def cli(query):
|
||||
|
||||
BOARDLIST_TPL = ("{type:<30} {mcu:<13} {frequency:<8} "
|
||||
" {flash:<7} {ram:<6} {name}")
|
||||
|
||||
grpboards = {}
|
||||
for type_, data in get_boards().items():
|
||||
if data['platform'] not in grpboards:
|
||||
grpboards[data['platform']] = {}
|
||||
grpboards[data['platform']][type_] = data
|
||||
|
||||
for (platform, boards) in grpboards.items():
|
||||
if query:
|
||||
search_data = json.dumps(boards).lower()
|
||||
if query.lower() not in search_data.lower():
|
||||
continue
|
||||
|
||||
click.echo("\nPlatform: %s" % platform)
|
||||
click.echo("-" * 75)
|
||||
click.echo(BOARDLIST_TPL.format(
|
||||
type=click.style("Type", fg="cyan"), mcu="MCU",
|
||||
frequency="Frequency", flash="Flash", ram="RAM", name="Name"))
|
||||
click.echo("-" * 75)
|
||||
|
||||
for type_, data in sorted(boards.items(), key=lambda b: b[1]['name']):
|
||||
if query:
|
||||
search_data = "%s %s" % (type_, json.dumps(data).lower())
|
||||
if query.lower() not in search_data.lower():
|
||||
continue
|
||||
|
||||
flash_size = ""
|
||||
if "maximum_size" in data.get("upload", None):
|
||||
flash_size = int(data['upload']['maximum_size'])
|
||||
flash_size = "%dKb" % (flash_size / 1024)
|
||||
|
||||
ram_size = ""
|
||||
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)
|
||||
else:
|
||||
ram_size = "%dB" % ram_size
|
||||
|
||||
click.echo(BOARDLIST_TPL.format(
|
||||
type=click.style(type_, fg="cyan"), mcu=data['build']['mcu'],
|
||||
frequency="%dMhz" % (int(data['build']['f_cpu'][:-1])
|
||||
/ 1000000),
|
||||
flash=flash_size, ram=ram_size, name=data['name']))
|
@ -8,15 +8,17 @@ from shutil import copyfile
|
||||
import click
|
||||
|
||||
from platformio import app
|
||||
from platformio.exception import ProjectInitialized
|
||||
from platformio.util import get_source_dir
|
||||
from platformio.exception import ProjectInitialized, UnknownBoard
|
||||
from platformio.util import get_boards, get_source_dir
|
||||
|
||||
|
||||
@click.command("init", short_help="Initialize new PlatformIO based project")
|
||||
@click.option("--project-dir", "-d", default=getcwd(),
|
||||
type=click.Path(exists=True, file_okay=False, dir_okay=True,
|
||||
writable=True, resolve_path=True))
|
||||
def cli(project_dir):
|
||||
@click.option("--board", "-b", multiple=True, metavar="TYPE")
|
||||
@click.option('--disable-auto-uploading', is_flag=True)
|
||||
def cli(project_dir, board, disable_auto_uploading):
|
||||
|
||||
project_file = join(project_dir, "platformio.ini")
|
||||
src_dir = join(project_dir, "src")
|
||||
@ -24,6 +26,10 @@ def cli(project_dir):
|
||||
if all([isfile(project_file), isdir(src_dir), isdir(lib_dir)]):
|
||||
raise ProjectInitialized()
|
||||
|
||||
builtin_boards = set(get_boards().keys())
|
||||
if board and not set(board).issubset(builtin_boards):
|
||||
raise UnknownBoard(", ".join(set(board).difference(builtin_boards)))
|
||||
|
||||
if project_dir == getcwd():
|
||||
click.secho("The current working directory", fg="yellow", nl=False)
|
||||
click.secho(" %s " % project_dir, fg="cyan", nl=False)
|
||||
@ -51,6 +57,8 @@ def cli(project_dir):
|
||||
if not isfile(project_file):
|
||||
copyfile(join(get_source_dir(), "projectconftpl.ini"),
|
||||
project_file)
|
||||
if board:
|
||||
fill_project_envs(project_file, board, disable_auto_uploading)
|
||||
click.secho(
|
||||
"Project has been successfully initialized!\n"
|
||||
"Now you can process it with `platformio run` command.",
|
||||
@ -58,3 +66,31 @@ def cli(project_dir):
|
||||
)
|
||||
else:
|
||||
click.secho("Aborted by user", fg="red")
|
||||
|
||||
|
||||
def fill_project_envs(project_file, board_types, disable_auto_uploading):
|
||||
builtin_boards = get_boards()
|
||||
content = []
|
||||
for type_ in board_types:
|
||||
if type_ not in builtin_boards:
|
||||
continue
|
||||
else:
|
||||
content.append("")
|
||||
|
||||
data = builtin_boards[type_]
|
||||
framework = data.get("build", {}).get("core", None)
|
||||
if framework in ("msp430", "lm4f"):
|
||||
framework = "energia"
|
||||
|
||||
content.append("[env:autogen_%s]" % type_)
|
||||
content.append("platform = %s" % data['platform'])
|
||||
|
||||
if framework:
|
||||
content.append("framework = %s" % framework)
|
||||
content.append("board = %s" % type_)
|
||||
|
||||
content.append("%stargets = upload" % "# " if disable_auto_uploading
|
||||
else "")
|
||||
|
||||
with open(project_file, "a") as f:
|
||||
f.write("\n".join(content))
|
||||
|
@ -3,9 +3,7 @@
|
||||
|
||||
import click
|
||||
|
||||
from platformio import app
|
||||
from platformio.exception import (LibAlreadyInstalledError,
|
||||
LibInstallDependencyError)
|
||||
from platformio import app, exception
|
||||
from platformio.libmanager import LibraryManager
|
||||
from platformio.util import get_api_result, get_lib_dir
|
||||
|
||||
@ -57,6 +55,19 @@ def lib_search(query, **filters):
|
||||
query += ' %s:"%s"' % (key, value)
|
||||
|
||||
result = get_api_result("/lib/search", dict(query=query))
|
||||
if result['total'] == 0:
|
||||
click.secho(
|
||||
"Nothing has been found by your request\n"
|
||||
"Try a less-specific search or use truncation (or wildcard) "
|
||||
"operator", fg="yellow", nl=False)
|
||||
click.secho(" *", fg="green")
|
||||
click.secho("For example: DS*, PCA*, DHT* and etc.\n", fg="yellow")
|
||||
click.echo("For more examples and advanced search syntax, "
|
||||
"please use documentation:")
|
||||
click.secho("http://docs.platformio.org"
|
||||
"/en/latest/userguide/lib/cmd_search.html\n", fg="cyan")
|
||||
return
|
||||
|
||||
click.secho("Found %d libraries:\n" % result['total'],
|
||||
fg="green" if result['total'] else "yellow")
|
||||
|
||||
@ -107,9 +118,9 @@ def lib_install(ctx, libid, version):
|
||||
try:
|
||||
lib_install_dependency(ctx, item)
|
||||
except AssertionError:
|
||||
raise LibInstallDependencyError(str(item))
|
||||
raise exception.LibInstallDependencyError(str(item))
|
||||
|
||||
except LibAlreadyInstalledError:
|
||||
except exception.LibAlreadyInstalledError:
|
||||
click.secho("Already installed", fg="yellow")
|
||||
|
||||
|
||||
@ -155,7 +166,7 @@ def lib_list():
|
||||
echo_liblist_item(item)
|
||||
|
||||
|
||||
@cli.command("show", short_help="Show details about installed libraries")
|
||||
@cli.command("show", short_help="Show details about installed library")
|
||||
@click.argument("libid", type=click.INT)
|
||||
def lib_show(libid):
|
||||
lm = LibraryManager(get_lib_dir())
|
||||
@ -221,6 +232,10 @@ def lib_update(ctx):
|
||||
@cli.command("register", short_help="Register new library")
|
||||
@click.argument("config_url")
|
||||
def lib_register(config_url):
|
||||
if (not config_url.startswith("http://") and not
|
||||
config_url.startswith("https://")):
|
||||
raise exception.InvalidLibConfURL(config_url)
|
||||
|
||||
result = get_api_result("/lib/register", data=dict(config_url=config_url))
|
||||
if "message" in result and result['message']:
|
||||
click.secho(result['message'], fg="green" if "successed" in result and
|
||||
|
@ -68,10 +68,12 @@ def process_environment(ctx, name, options, targets, upload_port):
|
||||
|
||||
telemetry.on_run_environment(options, envtargets)
|
||||
|
||||
if (app.get_setting("enable_prompts") and
|
||||
platform not in PlatformFactory.get_platforms(installed=True) and
|
||||
installed_platforms = PlatformFactory.get_platforms(
|
||||
installed=True).keys()
|
||||
if (platform not in installed_platforms and (
|
||||
not app.get_setting("enable_prompts") or
|
||||
click.confirm("The platform '%s' has not been installed yet. "
|
||||
"Would you like to install it now?" % platform)):
|
||||
"Would you like to install it now?" % platform))):
|
||||
ctx.invoke(cmd_install, platforms=[platform])
|
||||
|
||||
p = PlatformFactory.newPlatform(platform)
|
||||
|
@ -61,8 +61,15 @@ def serialports_list():
|
||||
"miniterm (menu), default=0x14")
|
||||
@click.option("--quiet", is_flag=True,
|
||||
help="Diagnostics: suppress non-error messages, default=Off")
|
||||
def serialports_monitor(**_):
|
||||
def serialports_monitor(**kwargs):
|
||||
sys.argv = sys.argv[3:]
|
||||
|
||||
if not kwargs['port']:
|
||||
for item in get_serialports():
|
||||
if "VID:PID" in item['hwid']:
|
||||
sys.argv += ["--port", item['port']]
|
||||
break
|
||||
|
||||
try:
|
||||
miniterm.main()
|
||||
except: # pylint: disable=W0702
|
||||
|
@ -21,7 +21,7 @@ def cli(ctx, platform):
|
||||
installed=True).keys()
|
||||
|
||||
if platform not in installed_platforms:
|
||||
if (app.get_setting("enable_prompts") and
|
||||
if (not app.get_setting("enable_prompts") or
|
||||
click.confirm("The platform '%s' has not been installed yet. "
|
||||
"Would you like to install it now?" % platform)):
|
||||
ctx.invoke(cmd_install, platforms=[platform])
|
||||
|
@ -30,6 +30,11 @@ class UnknownCLICommand(PlatformioException):
|
||||
" to see all available commands")
|
||||
|
||||
|
||||
class UnknownBoard(PlatformioException):
|
||||
|
||||
MESSAGE = "Unknown board type '%s'"
|
||||
|
||||
|
||||
class UnknownPackage(PlatformioException):
|
||||
|
||||
MESSAGE = "Detected unknown package '%s'"
|
||||
@ -127,6 +132,11 @@ class LibInstallDependencyError(PlatformioException):
|
||||
MESSAGE = "Error has been occurred for library dependency '%s'"
|
||||
|
||||
|
||||
class InvalidLibConfURL(PlatformioException):
|
||||
|
||||
MESSAGE = "Invalid library config URL '%s'"
|
||||
|
||||
|
||||
class BuildScriptNotFound(PlatformioException):
|
||||
|
||||
MESSAGE = "Invalid path '%s' to build script"
|
||||
@ -152,5 +162,5 @@ class SConsNotInstalled(PlatformioException):
|
||||
MESSAGE = (
|
||||
"The PlatformIO and `scons` aren't installed properly. "
|
||||
"Please use official installation manual: "
|
||||
"http://docs.platformio.ikravets.com/en/latest/installation.html"
|
||||
"http://docs.platformio.org/en/latest/installation.html"
|
||||
)
|
||||
|
@ -92,7 +92,7 @@ def after_upgrade(ctx):
|
||||
"- %s us on Twitter to stay up-to-date "
|
||||
"on the latest project news > %s" %
|
||||
(click.style("follow", fg="cyan"),
|
||||
click.style("https://twitter.com/platformiotool", fg="cyan"))
|
||||
click.style("https://twitter.com/PlatformIO_Org", fg="cyan"))
|
||||
)
|
||||
click.echo("- %s us a star on GitHub > %s" % (
|
||||
click.style("give", fg="cyan"),
|
||||
@ -140,7 +140,7 @@ def check_platformio_upgrade():
|
||||
fg="yellow", nl=False)
|
||||
click.secho("platformio upgrade", fg="cyan", nl=False)
|
||||
click.secho(" command.\nChanges: ", fg="yellow", nl=False)
|
||||
click.secho("http://docs.platformio.ikravets.com/en/latest/history.html\n",
|
||||
click.secho("http://docs.platformio.org/en/latest/history.html\n",
|
||||
fg="cyan")
|
||||
|
||||
|
||||
|
@ -1,10 +1,18 @@
|
||||
#
|
||||
# Project Configuration File
|
||||
#
|
||||
# A detailed documentation with EXAMPLES is located here:
|
||||
# http://docs.platformio.ikravets.com/en/latest/projectconf.html
|
||||
# A detailed documentation with the EXAMPLES is located here:
|
||||
# http://docs.platformio.org/en/latest/projectconf.html
|
||||
#
|
||||
|
||||
# A sign `#` at the beginning of the line indicates a comment
|
||||
# Comment lines are ignored.
|
||||
|
||||
# Simple and base environment
|
||||
#[env:mybaseenv]
|
||||
#platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# [env:mybaseenv]
|
||||
# platform = %INSTALLED_PLATFORM_NAME_HERE%
|
||||
# framework =
|
||||
# board =
|
||||
#
|
||||
# Automatic targets - enable auto-uploading
|
||||
# targets = upload
|
||||
|
@ -1,8 +1,10 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import atexit
|
||||
import platform
|
||||
import re
|
||||
import threading
|
||||
import uuid
|
||||
from sys import argv as sys_argv
|
||||
from time import time
|
||||
@ -57,14 +59,6 @@ class MeasurementProtocol(TelemetryBase):
|
||||
self._prefill_appinfo()
|
||||
self._prefill_custom_data()
|
||||
|
||||
@classmethod
|
||||
def session_instance(cls):
|
||||
try:
|
||||
return cls._session_instance
|
||||
except AttributeError:
|
||||
cls._session_instance = requests.Session()
|
||||
return cls._session_instance
|
||||
|
||||
def __getitem__(self, name):
|
||||
if name in self.PARAMS_MAP:
|
||||
name = self.PARAMS_MAP[name]
|
||||
@ -119,22 +113,88 @@ class MeasurementProtocol(TelemetryBase):
|
||||
if "qt" in self._params and isinstance(self['qt'], float):
|
||||
self['qt'] = int((time() - self['qt']) * 1000)
|
||||
|
||||
MPDataPusher.get_instance().push(self._params)
|
||||
|
||||
|
||||
class MPDataPusher(threading.Thread):
|
||||
|
||||
@classmethod
|
||||
def get_instance(cls):
|
||||
try:
|
||||
r = self.session_instance().post(
|
||||
"https://ssl.google-analytics.com/collect",
|
||||
data=self._params
|
||||
)
|
||||
r.raise_for_status()
|
||||
except: # pylint: disable=W0702
|
||||
backup_report(self._params)
|
||||
return False
|
||||
return True
|
||||
return cls._thinstance
|
||||
except AttributeError:
|
||||
cls._event = threading.Event()
|
||||
cls._thinstance = cls()
|
||||
cls._thinstance.start()
|
||||
return cls._thinstance
|
||||
|
||||
@classmethod
|
||||
def http_session(cls):
|
||||
try:
|
||||
return cls._http_session
|
||||
except AttributeError:
|
||||
cls._http_session = requests.Session()
|
||||
return cls._http_session
|
||||
|
||||
def __init__(self):
|
||||
threading.Thread.__init__(self)
|
||||
self._terminate = False
|
||||
self._server_online = False
|
||||
self._stack = []
|
||||
|
||||
def run(self):
|
||||
while not self._terminate:
|
||||
self._event.wait()
|
||||
if self._terminate or not self._stack:
|
||||
return
|
||||
self._event.clear()
|
||||
|
||||
data = self._stack.pop()
|
||||
try:
|
||||
r = self.http_session().post(
|
||||
"https://ssl.google-analytics.com/collect",
|
||||
data=data,
|
||||
timeout=3
|
||||
)
|
||||
r.raise_for_status()
|
||||
self._server_online = True
|
||||
except: # pylint: disable=W0702
|
||||
self._server_online = False
|
||||
self._stack.append(data)
|
||||
|
||||
def push(self, data):
|
||||
self._stack.append(data)
|
||||
self._event.set()
|
||||
|
||||
def is_server_online(self):
|
||||
return self._server_online
|
||||
|
||||
def get_stack_data(self):
|
||||
return self._stack
|
||||
|
||||
def join(self, timeout=0.1):
|
||||
self._terminate = True
|
||||
self._event.set()
|
||||
self.http_session().close()
|
||||
threading.Thread.join(self, timeout)
|
||||
|
||||
|
||||
@atexit.register
|
||||
def _finalize():
|
||||
MAX_RESEND_REPORTS = 10
|
||||
mpdp = MPDataPusher.get_instance()
|
||||
backup_reports(mpdp.get_stack_data())
|
||||
|
||||
resent_nums = 0
|
||||
while mpdp.is_server_online() and resent_nums < MAX_RESEND_REPORTS:
|
||||
if not resend_backuped_report():
|
||||
break
|
||||
resent_nums += 1
|
||||
|
||||
|
||||
def on_command(ctx): # pylint: disable=W0613
|
||||
mp = MeasurementProtocol()
|
||||
if mp.send("screenview"):
|
||||
resend_backuped_reports()
|
||||
mp.send("screenview")
|
||||
|
||||
|
||||
def on_run_environment(options, targets):
|
||||
@ -153,53 +213,54 @@ def on_event(category, action, label=None, value=None, screen_name=None):
|
||||
mp['event_value'] = int(value)
|
||||
if screen_name:
|
||||
mp['screen_name'] = screen_name[:2048]
|
||||
return mp.send("event")
|
||||
mp.send("event")
|
||||
|
||||
|
||||
def on_exception(e):
|
||||
mp = MeasurementProtocol()
|
||||
mp['exd'] = "%s: %s" % (type(e).__name__, e)
|
||||
mp['exf'] = 1
|
||||
return mp.send("exception")
|
||||
mp.send("exception")
|
||||
|
||||
|
||||
def backup_report(params):
|
||||
def backup_reports(data):
|
||||
if not data:
|
||||
return
|
||||
|
||||
KEEP_MAX_REPORTS = 1000
|
||||
tm = app.get_state_item("telemetry", {})
|
||||
if "backup" not in tm:
|
||||
tm['backup'] = []
|
||||
|
||||
# skip static options
|
||||
for key in params.keys():
|
||||
if key in ("v", "tid", "cid", "cd1", "cd2", "sr", "an"):
|
||||
del params[key]
|
||||
for params in data:
|
||||
# skip static options
|
||||
for key in params.keys():
|
||||
if key in ("v", "tid", "cid", "cd1", "cd2", "sr", "an"):
|
||||
del params[key]
|
||||
|
||||
# store time in UNIX format
|
||||
if "qt" not in params:
|
||||
params['qt'] = time()
|
||||
elif not isinstance(params['qt'], float):
|
||||
params['qt'] = time() - (params['qt'] / 1000)
|
||||
# store time in UNIX format
|
||||
if "qt" not in params:
|
||||
params['qt'] = time()
|
||||
elif not isinstance(params['qt'], float):
|
||||
params['qt'] = time() - (params['qt'] / 1000)
|
||||
|
||||
tm['backup'].append(params)
|
||||
|
||||
tm['backup'].append(params)
|
||||
tm['backup'] = tm['backup'][KEEP_MAX_REPORTS*-1:]
|
||||
app.set_state_item("telemetry", tm)
|
||||
|
||||
|
||||
def resend_backuped_reports():
|
||||
MAX_RESEND_REPORTS = 10
|
||||
def resend_backuped_report():
|
||||
tm = app.get_state_item("telemetry", {})
|
||||
if "backup" not in tm or not tm['backup']:
|
||||
return False
|
||||
|
||||
resent_nums = 0
|
||||
while resent_nums < MAX_RESEND_REPORTS:
|
||||
tm = app.get_state_item("telemetry", {})
|
||||
if "backup" not in tm or not tm['backup']:
|
||||
break
|
||||
report = tm['backup'].pop()
|
||||
app.set_state_item("telemetry", tm)
|
||||
|
||||
report = tm['backup'].pop()
|
||||
app.set_state_item("telemetry", tm)
|
||||
resent_nums += 1
|
||||
mp = MeasurementProtocol()
|
||||
for key, value in report.items():
|
||||
mp[key] = value
|
||||
mp.send(report['t'])
|
||||
|
||||
mp = MeasurementProtocol()
|
||||
for key, value in report.items():
|
||||
mp[key] = value
|
||||
if not mp.send(report['t']):
|
||||
break
|
||||
return True
|
||||
|
@ -1,15 +1,14 @@
|
||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||
# See LICENSE for details.
|
||||
|
||||
import json
|
||||
from os import name as os_name
|
||||
from os import getcwd, getenv, makedirs, utime
|
||||
from os import getcwd, getenv, listdir, makedirs, utime
|
||||
from os.path import dirname, expanduser, isdir, isfile, join, realpath
|
||||
from platform import system, uname
|
||||
from subprocess import PIPE, Popen
|
||||
from time import sleep
|
||||
|
||||
import requests
|
||||
from serial import Serial
|
||||
|
||||
from platformio import __apiurl__, __version__
|
||||
from platformio.exception import (APIRequestError, GetSerialPortsError,
|
||||
@ -94,17 +93,6 @@ def exec_command(args):
|
||||
return dict(out=out.strip(), err=err.strip())
|
||||
|
||||
|
||||
def reset_serialport(port):
|
||||
s = Serial(port)
|
||||
s.flushInput()
|
||||
s.setDTR(False)
|
||||
s.setRTS(False)
|
||||
sleep(0.1)
|
||||
s.setDTR(True)
|
||||
s.setRTS(True)
|
||||
s.close()
|
||||
|
||||
|
||||
def get_serialports():
|
||||
if os_name == "nt":
|
||||
from serial.tools.list_ports_windows import comports
|
||||
@ -120,12 +108,13 @@ def get_api_result(path, params=None, data=None):
|
||||
r = None
|
||||
|
||||
try:
|
||||
requests.packages.urllib3.disable_warnings()
|
||||
headers = {"User-Agent": "PlatformIO/%s %s" % (
|
||||
__version__, requests.utils.default_user_agent())}
|
||||
# if packages - redirect to SF
|
||||
if path == "/packages":
|
||||
r = requests.get(
|
||||
"https://sourceforge.net/projects/platformio-storage/files/"
|
||||
"http://sourceforge.net/projects/platformio-storage/files/"
|
||||
"packages/manifest.json", params=params, headers=headers)
|
||||
elif data:
|
||||
r = requests.post(__apiurl__ + path, params=params, data=data,
|
||||
@ -148,3 +137,19 @@ def get_api_result(path, params=None, data=None):
|
||||
if r:
|
||||
r.close()
|
||||
return result
|
||||
|
||||
|
||||
def get_boards(type_=None):
|
||||
boards = {}
|
||||
bdirs = [join(get_source_dir(), "boards")]
|
||||
if isdir(join(get_home_dir(), "boards")):
|
||||
bdirs.append(join(get_home_dir(), "boards"))
|
||||
|
||||
for bdir in bdirs:
|
||||
for json_file in listdir(bdir):
|
||||
if not json_file.endswith(".json"):
|
||||
continue
|
||||
with open(join(bdir, json_file)) as f:
|
||||
boards.update(json.load(f))
|
||||
|
||||
return boards[type_] if type_ is not None else boards
|
||||
|
@ -1,5 +1,5 @@
|
||||
click==3.3
|
||||
colorama==0.3.2
|
||||
pyserial==2.7
|
||||
requests==2.5.0
|
||||
requests==2.5.1
|
||||
scons==2.3.0
|
||||
|
2
setup.py
2
setup.py
@ -24,7 +24,7 @@ setup(
|
||||
# "SCons"
|
||||
] + (["colorama"] if system() == "Windows" else []),
|
||||
packages=find_packages(),
|
||||
package_data={"platformio": ["*.ini"]},
|
||||
package_data={"platformio": ["projectconftpl.ini", "boards/*.json"]},
|
||||
entry_points={
|
||||
"console_scripts": [
|
||||
"platformio = platformio.__main__:main"
|
||||
|
Reference in New Issue
Block a user