forked from platformio/platformio-core
Compare commits
84 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9cec353d40 | ||
|
|
c841ba1cba | ||
|
|
eb1971fb17 | ||
|
|
983db2f3c8 | ||
|
|
c87c4691f3 | ||
|
|
68c64cd942 | ||
|
|
dfb93e9682 | ||
|
|
b7ab825860 | ||
|
|
28619a6ce7 | ||
|
|
7eed6f56f6 | ||
|
|
234517ee0a | ||
|
|
a483ecdfdb | ||
|
|
97ee8d55ce | ||
|
|
7727562f44 | ||
|
|
f6686f149b | ||
|
|
2345eb3bb7 | ||
|
|
16abaccf96 | ||
|
|
8c8de45f30 | ||
|
|
f4f65e4c84 | ||
|
|
a8ae5e4d03 | ||
|
|
b91f03f082 | ||
|
|
e1396e57b6 | ||
|
|
67cbf25b96 | ||
|
|
e721ebe171 | ||
|
|
c2d760bccb | ||
|
|
5dc1396f05 | ||
|
|
5b1ceccd1f | ||
|
|
bf1751059c | ||
|
|
7e069afbb2 | ||
|
|
bacb813b31 | ||
|
|
c670372b41 | ||
|
|
ec9b8f980d | ||
|
|
28399f8ac6 | ||
|
|
ef5fa4dea0 | ||
|
|
84e82dd39a | ||
|
|
f842898102 | ||
|
|
1bf73c268d | ||
|
|
17ec85263c | ||
|
|
50ba235917 | ||
|
|
14fc21c379 | ||
|
|
306f2f980d | ||
|
|
a7a82b1c0a | ||
|
|
d806097b60 | ||
|
|
9f4b73d821 | ||
|
|
ff5d57039e | ||
|
|
db42863f54 | ||
|
|
946f21879c | ||
|
|
20b214f3a4 | ||
|
|
8aedc50f30 | ||
|
|
cd11171e33 | ||
|
|
bcb4e1abfd | ||
|
|
786b977603 | ||
|
|
5264d85a78 | ||
|
|
5713a6233f | ||
|
|
98ad4adcf3 | ||
|
|
304c023b4e | ||
|
|
7ce1dd4f5c | ||
|
|
332b19f35b | ||
|
|
774ea5240e | ||
|
|
221b7ed188 | ||
|
|
304339e309 | ||
|
|
bf9c9b8985 | ||
|
|
e85bc39315 | ||
|
|
ed32e07e34 | ||
|
|
9bd1f99b69 | ||
|
|
25f57cc683 | ||
|
|
fb4d605e33 | ||
|
|
426b276b08 | ||
|
|
a085d90af2 | ||
|
|
8023b85085 | ||
|
|
f17d2d7f90 | ||
|
|
aef06e837a | ||
|
|
d63f6cff08 | ||
|
|
354fbf6253 | ||
|
|
238ce2e858 | ||
|
|
c8b6bd1c2c | ||
|
|
dd5a509a99 | ||
|
|
970ddd44bf | ||
|
|
c0eded84a0 | ||
|
|
5a83ebe48e | ||
|
|
d90697d8db | ||
|
|
159c0a93d2 | ||
|
|
7d39c886f4 | ||
|
|
020c1c7975 |
270
.pylintrc
270
.pylintrc
@@ -1,29 +1,9 @@
|
||||
[MASTER]
|
||||
|
||||
# Specify a configuration file.
|
||||
#rcfile=
|
||||
|
||||
# Python code to execute, usually for sys.path manipulation such as
|
||||
# pygtk.require().
|
||||
#init-hook=
|
||||
|
||||
# Profiled execution.
|
||||
profile=no
|
||||
|
||||
# Add files or directories to the blacklist. They should be base names, not
|
||||
# paths.
|
||||
ignore=CVS
|
||||
|
||||
# Pickle collected data for later comparisons.
|
||||
persistent=yes
|
||||
|
||||
# List of plugins (as comma separated values of python modules names) to load,
|
||||
# usually to register additional checkers.
|
||||
load-plugins=
|
||||
|
||||
|
||||
[MESSAGES CONTROL]
|
||||
|
||||
# Only show warnings with the listed confidence levels. Leave empty to show
|
||||
# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED
|
||||
confidence=
|
||||
|
||||
# Enable the message, report, category or checker with the given id(s). You can
|
||||
# either give multiple identifier separated by comma (,) or put this option
|
||||
# multiple time. See also the "--disable" option for examples.
|
||||
@@ -38,244 +18,6 @@ load-plugins=
|
||||
# --enable=similarities". If you want to run only the classes checker, but have
|
||||
# no Warning level messages displayed, use"--disable=all --enable=classes
|
||||
# --disable=W"
|
||||
disable=C0103,C0111,E0611,F0401,I0011,R0801,R0903,R0922
|
||||
# disable=import-star-module-level,old-octal-literal,oct-method,print-statement,unpacking-in-except,parameter-unpacking,backtick,old-raise-syntax,old-ne-operator,long-suffix,dict-view-method,dict-iter-method,metaclass-assignment,next-method-called,raising-string,indexing-exception,raw_input-builtin,long-builtin,file-builtin,execfile-builtin,coerce-builtin,cmp-builtin,buffer-builtin,basestring-builtin,apply-builtin,filter-builtin-not-iterating,using-cmp-argument,useless-suppression,range-builtin-not-iterating,suppressed-message,no-absolute-import,old-division,cmp-method,reload-builtin,zip-builtin-not-iterating,intern-builtin,unichr-builtin,reduce-builtin,standarderror-builtin,unicode-builtin,xrange-builtin,coerce-method,delslice-method,getslice-method,setslice-method,input-builtin,round-builtin,hex-method,nonzero-method,map-builtin-not-iterating
|
||||
|
||||
|
||||
[REPORTS]
|
||||
|
||||
# Set the output format. Available formats are text, parseable, colorized, msvs
|
||||
# (visual studio) and html. You can also give a reporter class, eg
|
||||
# mypackage.mymodule.MyReporterClass.
|
||||
output-format=text
|
||||
|
||||
# Put messages in a separate file for each module / package specified on the
|
||||
# command line instead of printing them on stdout. Reports (if any) will be
|
||||
# written in a file name "pylint_global.[txt|html]".
|
||||
files-output=no
|
||||
|
||||
# Tells whether to display a full report or only the messages
|
||||
reports=yes
|
||||
|
||||
# Python expression which should return a note less than 10 (10 is the highest
|
||||
# note). You have access to the variables errors warning, statement which
|
||||
# respectively contain the number of errors / warnings messages and the total
|
||||
# number of statements analyzed. This is used by the global evaluation report
|
||||
# (RP0004).
|
||||
evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10)
|
||||
|
||||
# Add a comment according to your evaluation note. This is used by the global
|
||||
# evaluation report (RP0004).
|
||||
comment=no
|
||||
|
||||
# Template used to display messages. This is a python new-style format string
|
||||
# used to format the message information. See doc for all details
|
||||
#msg-template=
|
||||
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
|
||||
|
||||
|
||||
[BASIC]
|
||||
|
||||
# Required attributes for module, separated by a comma
|
||||
required-attributes=
|
||||
|
||||
# List of builtins function names that should not be used, separated by a comma
|
||||
bad-functions=map,filter,apply,input
|
||||
|
||||
# Regular expression which should only match correct module names
|
||||
module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$
|
||||
|
||||
# Regular expression which should only match correct module level names
|
||||
const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$
|
||||
|
||||
# Regular expression which should only match correct class names
|
||||
class-rgx=[A-Z_][a-zA-Z0-9]+$
|
||||
|
||||
# Regular expression which should only match correct function names
|
||||
function-rgx=[a-z_][a-z0-9_]{2,30}$
|
||||
|
||||
# Regular expression which should only match correct method names
|
||||
method-rgx=[a-z_][a-z0-9_]{2,30}$
|
||||
|
||||
# Regular expression which should only match correct instance attribute names
|
||||
attr-rgx=[a-z_][a-z0-9_]{2,30}$
|
||||
|
||||
# Regular expression which should only match correct argument names
|
||||
argument-rgx=[a-z_][a-z0-9_]{2,30}$
|
||||
|
||||
# Regular expression which should only match correct variable names
|
||||
variable-rgx=[a-z_][a-z0-9_]{2,30}$
|
||||
|
||||
# Regular expression which should only match correct attribute names in class
|
||||
# bodies
|
||||
class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$
|
||||
|
||||
# Regular expression which should only match correct list comprehension /
|
||||
# generator expression variable names
|
||||
inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$
|
||||
|
||||
# Good variable names which should always be accepted, separated by a comma
|
||||
good-names=i,j,k,ex,Run,_
|
||||
|
||||
# Bad variable names which should always be refused, separated by a comma
|
||||
bad-names=foo,bar,baz,toto,tutu,tata
|
||||
|
||||
# Regular expression which should only match function or class names that do
|
||||
# not require a docstring.
|
||||
no-docstring-rgx=__.*__
|
||||
|
||||
# Minimum line length for functions/classes that require docstrings, shorter
|
||||
# ones are exempt.
|
||||
docstring-min-length=-1
|
||||
|
||||
|
||||
[FORMAT]
|
||||
|
||||
# Maximum number of characters on a single line.
|
||||
max-line-length=80
|
||||
|
||||
# Regexp for a line that is allowed to be longer than the limit.
|
||||
ignore-long-lines=^\s*(# )?<?https?://\S+>?$
|
||||
|
||||
# Allow the body of an if to be on the same line as the test if there is no
|
||||
# else.
|
||||
single-line-if-stmt=no
|
||||
|
||||
# List of optional constructs for which whitespace checking is disabled
|
||||
no-space-check=trailing-comma,dict-separator
|
||||
|
||||
# Maximum number of lines in a module
|
||||
max-module-lines=1000
|
||||
|
||||
# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1
|
||||
# tab).
|
||||
indent-string=' '
|
||||
|
||||
|
||||
[MISCELLANEOUS]
|
||||
|
||||
# List of note tags to take in consideration, separated by a comma.
|
||||
notes=FIXME,XXX,TODO
|
||||
|
||||
|
||||
[SIMILARITIES]
|
||||
|
||||
# Minimum lines number of a similarity.
|
||||
min-similarity-lines=4
|
||||
|
||||
# Ignore comments when computing similarities.
|
||||
ignore-comments=yes
|
||||
|
||||
# Ignore docstrings when computing similarities.
|
||||
ignore-docstrings=yes
|
||||
|
||||
# Ignore imports when computing similarities.
|
||||
ignore-imports=no
|
||||
|
||||
|
||||
[TYPECHECK]
|
||||
|
||||
# Tells whether missing members accessed in mixin class should be ignored. A
|
||||
# mixin class is detected if its name ends with "mixin" (case insensitive).
|
||||
ignore-mixin-members=yes
|
||||
|
||||
# List of classes names for which member attributes should not be checked
|
||||
# (useful for classes with attributes dynamically set).
|
||||
ignored-classes=SQLObject
|
||||
|
||||
# When zope mode is activated, add a predefined set of Zope acquired attributes
|
||||
# to generated-members.
|
||||
zope=no
|
||||
|
||||
# List of members which are set dynamically and missed by pylint inference
|
||||
# system, and so shouldn't trigger E0201 when accessed. Python regular
|
||||
# expressions are accepted.
|
||||
generated-members=REQUEST,acl_users,aq_parent
|
||||
|
||||
|
||||
[VARIABLES]
|
||||
|
||||
# Tells whether we should check for unused import in __init__ files.
|
||||
init-import=no
|
||||
|
||||
# A regular expression matching the beginning of the name of dummy variables
|
||||
# (i.e. not used).
|
||||
dummy-variables-rgx=_$|dummy
|
||||
|
||||
# List of additional names supposed to be defined in builtins. Remember that
|
||||
# you should avoid to define new builtins when possible.
|
||||
additional-builtins=
|
||||
|
||||
|
||||
[CLASSES]
|
||||
|
||||
# List of interface methods to ignore, separated by a comma. This is used for
|
||||
# instance to not check methods defines in Zope's Interface base class.
|
||||
ignore-iface-methods=isImplementedBy,deferred,extends,names,namesAndDescriptions,queryDescriptionFor,getBases,getDescriptionFor,getDoc,getName,getTaggedValue,getTaggedValueTags,isEqualOrExtendedBy,setTaggedValue,isImplementedByInstancesOf,adaptWith,is_implemented_by
|
||||
|
||||
# List of method names used to declare (i.e. assign) instance attributes.
|
||||
defining-attr-methods=__init__,__new__,setUp
|
||||
|
||||
# List of valid names for the first argument in a class method.
|
||||
valid-classmethod-first-arg=cls
|
||||
|
||||
# List of valid names for the first argument in a metaclass class method.
|
||||
valid-metaclass-classmethod-first-arg=mcs
|
||||
|
||||
|
||||
[DESIGN]
|
||||
|
||||
# Maximum number of arguments for function / method
|
||||
max-args=5
|
||||
|
||||
# Argument names that match this expression will be ignored. Default to name
|
||||
# with leading underscore
|
||||
ignored-argument-names=_.*
|
||||
|
||||
# Maximum number of locals for function / method body
|
||||
max-locals=15
|
||||
|
||||
# Maximum number of return / yield for function / method body
|
||||
max-returns=6
|
||||
|
||||
# Maximum number of branch for function / method body
|
||||
max-branches=12
|
||||
|
||||
# Maximum number of statements in function / method body
|
||||
max-statements=50
|
||||
|
||||
# Maximum number of parents for a class (see R0901).
|
||||
max-parents=7
|
||||
|
||||
# Maximum number of attributes for a class (see R0902).
|
||||
max-attributes=7
|
||||
|
||||
# Minimum number of public methods for a class (see R0903).
|
||||
min-public-methods=2
|
||||
|
||||
# Maximum number of public methods for a class (see R0904).
|
||||
max-public-methods=20
|
||||
|
||||
|
||||
[IMPORTS]
|
||||
|
||||
# Deprecated modules which should not be used, separated by a comma
|
||||
deprecated-modules=regsub,TERMIOS,Bastion,rexec
|
||||
|
||||
# Create a graph of every (i.e. internal and external) dependencies in the
|
||||
# given file (report RP0402 must not be disabled)
|
||||
import-graph=
|
||||
|
||||
# Create a graph of external dependencies in the given file (report RP0402 must
|
||||
# not be disabled)
|
||||
ext-import-graph=
|
||||
|
||||
# Create a graph of internal dependencies in the given file (report RP0402 must
|
||||
# not be disabled)
|
||||
int-import-graph=
|
||||
|
||||
|
||||
[EXCEPTIONS]
|
||||
|
||||
# Exceptions that will emit a warning when being caught. Defaults to
|
||||
# "Exception"
|
||||
overgeneral-exceptions=Exception
|
||||
disable=locally-disabled,missing-docstring,invalid-name,too-few-public-methods,redefined-variable-type,import-error,similarities,unsupported-membership-test,unsubscriptable-object,ungrouped-imports
|
||||
|
||||
39
HISTORY.rst
39
HISTORY.rst
@@ -4,6 +4,43 @@ Release History
|
||||
PlatformIO 2.0
|
||||
--------------
|
||||
|
||||
2.5.0 (2015-12-08)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Improved code builder for parallel builds (up to 4 times faster than before)
|
||||
* Generate `.travis.yml <http://docs.platformio.org/en/latest/ci/travis.html>`__
|
||||
CI and `.gitignore` files for embedded projects by default
|
||||
(`issue #354 <https://github.com/platformio/platformio/issues/354>`_)
|
||||
* Removed prompt with "auto-uploading" from `platformio init <http://docs.platformio.org/en/latest/userguide/cmd_init.html>`__
|
||||
command and added ``--enable-auto-uploading`` option
|
||||
(`issue #352 <https://github.com/platformio/platformio/issues/352>`_)
|
||||
* Fixed incorrect behaviour of `platformio serialports monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`__
|
||||
in pair with PySerial 3.0
|
||||
|
||||
2.4.1 (2015-12-01)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Restored ``PLATFORMIO`` macros with the current version
|
||||
|
||||
2.4.0 (2015-12-01)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
* Added support for the new boards: Atmel ATSAMR21-XPRO, Atmel SAML21-XPRO-B,
|
||||
Atmel SAMD21-XPRO, ST 32F469IDISCOVERY, ST 32L476GDISCOVERY, ST Nucleo F031K6,
|
||||
ST Nucleo F042K6, ST Nucleo F303K8 and ST Nucleo L476RG
|
||||
* Updated Arduino core for Espressif platform to 2.0.0
|
||||
(`issue #345 <https://github.com/platformio/platformio/issues/345>`_)
|
||||
* Added to FAQ explanation of `Can not compile a library that compiles without issue
|
||||
with Arduino IDE <http://docs.platformio.org/en/latest/faq.html#building>`_
|
||||
(`issue #331 <https://github.com/platformio/platformio/issues/331>`_)
|
||||
* Fixed ESP-12E flash size
|
||||
(`pull #333 <https://github.com/platformio/platformio/pull/333>`_)
|
||||
* Fixed configuration for LowPowerLab MoteinoMEGA board
|
||||
(`issue #335 <https://github.com/platformio/platformio/issues/335>`_)
|
||||
* Fixed "LockFailed: failed to create appstate.json.lock" error for Windows
|
||||
* Fixed relative include path for preprocessor using ``build_flags``
|
||||
(`issue #271 <https://github.com/platformio/platformio/issues/271>`_)
|
||||
|
||||
2.3.5 (2015-11-18)
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
@@ -195,7 +232,7 @@ PlatformIO 2.0
|
||||
* Automatically detect upload port using VID:PID board settings
|
||||
(`issue #231 <https://github.com/platformio/platformio/issues/231>`_)
|
||||
* Improved detection of build changes
|
||||
* Avoided ``LibInstallDependencyError`` when more then 1 library is found
|
||||
* Avoided ``LibInstallDependencyError`` when more than 1 library is found
|
||||
(`issue #229 <https://github.com/platformio/platformio/issues/229>`_)
|
||||
|
||||
2.1.0 (2015-06-03)
|
||||
|
||||
33
README.rst
33
README.rst
@@ -32,7 +32,7 @@ PlatformIO
|
||||
`Home & Demo <http://platformio.org>`_ |
|
||||
`Project Examples <https://github.com/platformio/platformio/tree/develop/examples>`_ |
|
||||
`Source Code <https://github.com/platformio>`_ |
|
||||
`Documentation <http://docs.platformio.org>`_ ||
|
||||
`Documentation <http://docs.platformio.org>`_ |
|
||||
`Blog <http://www.ikravets.com/category/computer-life/platformio>`_ |
|
||||
`Twitter <https://twitter.com/PlatformIO_Org>`_ |
|
||||
`Hackaday <https://hackaday.io/project/7980-platformio>`_ |
|
||||
@@ -42,9 +42,20 @@ PlatformIO
|
||||
.. image:: https://raw.githubusercontent.com/platformio/platformio/develop/docs/_static/platformio-logo.png
|
||||
:target: http://platformio.org
|
||||
|
||||
`PlatformIO <http://platformio.org>`_ is an open-source cross-platform code
|
||||
builder and the missing library manager (Ready for embedded development, IDE
|
||||
and Continuous integration, Arduino and MBED compatible).
|
||||
`PlatformIO <http://platformio.org>`_ is an open source ecosystem for IoT
|
||||
development. Cross-platform code builder and library manager. Continuous and
|
||||
IDE integration. Arduino and MBED compatible. Ready for Cloud compiling.
|
||||
|
||||
* **Development Platforms** - Embedded and Desktop development platforms with
|
||||
pre-built toolchains, debuggers, uploaders and frameworks which work under
|
||||
popular host OS: Mac, Windows, Linux (+ARM)
|
||||
* **Embedded Boards** - Rapid Embedded Programming, IDE and Continuous
|
||||
Integration in a few steps with PlatformIO thanks to built-in project
|
||||
generator for the most popular embedded boards and IDE
|
||||
* **Library Manager** - Hundreds Popular Libraries are organized into single
|
||||
Web 2.0 platform: list by categories, keywords, authors, compatible
|
||||
platforms and frameworks; learn via examples; be up-to-date with the latest
|
||||
version
|
||||
|
||||
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
|
||||
Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed,
|
||||
@@ -66,15 +77,10 @@ libOpenCM3, etc.*
|
||||
* `FAQ <http://docs.platformio.org/en/latest/faq.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 and pre-configured settings for
|
||||
the most popular embedded boards. For further details, please
|
||||
refer to `What is PlatformIO? <http://docs.platformio.org/en/latest/faq.html#what-is-platformio>`_
|
||||
|
||||
Use whenever. *Run everywhere.*
|
||||
-------------------------------
|
||||
*PlatformIO* is written in pure *Python* and **doesn't depend** on any
|
||||
additional libraries/tools from an operation system. It allows you to use
|
||||
additional libraries/tools from an operating system. It allows you to use
|
||||
*PlatformIO* beginning from *PC (Mac, Linux, Win)* and ending with credit-card
|
||||
sized computers (`Raspberry Pi <http://www.raspberrypi.org>`_,
|
||||
`BeagleBone <http://beagleboard.org>`_,
|
||||
@@ -88,7 +94,7 @@ settings for most popular `Embedded Boards <http://platformio.org/#!/boards>`_.
|
||||
* Colourful `command-line output <https://raw.githubusercontent.com/platformio/platformio/develop/examples/platformio-examples.png>`_
|
||||
* `IDE Integration <http://docs.platformio.org/en/latest/ide.html>`_ with
|
||||
*Arduino, Eclipse, Energia, Qt Creator, Sublime Text, Vim, Visual Studio*
|
||||
* `Continuous Integration <http://docs.platformio.org/en/latest/ci/index.html>`_
|
||||
* Cloud compiling and `Continuous Integration <http://docs.platformio.org/en/latest/ci/index.html>`_
|
||||
with *AppVeyor, Circle CI, Drone, Shippable, Travis CI*
|
||||
* Built-in `Serial Port Monitor <http://docs.platformio.org/en/latest/userguide/cmd_serialports.html#platformio-serialports-monitor>`_ and configurable
|
||||
`build -flags/-options <http://docs.platformio.org/en/latest/projectconf.html#build-flags>`_
|
||||
@@ -134,8 +140,8 @@ cross-platform substitute for the classic *Make* utility.
|
||||
|
||||
Single source code. *Multiple platforms.*
|
||||
-----------------------------------------
|
||||
*PlatformIO* allows developer to compile the same code with different
|
||||
development platforms using the *Only One Command*
|
||||
*PlatformIO* allows the developer to compile the same code with different
|
||||
development platforms using only *One Command*
|
||||
`platformio run <http://docs.platformio.org/en/latest/userguide/cmd_run.html>`_.
|
||||
This happens due to
|
||||
`Project Configuration File (platformio.ini) <http://docs.platformio.org/en/latest/projectconf.html>`_
|
||||
@@ -166,6 +172,7 @@ Frameworks:
|
||||
* `SPL <http://platformio.org/#!/frameworks/spl>`_
|
||||
* `mbed <http://platformio.org/#!/frameworks/mbed>`_
|
||||
|
||||
For further details, please refer to `What is PlatformIO? <http://docs.platformio.org/en/latest/faq.html#what-is-platformio>`_
|
||||
|
||||
Licence
|
||||
-------
|
||||
|
||||
@@ -1,11 +1,6 @@
|
||||
machine:
|
||||
python:
|
||||
version: 2.7
|
||||
environment:
|
||||
TOX_ENV: docs
|
||||
TOX_ENV: lint
|
||||
TOX_ENV: py26
|
||||
TOX_ENV: py27
|
||||
|
||||
checkout:
|
||||
post:
|
||||
@@ -18,4 +13,4 @@ dependencies:
|
||||
|
||||
test:
|
||||
override:
|
||||
- tox -e $TOX_ENV
|
||||
- tox -e py27
|
||||
|
||||
BIN
docs/_static/ci-travis-logo.png
vendored
Normal file
BIN
docs/_static/ci-travis-logo.png
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 20 KiB |
254
docs/_static/extra.css
vendored
Normal file
254
docs/_static/extra.css
vendored
Normal file
@@ -0,0 +1,254 @@
|
||||
/**
|
||||
* Copyright 2014-2015 Ivan Kravets <me@ikravets.com>
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
header,
|
||||
nav {
|
||||
display: block;
|
||||
}
|
||||
|
||||
#pionav {
|
||||
display: none;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
#pionav {
|
||||
display: block !important;
|
||||
}
|
||||
body {
|
||||
padding-top: 50px;
|
||||
}
|
||||
.wy-nav-side {
|
||||
top: 50px;
|
||||
}
|
||||
.container {
|
||||
width: 750px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 992px) {
|
||||
.container {
|
||||
width: 970px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 1200px) {
|
||||
.container {
|
||||
width: 1170px;
|
||||
}
|
||||
}
|
||||
.container-fluid {
|
||||
padding-right: 15px;
|
||||
padding-left: 15px;
|
||||
margin-right: auto;
|
||||
margin-left: auto;
|
||||
}
|
||||
|
||||
.container:before,
|
||||
.container:after,
|
||||
.container-fluid:before,
|
||||
.container-fluid:after,
|
||||
.nav:before,
|
||||
.nav:after,
|
||||
.navbar:before,
|
||||
.navbar:after,
|
||||
.navbar-header:before,
|
||||
.navbar-header:after {
|
||||
display: table;
|
||||
content: " ";
|
||||
}
|
||||
.container:after,
|
||||
.container-fluid:after,
|
||||
.nav:after,
|
||||
.navbar:after,
|
||||
.navbar-header:after {
|
||||
clear: both;
|
||||
}
|
||||
|
||||
.nav {
|
||||
padding-left: 0;
|
||||
margin-bottom: 0;
|
||||
list-style: none;
|
||||
}
|
||||
.nav > li {
|
||||
position: relative;
|
||||
display: block;
|
||||
}
|
||||
.nav > li > a {
|
||||
position: relative;
|
||||
display: block;
|
||||
padding: 10px 15px;
|
||||
}
|
||||
.nav > li > a:hover,
|
||||
.nav > li > a:focus {
|
||||
text-decoration: none;
|
||||
background-color: #eee;
|
||||
}
|
||||
.nav > li > a > img {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.navbar {
|
||||
position: relative;
|
||||
min-height: 50px;
|
||||
margin-bottom: 20px;
|
||||
border: 1px solid transparent;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.navbar {
|
||||
border-radius: 4px;
|
||||
}
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.navbar-header {
|
||||
float: left;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.navbar-fixed-top {
|
||||
padding-right: 0;
|
||||
padding-left: 0;
|
||||
}
|
||||
}
|
||||
.navbar-fixed-top {
|
||||
max-height: 340px;
|
||||
}
|
||||
.container > .navbar-header,
|
||||
.container-fluid > .navbar-header {
|
||||
margin-right: -15px;
|
||||
margin-left: -15px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.container > .navbar-header,
|
||||
.container-fluid > .navbar-header {
|
||||
margin-right: 0;
|
||||
margin-left: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-fixed-top {
|
||||
position: fixed;
|
||||
right: 0;
|
||||
left: 0;
|
||||
z-index: 1030;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.navbar-fixed-top {
|
||||
border-radius: 0;
|
||||
}
|
||||
}
|
||||
.navbar-fixed-top {
|
||||
top: 0;
|
||||
border-width: 0 0 1px;
|
||||
}
|
||||
.navbar-fixed-bottom {
|
||||
bottom: 0;
|
||||
margin-bottom: 0;
|
||||
border-width: 1px 0 0;
|
||||
}
|
||||
.navbar-brand {
|
||||
float: left;
|
||||
height: 50px;
|
||||
padding: 15px 15px;
|
||||
font-size: 18px;
|
||||
line-height: 20px;
|
||||
}
|
||||
.navbar-brand:hover,
|
||||
.navbar-brand:focus {
|
||||
text-decoration: none;
|
||||
}
|
||||
.navbar-brand > img {
|
||||
display: block;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.navbar > .container .navbar-brand,
|
||||
.navbar > .container-fluid .navbar-brand {
|
||||
margin-left: -15px;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-nav {
|
||||
margin: 7.5px -15px;
|
||||
}
|
||||
.navbar-nav > li > a {
|
||||
padding-top: 10px;
|
||||
padding-bottom: 10px;
|
||||
line-height: 20px;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.navbar-nav {
|
||||
float: left;
|
||||
margin: 0;
|
||||
}
|
||||
.navbar-nav > li {
|
||||
float: left;
|
||||
}
|
||||
.navbar-nav > li > a {
|
||||
padding-top: 15px;
|
||||
padding-bottom: 15px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
.navbar-left {
|
||||
float: left !important;
|
||||
}
|
||||
.navbar-right {
|
||||
float: right !important;
|
||||
margin-right: -15px;
|
||||
}
|
||||
.navbar-right ~ .navbar-right {
|
||||
margin-right: 0;
|
||||
}
|
||||
}
|
||||
|
||||
.navbar-inverse {
|
||||
background-color: #222;
|
||||
border-color: #080808;
|
||||
}
|
||||
.navbar-inverse .navbar-brand {
|
||||
color: #9d9d9d;
|
||||
}
|
||||
.navbar-inverse .navbar-brand:hover,
|
||||
.navbar-inverse .navbar-brand:focus {
|
||||
color: #fff;
|
||||
background-color: transparent;
|
||||
}
|
||||
.navbar-inverse .navbar-text {
|
||||
color: #9d9d9d;
|
||||
}
|
||||
.navbar-inverse .navbar-nav > li > a {
|
||||
color: #9d9d9d;
|
||||
}
|
||||
.navbar-inverse .navbar-nav > li > a:hover,
|
||||
.navbar-inverse .navbar-nav > li > a:focus {
|
||||
color: #fff;
|
||||
background-color: transparent;
|
||||
}
|
||||
.navbar-inverse .navbar-nav > .active > a,
|
||||
.navbar-inverse .navbar-nav > .active > a:hover,
|
||||
.navbar-inverse .navbar-nav > .active > a:focus {
|
||||
color: #fff;
|
||||
background-color: #080808;
|
||||
}
|
||||
|
||||
.navbar-header .navbar-brand {
|
||||
color: #e0e0e0;
|
||||
}
|
||||
BIN
docs/_static/favicon.ico
vendored
Normal file
BIN
docs/_static/favicon.ico
vendored
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
BIN
docs/_static/platformio-logo.png
vendored
BIN
docs/_static/platformio-logo.png
vendored
Binary file not shown.
|
Before Width: | Height: | Size: 13 KiB After Width: | Height: | Size: 28 KiB |
31
docs/_templates/footer.html
vendored
Normal file
31
docs/_templates/footer.html
vendored
Normal file
@@ -0,0 +1,31 @@
|
||||
{% extends "!footer.html" %}
|
||||
|
||||
{% block extrafooter %}
|
||||
<link rel="stylesheet" href="{{ pathto('_static/extra.css', 1) }}" type="text/css" />
|
||||
<header id="pionav" class="navbar navbar-inverse navbar-fixed-top">
|
||||
<div class="container container-fluid">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="http://platformio.org/"></i> PlatformIO</a>
|
||||
</div>
|
||||
|
||||
<nav role="navigation">
|
||||
<div>
|
||||
<ul class="nav navbar-nav">
|
||||
<li><a href="http://platformio.org/#!/get-started"><i class="fa fa-rocket fa-lg"></i> Get Started</a></li>
|
||||
<li><a href="http://platformio.org/#!/platforms"><i class="fa fa-laptop fa-lg"></i> Platforms</a></li>
|
||||
<li><a href="http://platformio.org/#!/frameworks"><i class="fa fa-cogs fa-lg"></i> Frameworks</a></li>
|
||||
<li><a href="http://platformio.org/#!/boards"><i class="fa fa-gamepad fa-lg"></i> Boards</a></li>
|
||||
<li ><a href="http://platformio.org/#!/lib"><i class="fa fa-code fa-lg"></i> Libraries</a></li>
|
||||
</ul>
|
||||
|
||||
<ul class="nav navbar-nav navbar-right">
|
||||
<li><a href="http://platformio.org/#!/who-uses"><i class="fa fa-heart-o fa-lg"></i> Who uses</a></li>
|
||||
<li class="active"><a href="http://docs.platformio.org/"><i class="fa fa-book fa-lg"></i> Docs</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
</nav>
|
||||
</div>
|
||||
</header>
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
@@ -23,10 +23,17 @@ Here are recent articles about PlatformIO:
|
||||
2015
|
||||
^^^^
|
||||
|
||||
* Dec 01, 2015 - **Tateno Yuichi** - `ESP8266 を CUI で開発する (Develop a ESP8266 in CUI, Japanese) <http://jaywiggins.com/platformio/arduino/avr/es8266/2015/09/30/platformio-investigation/>`_
|
||||
* Nov 29, 2015 - **Keith Hughes** - `Using PlatformIO for Embedded Projects <http://smartspacestuff.blogspot.com/2015/11/using-platformio-for-embedded-projects.html>`_
|
||||
* Nov 22, 2015 - **Michał Seroczyński** - `Using PlatformIO to get started with Arduino in CLion IDE <http://www.ches.pl/using-platformio-get-started-arduino-clion-ide/>`_
|
||||
* Nov 09, 2015 - **ÁLvaro García Gómez** - `Programar con Arduino "The good way" (Programming with Arduino "The good way", Spanish) <http://congdegnu.es/2015/11/09/programar-con-arduino-the-good-way/>`_
|
||||
* Nov 06, 2015 - **nocd5** - `PlatformIOでmbedをオフラインビルドしSTM32 Nucleoボードでmrubyを使う (Use mruby in the offline build for STM32 Nucleo board with mbed and PlatformIO, Japanese) <http://qiita.com/nocd5/items/d5fda776240f7e7c17eb>`_
|
||||
* Oct 21, 2015 - **Vittorio Zaccaria** - `Using a cheap STM32 Nucleo to teach remote sensor monitoring <http://www.vittoriozaccaria.net/blog/2015/10/21/using-a-cheap-stm32-nucleo-to-teach-remote-sensor-monitoring.html>`_
|
||||
* Oct 18, 2015 - **Nico Coetzee** - `First Arduino I2C Experience with PlatformIO <https://electronicventurer.wordpress.com/2015/10/18/first-arduino-i2c-experience/>`_
|
||||
* Oct 01, 2015 - **Mistan** - `Compile and Upload Arduino Sketch with PlatformIO for Raspberry Pi Running Arch Linux <http://tech.memoryimprintstudio.com/code-building-for-arduino-with-platformio-for-raspberry-pi-with-arch-linux/>`_
|
||||
* Sep 30, 2015 - **Jay Wiggins** - `PlatformIO Investigation <http://jaywiggins.com/platformio/arduino/avr/es8266/2015/09/30/platformio-investigation/>`_
|
||||
* Sep 01, 2015 - **Thomas P. Weldon, Ph.D.** - `Improvised MBED FRDM-K64F Eclipse/PlatformIO Setup and Software Installation <http://thomasweldon.com/tpw/courses/embeddsp/p00pcFrdmK64_eclipsePlatformioSetup.html>`_
|
||||
* Aug 08, 2015 - **Josh Glendenning** - `Armstrap Eagle and PlatformIO <http://isobit.io/2015/08/08/armstrap.html>`_
|
||||
* Aug 01, 2015 - **Russell Davis** - `PlatformIO on the Raspberry Pi <http://www.russelldavis.org/2015/08/01/platformio-on-the-raspberry-pi/>`_
|
||||
* Jul 25, 2015 - **DinoTools** - `Erste Schritte mit PlatformIO (Getting Started with PlatformIO, German) <https://www.dinotools.de/2015/07/25/erste-schritte-mit-platformio/>`_
|
||||
* Jul 20, 2015 - **Eli Fatsi** - `Arduino Development in Atom Editor <http://viget.com/extend/arduino-development-in-atom-editor>`_
|
||||
|
||||
@@ -37,49 +37,169 @@ different :ref:`platforms`.
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Put ``circle.yml`` to the root directory of the GitHub repository.
|
||||
Please make sure to read Circle CI `Getting Started <https://circleci.com/docs/getting-started>`_
|
||||
guide first.
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
# Install the latest stable PlatformIO
|
||||
- sudo pip install -U platformio
|
||||
|
||||
test:
|
||||
override:
|
||||
- platformio ci path/to/test/file.c --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
- platformio ci examples/file.ino --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
- platformio ci path/to/test/directory --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
|
||||
For more details as for PlatformIO build process please look into :ref:`cmd_ci`.
|
||||
|
||||
Project as a library
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
When project is written as a library (where own examples or testing code use
|
||||
it), please use ``--lib="."`` option for :ref:`cmd_ci` command
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
script:
|
||||
- platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
Library dependecies
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
There 2 options to test source code with dependent libraries:
|
||||
|
||||
Install dependent library using :ref:`librarymanager`
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
# Install the latest stable PlatformIO
|
||||
- sudo pip install -U platformio
|
||||
|
||||
# OneWire Library with ID=1 http://platformio.org/#!/lib/show/1/OneWire
|
||||
- platformio lib install 1
|
||||
|
||||
test:
|
||||
override:
|
||||
- platformio ci path/to/test/file.c --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
Manually download dependent library and include in build process via ``--lib`` option
|
||||
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
# Install the latest stable PlatformIO
|
||||
- sudo pip install -U platformio
|
||||
|
||||
# download library to the temporary directory
|
||||
- wget https://github.com/PaulStoffregen/OneWire/archive/master.zip -O /tmp/onewire_source.zip
|
||||
- unzip /tmp/onewire_source.zip -d /tmp/
|
||||
|
||||
test:
|
||||
override:
|
||||
- platformio ci path/to/test/file.c --lib="/tmp/OneWire-master" --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
Custom Build Flags
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
PlatformIO allows to specify own build flags using :envvar:`PLATFORMIO_BUILD_FLAGS` environment
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
machine:
|
||||
environment:
|
||||
PLATFORMIO_CI_SRC: path/to/source/file.c
|
||||
PLATFORMIO_CI_SRC: path/to/source/file.ino
|
||||
PLATFORMIO_CI_SRC: path/to/source/directory
|
||||
PLATFORMIO_BUILD_FLAGS: -D SPECIFIC_MACROS -I/extra/inc
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
- sudo apt-get install python2.7-dev
|
||||
- sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
|
||||
For the more details, please follow to
|
||||
:ref:`available build flags/options <projectconf_build_flags>`.
|
||||
|
||||
|
||||
Advanced configuration
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
PlatformIO allows to configure multiple build environments for the single
|
||||
source code using :ref:`projectconf`.
|
||||
|
||||
Instead of ``--board`` option, please use :option:`platformio ci --project-conf`
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
test:
|
||||
override:
|
||||
- platformio ci --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
|
||||
|
||||
For more details as for PlatformIO build process please look into :ref:`cmd_ci`
|
||||
command.
|
||||
- platformio ci path/to/test/file.c --project-conf=/path/to/platoformio.ini
|
||||
|
||||
Examples
|
||||
--------
|
||||
|
||||
1. Integration for `USB_Host_Shield_2.0 <https://github.com/felis/USB_Host_Shield_2.0>`_
|
||||
project. The ``circle.yml`` configuration file:
|
||||
1. Custom build flags
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
machine:
|
||||
environment:
|
||||
PLATFORMIO_CI_SRC: examples/Bluetooth/PS3SPP/PS3SPP.ino
|
||||
PLATFORMIO_CI_SRC: examples/pl2303/pl2303_gps/pl2303_gps.ino
|
||||
|
||||
dependencies:
|
||||
cache_directories:
|
||||
- "~/.platformio"
|
||||
|
||||
pre:
|
||||
- sudo apt-get install python2.7-dev
|
||||
- sudo python -c "$(curl -fsSL https://raw.githubusercontent.com/platformio/platformio/master/scripts/get-platformio.py)"
|
||||
- wget https://github.com/xxxajk/spi4teensy3/archive/master.zip -O /tmp/spi4teensy3.zip
|
||||
- unzip /tmp/spi4teensy3.zip -d /tmp
|
||||
- sudo pip install -U platformio
|
||||
|
||||
# pre-install PlatformIO development platforms, they will be cached
|
||||
- platformio platforms install atmelavr atmelsam teensy
|
||||
|
||||
#
|
||||
# Libraries from PlatformIO Library Registry:
|
||||
#
|
||||
# http://platformio.org/#!/lib/show/416/TinyGPS
|
||||
# http://platformio.org/#!/lib/show/417/SPI4Teensy3
|
||||
- platformio lib install 416 417
|
||||
|
||||
test:
|
||||
override:
|
||||
- platformio ci --lib="." --lib="/tmp/spi4teensy3-master" --board=uno --board=teensy31 --board=due
|
||||
- platformio ci examples/acm/acm_terminal --board=uno --board=teensy31 --board=due --lib="."
|
||||
- platformio ci examples/adk/adk_barcode --board=uno --board=teensy31 --board=due --lib="."
|
||||
- platformio ci examples/adk/ArduinoBlinkLED --board=uno --board=teensy31 --board=due --lib="."
|
||||
- platformio ci examples/adk/demokit_20 --board=uno --board=teensy31 --board=due --lib="."
|
||||
# ...
|
||||
- platformio ci examples/Xbox/XBOXUSB --board=uno --board=teensy31 --board=due --lib="."
|
||||
|
||||
* Configuration file: https://github.com/ivankravets/USB_Host_Shield_2.0/blob/master/circle.yml
|
||||
* Build History: https://circleci.com/gh/ivankravets/USB_Host_Shield_2.0/tree/master
|
||||
|
||||
2. Dependency on external libraries
|
||||
|
||||
.. code-block:: yaml
|
||||
|
||||
dependencies:
|
||||
pre:
|
||||
# Install the latest stable PlatformIO
|
||||
- sudo pip install -U platformio
|
||||
|
||||
# download dependent libraries
|
||||
- wget https://github.com/jcw/jeelib/archive/master.zip -O /tmp/jeelib.zip
|
||||
- unzip /tmp/jeelib.zip -d /tmp
|
||||
|
||||
- wget https://github.com/Rodot/Gamebuino/archive/master.zip -O /tmp/gamebuino.zip
|
||||
- unzip /tmp/gamebuino.zip -d /tmp
|
||||
|
||||
test:
|
||||
override:
|
||||
- platformio ci examples/backSoon/backSoon.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
|
||||
- platformio ci examples/etherNode/etherNode.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
|
||||
- platformio ci examples/getDHCPandDNS/getDHCPandDNS.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
|
||||
- platformio ci examples/getStaticIP/getStaticIP.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
|
||||
# ...
|
||||
- platformio ci examples/twitter/twitter.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
|
||||
- platformio ci examples/udpClientSendOnly/udpClientSendOnly.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
|
||||
- platformio ci examples/udpListener/udpListener.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
|
||||
- platformio ci examples/webClient/webClient.ino --lib="." --lib="/tmp/jeelib-master" --lib="/tmp/Gamebuino-master/libraries/tinyFAT" --board=uno --board=megaatmega2560
|
||||
|
||||
* Configuration file: hhttps://github.com/ivankravets/ethercard/blob/master/circle.yaml
|
||||
* Build History: https://circleci.com/gh/ivankravets/ethercard/tree/master
|
||||
|
||||
@@ -14,6 +14,13 @@
|
||||
Travis CI
|
||||
=========
|
||||
|
||||
.. image:: ../_static/ci-travis-logo.png
|
||||
:target: https://docs.travis-ci.com/user/integration/platformio/
|
||||
|
||||
|
||||
**Travis CI** `officially supports <https://docs.travis-ci.com/user/integration/platformio/>`_
|
||||
**PlatformIO for Embedded Builds.**
|
||||
|
||||
`Travis CI <http://en.wikipedia.org/wiki/Travis_CI>`_ is an open-source hosted,
|
||||
distributed continuous integration service used to build and test projects
|
||||
hosted at `GitHub <http://en.wikipedia.org/wiki/GitHub>`_.
|
||||
|
||||
26
docs/conf.py
26
docs/conf.py
@@ -119,12 +119,12 @@ html_theme = 'default'
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top
|
||||
# of the sidebar.
|
||||
#html_logo = None
|
||||
#html_logo = '_static/platformio-logo.png'
|
||||
|
||||
# The name of an image file (within the static path) to use as favicon of the
|
||||
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
|
||||
# pixels large.
|
||||
#html_favicon = None
|
||||
html_favicon = '_static/favicon.ico'
|
||||
|
||||
# Add any paths that contain custom static files (such as style sheets) here,
|
||||
# relative to this directory. They are copied after the builtin static files,
|
||||
@@ -184,22 +184,22 @@ htmlhelp_basename = 'PlatformIOdoc'
|
||||
# -- Options for LaTeX output ---------------------------------------------
|
||||
|
||||
latex_elements = {
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
# The paper size ('letterpaper' or 'a4paper').
|
||||
#'papersize': 'letterpaper',
|
||||
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
# The font size ('10pt', '11pt' or '12pt').
|
||||
#'pointsize': '10pt',
|
||||
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
# Additional stuff for the LaTeX preamble.
|
||||
#'preamble': '',
|
||||
}
|
||||
|
||||
# Grouping the document tree into LaTeX files. List of tuples
|
||||
# (source start file, target name, title,
|
||||
# author, documentclass [howto, manual, or own class]).
|
||||
latex_documents = [
|
||||
('index', 'PlatformIO.tex', u'PlatformIO Documentation',
|
||||
u'Ivan Kravets', 'manual'),
|
||||
('index', 'PlatformIO.tex', u'PlatformIO Documentation',
|
||||
u'Ivan Kravets', 'manual'),
|
||||
]
|
||||
|
||||
# The name of an image file (relative to this directory) to place at the top of
|
||||
@@ -242,9 +242,9 @@ man_pages = [
|
||||
# (source start file, target name, title, author,
|
||||
# dir menu entry, description, category)
|
||||
texinfo_documents = [
|
||||
('index', 'PlatformIO', u'PlatformIO Documentation',
|
||||
u'Ivan Kravets', 'PlatformIO', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
('index', 'PlatformIO', u'PlatformIO Documentation',
|
||||
u'Ivan Kravets', 'PlatformIO', 'One line description of project.',
|
||||
'Miscellaneous'),
|
||||
]
|
||||
|
||||
# Documents to append as an appendix to all manuals.
|
||||
|
||||
71
docs/faq.rst
71
docs/faq.rst
@@ -24,8 +24,8 @@ General
|
||||
What is PlatformIO?
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
`PlatformIO <http://platformio.org>`_ is an open-source cross-platform code
|
||||
builder and the missing library manager.
|
||||
`PlatformIO <http://platformio.org>`_ is an open source ecosystem for IoT
|
||||
development.
|
||||
|
||||
PlatformIO is independent from the platform, in which it is running. In fact,
|
||||
the only requirement is Python, which exists pretty much everywhere. What this
|
||||
@@ -132,25 +132,15 @@ Answered in `issue #279 <https://github.com/platformio/platformio/issues/279>`_.
|
||||
|
||||
Answered in `issue #295 <https://github.com/platformio/platformio/issues/295#issuecomment-143772005>`_.
|
||||
|
||||
.. _faq_troubleshooting_pioblocksprompt:
|
||||
Windows AttributeError: 'module' object has no attribute 'packages'
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
PlatformIO blocks command execution using user prompt
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
If you are going to run *PlatformIO* from **subprocess**, you **MUST
|
||||
DISABLE** all prompts. It will allow you to avoid blocking.
|
||||
There are a few options:
|
||||
|
||||
- using :option:`platformio --force` option before each command
|
||||
- using environment variable :envvar:`PLATFORMIO_SETTING_ENABLE_PROMPTS=No <PLATFORMIO_SETTING_ENABLE_PROMPTS>`
|
||||
- disable global setting ``enable_prompts`` via :ref:`cmd_settings` command
|
||||
- masking under Continuous Integration system via environment variable
|
||||
:envvar:`CI=true <CI>`.
|
||||
Answered in `issue #252 <https://github.com/platformio/platformio/issues/252#issuecomment-127072039>`_.
|
||||
|
||||
.. _faq_troubleshooting_pionotfoundinpath:
|
||||
|
||||
Program ``platformio`` not found in PATH
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Where is ``platformio`` binary installed? Run this command in Terminal
|
||||
|
||||
@@ -173,18 +163,12 @@ programs to the ``bin`` directory which is included in ``$PATH``. For example,
|
||||
see `issue #272 <https://github.com/platformio/platformio/issues/272#issuecomment-133626112>`_.
|
||||
|
||||
Windows UnicodeDecodeError: 'ascii' codec can't decode byte
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Answered in `issue #143 <https://github.com/platformio/platformio/issues/143#issuecomment-88060906>`_.
|
||||
|
||||
Serial does not work with panStampAVR board
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Answered in `issue #144 <https://github.com/platformio/platformio/issues/144#issuecomment-87388038>`_.
|
||||
|
||||
|
||||
PlatformIO: command not found || An error ``pkg_resources.DistributionNotFound``
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
PlatformIO: command not found || An error "pkg_resources.DistributionNotFound"
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Please upgrade *SetupTools* package:
|
||||
|
||||
@@ -197,18 +181,45 @@ Please upgrade *SetupTools* package:
|
||||
[sudo] pip uninstall platformio
|
||||
[sudo] pip install platformio
|
||||
|
||||
Windows AttributeError: 'module' object has no attribute 'packages'
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
Miscellaneous
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
Answered in `issue #252 <https://github.com/platformio/platformio/issues/252#issuecomment-127072039>`_.
|
||||
.. _faq_troubleshooting_pioblocksprompt:
|
||||
|
||||
PlatformIO blocks command execution using user prompt
|
||||
'''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
If you are going to run *PlatformIO* from **subprocess**, you **MUST
|
||||
DISABLE** all prompts. It will allow you to avoid blocking.
|
||||
There are a few options:
|
||||
|
||||
- using :option:`platformio --force` option before each command
|
||||
- using environment variable :envvar:`PLATFORMIO_SETTING_ENABLE_PROMPTS=No <PLATFORMIO_SETTING_ENABLE_PROMPTS>`
|
||||
- disable global setting ``enable_prompts`` via :ref:`cmd_settings` command
|
||||
- masking under Continuous Integration system via environment variable
|
||||
:envvar:`CI=true <CI>`.
|
||||
|
||||
Serial does not work with panStampAVR board
|
||||
'''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Answered in `issue #144 <https://github.com/platformio/platformio/issues/144#issuecomment-87388038>`_.
|
||||
|
||||
Building
|
||||
~~~~~~~~
|
||||
|
||||
Can not compile a library that compiles without issue with Arduino IDE
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
* `#298: Unable to use Souliss library <https://github.com/platformio/platformio/issues/298>`_
|
||||
* `#331: Unable to use MySensors library <https://github.com/platformio/platformio/issues/331>`_
|
||||
|
||||
ARM toolchain: cc1plus: error while loading shared libraries
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
See related answers for
|
||||
`error while loading shared libraries <https://github.com/platformio/platformio/issues?utf8=✓&q=error+while+loading+shared+libraries>`_.
|
||||
|
||||
Archlinux: libncurses.so.5: cannot open shared object file
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
|
||||
|
||||
Answered in `issue #291 <https://github.com/platformio/platformio/issues/291>`_.
|
||||
|
||||
@@ -28,12 +28,21 @@ This software can be used with:
|
||||
Refer to the `Arduino Getting Started <http://arduino.cc/en/Guide/HomePage>`_
|
||||
page for Installation instructions.
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
More detailed information is located in PlatformIO blog:
|
||||
`Integration of PlatformIO library manager to Arduino IDE <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_.
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* `Integration of PlatformIO library manager to Arduino and Energia IDEs <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_
|
||||
|
||||
See the full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
|
||||
@@ -34,6 +34,13 @@ Integration
|
||||
Using `Atom Packages <https://atom.io/docs/v1.0.2/using-atom-atom-packages>`_
|
||||
please install `platomformio <https://atom.io/packages/platomformio>`_ package.
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* `Arduino Development in Atom Editor <http://viget.com/extend/arduino-development-in-atom-editor>`_
|
||||
|
||||
See a full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
|
||||
@@ -57,6 +57,11 @@ There are 3 predefined targets for building:
|
||||
* ``PLATFORMIO_UPLOAD`` - build and upload (if no errors)
|
||||
* ``PLATFORMIO_CLEAN`` - clean compiled objects and etc.
|
||||
|
||||
.. warning::
|
||||
The libraries which are added, installed or used in the project
|
||||
after generating process wont be reflected in IDE. To fix it you
|
||||
need to reinitialize project using :ref:`cmd_init` (repeat it).
|
||||
|
||||
.. warning::
|
||||
PlatformIO generates empty project by default and **code auto-completion
|
||||
will not work!** To enable auto-completion please choose one of:
|
||||
@@ -73,6 +78,14 @@ There are 3 predefined targets for building:
|
||||
Active discussion is located in
|
||||
`PlatformIO issue #132 <https://github.com/platformio/platformio/issues/132>`_.
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* `Using PlatformIO to get started with Arduino in CLion IDE <http://www.ches.pl/using-platformio-get-started-arduino-clion-ide/>`_
|
||||
* `Programar con Arduino "The good way" (Programming with Arduino "The good way", Spanish) <http://congdegnu.es/2015/11/09/programar-con-arduino-the-good-way/>`_
|
||||
|
||||
See a full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
|
||||
@@ -37,9 +37,6 @@ page for more detailed information.
|
||||
Integration
|
||||
-----------
|
||||
|
||||
Project Generator
|
||||
^^^^^^^^^^^^^^^^^
|
||||
|
||||
Since PlatformIO 2.0 you can generate Eclipse compatible project using
|
||||
:option:`platformio init --ide` command. Please choose board type using
|
||||
:ref:`cmd_boards` command and run:
|
||||
@@ -56,12 +53,19 @@ Then:
|
||||
2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``)
|
||||
3. Build project: ``Menu: Project > Build Project``.
|
||||
|
||||
.. warning::
|
||||
The libraries which are added, installed or used in the project
|
||||
after generating process wont be reflected in IDE. To fix it you
|
||||
need to reinitialize project using :ref:`cmd_init` (repeat it).
|
||||
|
||||
Manual Integration
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* `Building and debugging Atmel AVR (Arduino-based) project using Eclipse IDE+PlatformIO <http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio>`_
|
||||
* `Improvised MBED FRDM-K64F Eclipse/PlatformIO Setup and Software Installation <http://thomasweldon.com/tpw/courses/embeddsp/p00pcFrdmK64_eclipsePlatformioSetup.html>`_
|
||||
* `Learning Arduino GitHub Repository <http://www.trojanc.co.za/2015/07/11/learning-arduino-github-repository/>`_
|
||||
|
||||
See a full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
@@ -28,12 +28,21 @@ This software can be used with:
|
||||
Refer to the `Energia Getting Started <http://energia.nu/guide/>`_
|
||||
page for Installation instructions.
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
More detailed information is located in PlatformIO blog:
|
||||
`Integration of PlatformIO library manager to Energia IDE <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_.
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* `Integration of PlatformIO library manager to Arduino and Energia IDEs <http://www.ikravets.com/computer-life/platformio/2014/10/07/integration-of-platformio-library-manager-to-arduino-and-energia-ides>`_
|
||||
|
||||
See the full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
-----------
|
||||
|
||||
|
||||
@@ -85,6 +85,11 @@ Then:
|
||||
.. image:: ../_static/ide-platformio-qtcreator-3.png
|
||||
:target: http://docs.platformio.org/en/latest/_static/ide-platformio-qtcreator-3.png
|
||||
|
||||
.. warning::
|
||||
The libraries which are added, installed or used in the project
|
||||
after generating process wont be reflected in IDE. To fix it you
|
||||
need to reinitialize project using :ref:`cmd_init` (repeat it).
|
||||
|
||||
Manual Integration
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@ This software can be used with:
|
||||
* all available :ref:`platforms`
|
||||
* all available :ref:`frameworks`
|
||||
|
||||
.. contents::
|
||||
|
||||
Integration
|
||||
-----------
|
||||
|
||||
@@ -56,6 +58,17 @@ Now, in VIM ``cd /path/to/this/project`` and press ``Ctrl+B`` or ``Cmd+B``
|
||||
(Mac). *PlatformIO* should compile your source code from the ``src`` directory,
|
||||
make firmware and upload it.
|
||||
|
||||
.. note::
|
||||
If hotkey doesn't work for you, try to add this line
|
||||
``nnoremap <C-b> :make<CR>`` to ``~/.vimrc``
|
||||
|
||||
Articles / Manuals
|
||||
------------------
|
||||
|
||||
* `コマンドラインでArduino開発 : vim + platformio (Arduino development at the command line: VIM + PlatformIO, Japanese) <http://qiita.com/caad1229/items/7b5fb47f034ae6e0baf2>`_
|
||||
|
||||
See a full list with :ref:`articles`.
|
||||
|
||||
Screenshot
|
||||
----------
|
||||
|
||||
|
||||
@@ -52,6 +52,11 @@ Then:
|
||||
2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``)
|
||||
3. Build project: ``Menu: Build > Build Solution``.
|
||||
|
||||
.. warning::
|
||||
The libraries which are added, installed or used in the project
|
||||
after generating process wont be reflected in IDE. To fix it you
|
||||
need to reinitialize project using :ref:`cmd_init` (repeat it).
|
||||
|
||||
Manual Integration
|
||||
^^^^^^^^^^^^^^^^^^
|
||||
|
||||
|
||||
@@ -9,18 +9,26 @@
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
|
||||
PlatformIO is an open-source cross-platform code builder and the missing library manager
|
||||
========================================================================================
|
||||
PlatformIO is an open source ecosystem for IoT development
|
||||
==========================================================
|
||||
|
||||
**Ready for embedded development, IDE and Continuous integration, Arduino and
|
||||
MBED compatible**
|
||||
**Cross-platform code builder and library manager. Continuous and IDE
|
||||
integration. Arduino and MBED compatible. Ready for Cloud compiling.**
|
||||
|
||||
* **Development Platforms** - Embedded and Desktop development platforms with
|
||||
pre-built toolchains, debuggers, uploaders and frameworks which work under
|
||||
popular host OS: Mac, Windows, Linux (+ARM)
|
||||
* **Embedded Boards** - Rapid Embedded Programming, IDE and Continuous
|
||||
Integration in a few steps with PlatformIO thanks to built-in project
|
||||
generator for the most popular embedded boards and IDE
|
||||
* **Library Manager** - Hundreds Popular Libraries are organized into single
|
||||
Web 2.0 platform: list by categories, keywords, authors, compatible
|
||||
platforms and frameworks; learn via examples; be up-to-date with the latest
|
||||
version
|
||||
|
||||
*Atmel AVR & SAM, Espressif, Freescale Kinetis, Nordic nRF51, NXP LPC,
|
||||
Silicon Labs EFM32, ST STM32, TI MSP430 & Tiva, Teensy, Arduino, mbed,
|
||||
libOpenCM3, etc.*
|
||||
|
||||
.. image:: _static/platformio-logo.png
|
||||
:target: http://platformio.org
|
||||
libOpenCM3, etc.**
|
||||
|
||||
* `Website <http://platformio.org>`_
|
||||
* `Web 2.0 Library Search <http://platformio.org/#!/lib>`_ |
|
||||
@@ -34,18 +42,13 @@ libOpenCM3, etc.*
|
||||
`Facebook <https://www.facebook.com/platformio>`_ |
|
||||
`Reddit <http://www.reddit.com/r/platformio/>`_
|
||||
|
||||
You have **no need** to install any *IDE* or compile any tool chains. *PlatformIO*
|
||||
has pre-built different development platforms and pre-configured settings for
|
||||
the most popular embedded boards. For further details, please
|
||||
refer to :ref:`faq_what_is_platformio`
|
||||
|
||||
Embedded Development. *Easier Than Ever.*
|
||||
-----------------------------------------
|
||||
|
||||
* Colourful command-line output
|
||||
* :ref:`IDE Integration <ide>` with *Arduino, Eclipse, Energia, Qt Creator,
|
||||
Sublime Text, Vim, Visual Studio*
|
||||
* :ref:`ci` with *AppVeyor, Circle CI, Drone, Shippable, Travis CI*
|
||||
* Cloud compiling and :ref:`ci` with *AppVeyor, Circle CI, Drone, Shippable, Travis CI*
|
||||
* Built-in :ref:`Serial Port Monitor <cmd_serialports_monitor>` and
|
||||
configurable build :ref:`-flags/-options <projectconf_build_flags>`
|
||||
* Pre-built tool chains, :ref:`frameworks` for the
|
||||
@@ -68,6 +71,7 @@ The Missing Library Manager. *It's here!*
|
||||
* Automatic library updating
|
||||
* It runs on Windows, Mac OS X, and Linux (+ARM).
|
||||
|
||||
For further details, please refer to :ref:`faq_what_is_platformio`
|
||||
|
||||
Contents
|
||||
--------
|
||||
@@ -95,11 +99,19 @@ Contents
|
||||
Platforms & Boards <platforms/index>
|
||||
frameworks/index
|
||||
|
||||
.. toctree::
|
||||
:caption: Library Manager
|
||||
:maxdepth: 2
|
||||
|
||||
Quickstart <librarymanager/index>
|
||||
User Guide <userguide/lib/index.rst>
|
||||
librarymanager/config
|
||||
librarymanager/creating
|
||||
|
||||
.. toctree::
|
||||
:caption: Integration
|
||||
:maxdepth: 2
|
||||
|
||||
librarymanager/index
|
||||
ci/index
|
||||
ide
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ application (Terminal):
|
||||
* Mac OS X / Linux – *Terminal* application
|
||||
* Windows – ``cmd.exe`` application.
|
||||
|
||||
Installation options
|
||||
Installation Methods
|
||||
--------------------
|
||||
|
||||
.. warning::
|
||||
@@ -47,10 +47,10 @@ Installation options
|
||||
**DON'T FORGET** to select ``Add python.exe to Path`` feature on the
|
||||
"Customize" stage.
|
||||
|
||||
Please *choose one of* the following installation options:
|
||||
Please *choose ONE of* the following methods:
|
||||
|
||||
Python Package Manager
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
a) Python Package Manager
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
The latest stable version of PlatformIO may be installed/upgraded via
|
||||
`pip <https://pip.pypa.io>`_ as follows:
|
||||
@@ -74,8 +74,8 @@ a few options here:
|
||||
|
||||
.. _installation_installer_script:
|
||||
|
||||
Installer Script
|
||||
~~~~~~~~~~~~~~~~
|
||||
b) Installer Script
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Super-Quick (Mac / Linux)
|
||||
'''''''''''''''''''''''''
|
||||
@@ -114,8 +114,8 @@ On *Windows OS* it may look like:
|
||||
# run it
|
||||
C:\Python27\python.exe get-platformio.py
|
||||
|
||||
Full Guide
|
||||
~~~~~~~~~~
|
||||
c) Full Guide
|
||||
~~~~~~~~~~~~~
|
||||
|
||||
1. Check a ``python`` version (only 2.6-2.7 is supported):
|
||||
|
||||
@@ -144,8 +144,8 @@ For upgrading ``platformio`` to the latest version:
|
||||
|
||||
pip install -U platformio
|
||||
|
||||
Development Version
|
||||
~~~~~~~~~~~~~~~~~~~
|
||||
d) Development Version
|
||||
~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Install the latest PlatformIO from the ``develop`` branch:
|
||||
|
||||
|
||||
@@ -336,6 +336,6 @@ A list of example patterns. This field is predefined with default value:
|
||||
.. code-block:: javascript
|
||||
|
||||
"examples": [
|
||||
"[Ee]xamples/*/*.ini",
|
||||
"[Ee]xamples/*/*.ino",
|
||||
"[Ee]xamples/*/*.pde"
|
||||
]
|
||||
|
||||
@@ -14,10 +14,6 @@
|
||||
Library Manager
|
||||
===============
|
||||
|
||||
..
|
||||
|
||||
*"The missing library manager for development platforms"* [#]_
|
||||
|
||||
*PlatformIO Library Manager* allows you to organize external embedded libraries.
|
||||
You can search for new libraries via
|
||||
|
||||
@@ -27,12 +23,4 @@ You can search for new libraries via
|
||||
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.
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
config
|
||||
creating
|
||||
User Guide <../userguide/lib/index.rst>
|
||||
|
||||
.. [#] Inspired by `npm <https://www.npmjs.com/>`_ and `bower
|
||||
<http://bower.io>`_ package managers for web.
|
||||
.. image:: ../_static/platformio-demo-lib.gif
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
.. _board_creating:
|
||||
|
||||
Creating Board
|
||||
==============
|
||||
Custom Board
|
||||
============
|
||||
|
||||
*PlatformIO* has pre-built settings for the most popular embedded boards. This
|
||||
list is available:
|
||||
|
||||
@@ -11,8 +11,8 @@
|
||||
|
||||
.. _platform_creating:
|
||||
|
||||
Creating Platform
|
||||
=================
|
||||
Custom Platform
|
||||
===============
|
||||
|
||||
*PlatformIO* was developed like a tool which would build the same source code
|
||||
for the different development platforms via single command :ref:`cmd_run`
|
||||
|
||||
@@ -52,8 +52,8 @@ Desktop
|
||||
linux_x86_64
|
||||
windows_x86
|
||||
|
||||
Own Platform/Board
|
||||
------------------
|
||||
Custom Platform & Board
|
||||
-----------------------
|
||||
|
||||
.. toctree::
|
||||
:maxdepth: 2
|
||||
|
||||
@@ -440,13 +440,17 @@ Example, specify own upload command for :ref:`platform_atmelavr`:
|
||||
# uncomment line below to see environment variables
|
||||
# print env.Dump()
|
||||
|
||||
See built-in examples of `PlatformIO build scripts <https://github.com/platformio/platformio/tree/develop/platformio/builder/scripts>`_.
|
||||
|
||||
* see built-in examples of `PlatformIO build scripts <https://github.com/platformio/platformio/tree/develop/platformio/builder/scripts>`_.
|
||||
* take a look on related users questions: `#351 <https://github.com/platformio/platformio/issues/351#issuecomment-161789165>`_,
|
||||
`#236 <https://github.com/platformio/platformio/issues/236#issuecomment-112038284>`_,
|
||||
`#247 <https://github.com/platformio/platformio/issues/247#issuecomment-118169728>`_
|
||||
|
||||
``targets``
|
||||
^^^^^^^^^^^
|
||||
|
||||
A list with targets which will be processed by :ref:`cmd_run` command by
|
||||
default. You can enter more then one target separated with "space". Which
|
||||
default. You can enter more than one target separated with "space". Which
|
||||
targets are supported is described in :option:`platformio run --target`.
|
||||
|
||||
**Tip!** You can use these targets like an option to
|
||||
@@ -530,6 +534,8 @@ Then upload firmware using :option:`platformio run --target program`
|
||||
board = armstrap_eagle512
|
||||
upload_protocol = gdb
|
||||
|
||||
Also, take a look at this article `Armstrap Eagle and PlatformIO <http://isobit.io/2015/08/08/armstrap.html>`_.
|
||||
|
||||
5. :ref:`platform_ststm32`: Upload firmware using ST-Link instead mbed's media
|
||||
disk
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ Usage
|
||||
Description
|
||||
-----------
|
||||
|
||||
Initialize new PlatformIO based project.
|
||||
Initialize new PlatformIO based project or update existing with new data.
|
||||
|
||||
|
||||
This command will create:
|
||||
@@ -36,6 +36,8 @@ This command will create:
|
||||
* ``src`` - a source directory. Put your source files here
|
||||
* ``lib`` - a directory for the project specific (private) libraries.
|
||||
PlatformIO will compile them to static libraries and link to executable file
|
||||
* ``.travis.yml`` configuration file (template) for Continuous Integration
|
||||
with :ref:`ci_travis`
|
||||
|
||||
.. note::
|
||||
The source code of each library should be placed in separate directory.
|
||||
@@ -74,12 +76,11 @@ A list with supported IDE is available within ``platformio init --help`` command
|
||||
Also, please look into :ref:`ide` page.
|
||||
|
||||
.. option::
|
||||
--disable-auto-uploading
|
||||
--enable-auto-uploading
|
||||
|
||||
If you initialise project with the specified
|
||||
:option:`platformio init --board`, then *PlatformIO*
|
||||
will create environment with enabled firmware auto-uploading. This option
|
||||
allows you to disable firmware auto-uploading by default.
|
||||
will create environment with enabled firmware auto-uploading.
|
||||
|
||||
.. option::
|
||||
--env-prefix
|
||||
@@ -138,9 +139,6 @@ Examples
|
||||
|
||||
$ platformio init --board uno
|
||||
|
||||
Would you like to enable firmware auto-uploading when project is successfully built using `platformio run` command?
|
||||
Don't forget that you can upload firmware manually using `platformio run --target upload` command. [y/N]: y
|
||||
|
||||
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.
|
||||
|
||||
@@ -59,7 +59,6 @@ Commands
|
||||
cmd_boards
|
||||
cmd_ci
|
||||
cmd_init
|
||||
platformio lib <lib/index>
|
||||
platformio platforms <platforms/index>
|
||||
cmd_run
|
||||
cmd_serialports
|
||||
|
||||
@@ -12,14 +12,15 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
VERSION = (2, 3, 5)
|
||||
VERSION = (2, 5, 0)
|
||||
__version__ = ".".join([str(s) for s in VERSION])
|
||||
|
||||
__title__ = "platformio"
|
||||
__description__ = (
|
||||
"An open-source cross-platform code builder and the missing library "
|
||||
"manager (Ready for embedded development, IDE and Continuous integration, "
|
||||
"Arduino and MBED compatible)"
|
||||
"An open source ecosystem for IoT development. "
|
||||
"Cross-platform code builder and library manager. "
|
||||
"Continuous and IDE integration. "
|
||||
"Arduino and MBED compatible. Ready for Cloud compiling."
|
||||
)
|
||||
__url__ = "http://platformio.org"
|
||||
|
||||
|
||||
@@ -46,7 +46,7 @@ class PlatformioCLI(click.MultiCommand): # pylint: disable=R0904
|
||||
try:
|
||||
return self._handle_obsolate_command(name)
|
||||
except AttributeError:
|
||||
raise exception.UnknownCLICommand(name)
|
||||
raise click.UsageError('No such command "%s"' % name, ctx)
|
||||
return mod.cli
|
||||
|
||||
@staticmethod
|
||||
@@ -103,6 +103,18 @@ def main():
|
||||
error_str += str(e)
|
||||
else:
|
||||
error_str += format_exc()
|
||||
error_str += """
|
||||
============================================================
|
||||
|
||||
An unexpected error occurred. Further steps:
|
||||
|
||||
* Verify that you have the latest version of PlatformIO using
|
||||
`platformio upgrade` command
|
||||
* Report this problem to the developers
|
||||
https://github.com/platformio/platformio/issues
|
||||
|
||||
============================================================
|
||||
"""
|
||||
click.secho(error_str, fg="red", err=True)
|
||||
return 1
|
||||
return 0
|
||||
|
||||
@@ -13,6 +13,7 @@
|
||||
# limitations under the License.
|
||||
|
||||
import json
|
||||
from copy import deepcopy
|
||||
from os import environ, getenv
|
||||
from os.path import getmtime, isfile, join
|
||||
from time import time
|
||||
@@ -70,13 +71,14 @@ SESSION_VARS = {
|
||||
|
||||
class State(object):
|
||||
|
||||
def __init__(self, path=None):
|
||||
def __init__(self, path=None, lock=False):
|
||||
self.path = path
|
||||
self.lock = lock
|
||||
if not self.path:
|
||||
self.path = join(get_home_dir(), "appstate.json")
|
||||
self._state = {}
|
||||
self._prev_state = {}
|
||||
self._lock = None
|
||||
self._lockfile = None
|
||||
|
||||
def __enter__(self):
|
||||
try:
|
||||
@@ -86,7 +88,7 @@ class State(object):
|
||||
self._state = json.load(fp)
|
||||
except ValueError:
|
||||
self._state = {}
|
||||
self._prev_state = self._state.copy()
|
||||
self._prev_state = deepcopy(self._state)
|
||||
return self._state
|
||||
|
||||
def __exit__(self, type_, value, traceback):
|
||||
@@ -99,17 +101,19 @@ class State(object):
|
||||
self._unlock_state_file()
|
||||
|
||||
def _lock_state_file(self):
|
||||
self._lock = LockFile(self.path)
|
||||
if not self.lock:
|
||||
return
|
||||
self._lockfile = LockFile(self.path)
|
||||
|
||||
if (self._lock.is_locked() and
|
||||
(time() - getmtime(self._lock.lock_file)) > 10):
|
||||
self._lock.break_lock()
|
||||
if (self._lockfile.is_locked() and
|
||||
(time() - getmtime(self._lockfile.lock_file)) > 10):
|
||||
self._lockfile.break_lock()
|
||||
|
||||
self._lock.acquire()
|
||||
self._lockfile.acquire()
|
||||
|
||||
def _unlock_state_file(self):
|
||||
if self._lock:
|
||||
self._lock.release()
|
||||
if self._lockfile:
|
||||
self._lockfile.release()
|
||||
|
||||
|
||||
def sanitize_setting(name, value):
|
||||
@@ -136,7 +140,7 @@ def get_state_item(name, default=None):
|
||||
|
||||
|
||||
def set_state_item(name, value):
|
||||
with State() as data:
|
||||
with State(lock=True) as data:
|
||||
data[name] = value
|
||||
|
||||
|
||||
@@ -159,14 +163,14 @@ def get_setting(name):
|
||||
|
||||
|
||||
def set_setting(name, value):
|
||||
with State() as data:
|
||||
with State(lock=True) as data:
|
||||
if "settings" not in data:
|
||||
data['settings'] = {}
|
||||
data['settings'][name] = sanitize_setting(name, value)
|
||||
|
||||
|
||||
def reset_settings():
|
||||
with State() as data:
|
||||
with State(lock=True) as data:
|
||||
if "settings" in data:
|
||||
del data['settings']
|
||||
|
||||
|
||||
50
platformio/boards/atmelsam.json
Normal file
50
platformio/boards/atmelsam.json
Normal file
@@ -0,0 +1,50 @@
|
||||
{
|
||||
"samr21_xpro": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m0plus",
|
||||
"mcu": "atsamr21g18a"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Atmel ATSAMR21-XPRO",
|
||||
"platform": "atmelsam",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/SAMR21-XPRO/",
|
||||
"vendor": "Atmel"
|
||||
},
|
||||
"saml21_xpro_b": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m0plus",
|
||||
"mcu": "atsaml21j18b"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Atmel SAML21-XPRO-B",
|
||||
"platform": "atmelsam",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/SAML21-XPRO/",
|
||||
"vendor": "Atmel"
|
||||
},
|
||||
"samd21_xpro": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m0plus",
|
||||
"mcu": "atsamd21j18a"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "Atmel SAMD21-XPRO",
|
||||
"platform": "atmelsam",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 262144
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/SAMD21-XPRO/",
|
||||
"vendor": "Atmel"
|
||||
}
|
||||
}
|
||||
@@ -3,7 +3,7 @@
|
||||
"build": {
|
||||
"core": "esp8266",
|
||||
"extra_flags": "-DARDUINO_ESP8266_ESP01 -DARDUINO_ARCH_ESP8266 -DESP8266",
|
||||
"f_cpu": "40000000L",
|
||||
"f_cpu": "80000000L",
|
||||
"ldscript": "esp8266.flash.512k.ld",
|
||||
"mcu": "esp8266",
|
||||
"variant": "generic"
|
||||
@@ -35,7 +35,7 @@
|
||||
"platform": "espressif",
|
||||
"upload": {
|
||||
"maximum_ram_size": 32768,
|
||||
"maximum_size": 524288,
|
||||
"maximum_size": 4194304,
|
||||
"protocol": "arduino",
|
||||
"require_upload_port" : true,
|
||||
"speed": 115200
|
||||
|
||||
@@ -434,7 +434,7 @@
|
||||
"extra_flags": "-DARDUINO_ARCH_AVR -DAVR_MOTEINOMEGA",
|
||||
"f_cpu": "16000000L",
|
||||
"mcu": "atmega1284p",
|
||||
"variant": "moteinoMega"
|
||||
"variant": "moteinomega"
|
||||
},
|
||||
"frameworks": ["arduino"],
|
||||
"name": "LowPowerLab MoteinoMEGA",
|
||||
|
||||
@@ -441,5 +441,101 @@
|
||||
},
|
||||
"url": "http://www.st.com/web/en/catalog/tools/PF260318",
|
||||
"vendor": "ST"
|
||||
},
|
||||
"disco_f469ni": {
|
||||
"build": {
|
||||
"f_cpu": "180000000L",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32f469nih6"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "ST 32F469IDISCOVERY",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 393216,
|
||||
"maximum_size": 1048576
|
||||
},
|
||||
"url": "http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF262395",
|
||||
"vendor": "ST"
|
||||
},
|
||||
"disco_l476vg": {
|
||||
"build": {
|
||||
"f_cpu": "80000000L",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32l476vgt6"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "ST 32L476GDISCOVERY",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 131072,
|
||||
"maximum_size": 1048576
|
||||
},
|
||||
"url": "http://www.st.com/web/catalog/tools/FM116/CL1620/SC959/SS1532/LN1848/PF261635",
|
||||
"vendor": "ST"
|
||||
},
|
||||
"nucleo_f031k6": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m0",
|
||||
"mcu": "stm32f031k6t6"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "ST Nucleo F031K6",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 4096,
|
||||
"maximum_size": 32768
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/ST-Nucleo-F031K6/",
|
||||
"vendor": "ST"
|
||||
},
|
||||
"nucleo_f042k6": {
|
||||
"build": {
|
||||
"f_cpu": "48000000L",
|
||||
"cpu": "cortex-m0",
|
||||
"mcu": "stm32f042k6t6"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "ST Nucleo F042K6",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 6144,
|
||||
"maximum_size": 32768
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/ST-Nucleo-F042K6/",
|
||||
"vendor": "ST"
|
||||
},
|
||||
"nucleo_f303k8": {
|
||||
"build": {
|
||||
"f_cpu": "72000000L",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32f303k8t6"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "ST Nucleo F303K8",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 16384,
|
||||
"maximum_size": 65536
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/ST-Nucleo-F303K8/",
|
||||
"vendor": "ST"
|
||||
},
|
||||
"nucleo_l476rg": {
|
||||
"build": {
|
||||
"f_cpu": "80000000L",
|
||||
"cpu": "cortex-m4",
|
||||
"mcu": "stm32l476rgt6"
|
||||
},
|
||||
"frameworks": ["mbed"],
|
||||
"name": "ST Nucleo L476RG",
|
||||
"platform": "ststm32",
|
||||
"upload": {
|
||||
"maximum_ram_size": 131072,
|
||||
"maximum_size": 1048576
|
||||
},
|
||||
"url": "https://developer.mbed.org/platforms/ST-Nucleo-L476RG/",
|
||||
"vendor": "ST"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# pylint: disable=wrong-import-position,wrong-import-order,unused-import
|
||||
|
||||
try:
|
||||
from platformio import util
|
||||
except ImportError:
|
||||
@@ -29,7 +31,7 @@ except ImportError:
|
||||
sys.path.insert(0, _p)
|
||||
try:
|
||||
from platformio import util
|
||||
import lockfile # NOQA pylint: disable=unused-import
|
||||
import lockfile # NOQA
|
||||
break
|
||||
except ImportError:
|
||||
pass
|
||||
@@ -39,8 +41,7 @@ from os import environ
|
||||
from os.path import isfile, join
|
||||
from time import time
|
||||
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, DefaultEnvironment, Exit,
|
||||
SConscript, SConscriptChdir, Variables)
|
||||
from SCons.Script import COMMAND_LINE_TARGETS, DefaultEnvironment, Variables
|
||||
|
||||
from platformio.exception import UnknownBoard
|
||||
|
||||
@@ -139,10 +140,10 @@ if "BOARD" in env:
|
||||
)
|
||||
|
||||
if env['PLATFORM'] != env.get("BOARD_OPTIONS", {}).get("platform"):
|
||||
Exit("Error: '%s' platform doesn't support this board. "
|
||||
"Use '%s' platform instead." % (
|
||||
env['PLATFORM'],
|
||||
env.get("BOARD_OPTIONS", {}).get("platform")))
|
||||
env.Exit(
|
||||
"Error: '%s' platform doesn't support this board. "
|
||||
"Use '%s' platform instead." % (
|
||||
env['PLATFORM'], env.get("BOARD_OPTIONS", {}).get("platform")))
|
||||
|
||||
|
||||
for opt in ("LIB_IGNORE", "LIB_USE"):
|
||||
@@ -156,16 +157,18 @@ if env.subst("$PIOPACKAGE_TOOLCHAIN"):
|
||||
env.subst(join("$PIOPACKAGES_DIR", "$PIOPACKAGE_TOOLCHAIN", "bin"))
|
||||
)
|
||||
|
||||
SConscriptChdir(0)
|
||||
SConscript(env.subst("$BUILD_SCRIPT"))
|
||||
env.SConscriptChdir(0)
|
||||
env.SConsignFile(join("$PIOENVS_DIR", ".sconsign.dblite"))
|
||||
env.SConscript("$BUILD_SCRIPT")
|
||||
|
||||
if environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT", None)):
|
||||
SConscript(environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")))
|
||||
if environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")):
|
||||
env.SConscript(
|
||||
environ.get("PLATFORMIO_EXTRA_SCRIPT", env.get("EXTRA_SCRIPT")))
|
||||
|
||||
if "envdump" in COMMAND_LINE_TARGETS:
|
||||
print env.Dump()
|
||||
Exit()
|
||||
env.Exit()
|
||||
|
||||
if "idedata" in COMMAND_LINE_TARGETS:
|
||||
print json.dumps(env.DumpIDEData())
|
||||
Exit()
|
||||
env.Exit()
|
||||
|
||||
@@ -56,6 +56,8 @@ env.Replace(
|
||||
"-mtext-section-literals",
|
||||
"-falign-functions=4",
|
||||
"-U__STRICT_ANSI__",
|
||||
"-ffunction-sections",
|
||||
"-fdata-sections",
|
||||
"-MMD" # output dependancy info
|
||||
],
|
||||
|
||||
@@ -75,7 +77,8 @@ env.Replace(
|
||||
"-nostdlib",
|
||||
"-Wl,--no-check-sections",
|
||||
"-u", "call_user_start",
|
||||
"-Wl,-static"
|
||||
"-Wl,-static",
|
||||
"-Wl,--gc-sections"
|
||||
],
|
||||
|
||||
SIZEPRINTCMD='"$SIZETOOL" -B -d $SOURCES',
|
||||
@@ -103,6 +106,8 @@ if "FRAMEWORK" in env:
|
||||
]
|
||||
)
|
||||
|
||||
_board_max_rom = int(
|
||||
env.get("BOARD_OPTIONS", {}).get("upload", {}).get("maximum_size", 0))
|
||||
env.Append(
|
||||
BUILDERS=dict(
|
||||
ElfToBin=Builder(
|
||||
@@ -113,8 +118,9 @@ env.Append(
|
||||
"-bo", "$TARGET",
|
||||
"-bm", "dio",
|
||||
"-bf", "${BOARD_OPTIONS['build']['f_cpu'][:2]}",
|
||||
"-bz", str(int(env.get("BOARD_OPTIONS", {}).get(
|
||||
"upload", {}).get("maximum_size") / 1024)) + "K",
|
||||
"-bz",
|
||||
"%dK" % (_board_max_rom / 1024) if _board_max_rom < 1048576
|
||||
else "%dM" % (_board_max_rom / 1048576),
|
||||
"-bs", ".text",
|
||||
"-bp", "4096",
|
||||
"-ec",
|
||||
|
||||
@@ -55,10 +55,10 @@ elif env.get("PLATFORM") == "timsp430":
|
||||
)
|
||||
elif env.get("PLATFORM") == "espressif":
|
||||
env.Prepend(
|
||||
CPPPATH=[join("$PLATFORMFW_DIR", "sdk", "include")],
|
||||
LIBPATH=[join("$PLATFORMFW_DIR", "sdk", "lib")],
|
||||
CPPPATH=[join("$PLATFORMFW_DIR", "tools", "sdk", "include")],
|
||||
LIBPATH=[join("$PLATFORMFW_DIR", "tools", "sdk", "lib")],
|
||||
LIBS=["smartconfig", "pp", "main", "wpa", "lwip",
|
||||
"net80211", "wps", "crypto", "phy", "hal", "gcc", "m"]
|
||||
"net80211", "wps", "crypto", "phy", "hal", "axtls", "gcc", "m"]
|
||||
)
|
||||
|
||||
env.Replace(PLATFORMFW_DIR=PLATFORMFW_DIR)
|
||||
|
||||
@@ -23,6 +23,8 @@ including ST STM32, Ti Tiva and Stellaris, NXP LPC 11xx, 13xx, 15xx,
|
||||
http://www.libopencm3.org/wiki/Main_Page
|
||||
"""
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import re
|
||||
from os import listdir, sep, walk
|
||||
from os.path import isfile, join, normpath
|
||||
|
||||
@@ -26,13 +26,16 @@ the mbed Developer Community.
|
||||
http://mbed.org/
|
||||
"""
|
||||
|
||||
from __future__ import print_function
|
||||
|
||||
import re
|
||||
import sys
|
||||
import xml.etree.ElementTree as ElementTree
|
||||
from binascii import crc32
|
||||
from os import walk
|
||||
from os import getenv, walk
|
||||
from os.path import basename, isfile, join, normpath
|
||||
|
||||
from SCons.Script import DefaultEnvironment, Exit
|
||||
from SCons.Script import DefaultEnvironment
|
||||
|
||||
env = DefaultEnvironment()
|
||||
|
||||
@@ -54,7 +57,7 @@ MBED_VARIANTS = {
|
||||
"seeedTinyBLE": "SEEED_TINY_BLE",
|
||||
"redBearLab": "RBLAB_NRF51822",
|
||||
"nrf51-dt": "NRF51_DK",
|
||||
"redBearLabBLENano": "RBLAB_NRF51822",
|
||||
"redBearLabBLENano": "RBLAB_BLENANO",
|
||||
"wallBotBLE": "NRF51822",
|
||||
"frdm_kl25z": "KL25Z",
|
||||
"frdm_kl46z": "KL46Z",
|
||||
@@ -63,7 +66,10 @@ MBED_VARIANTS = {
|
||||
"frdm_k20d50m": "K20D50M",
|
||||
"frdm_k22f": "K22F",
|
||||
"teensy31": "TEENSY3_1",
|
||||
"dfcm_nnn40": "DELTA_DFCM_NNN40"
|
||||
"dfcm_nnn40": "DELTA_DFCM_NNN40",
|
||||
"samr21_xpro": "SAMR21G18A",
|
||||
"saml21_xpro_b": "SAML21J18A",
|
||||
"samd21_xpro": "SAMD21J18A"
|
||||
}
|
||||
|
||||
MBED_LIBS_MAP = {
|
||||
@@ -116,8 +122,10 @@ def add_mbedlib(libname, libar):
|
||||
lib_dir = join(env.subst("$PLATFORMFW_DIR"), "libs", libname)
|
||||
if not isfile(join(lib_dir, "TARGET_%s" % variant,
|
||||
"TOOLCHAIN_GCC_ARM", "lib%s.a" % libar)):
|
||||
Exit("Error: %s board doesn't support %s library!" %
|
||||
(env.get("BOARD"), libname))
|
||||
print (
|
||||
"Warning: %s board doesn't have native support for '%s' library!" %
|
||||
(env.get("BOARD"), libname), file=sys.stderr)
|
||||
return
|
||||
|
||||
env.Append(
|
||||
LIBPATH=[
|
||||
@@ -223,7 +231,11 @@ env.Replace(
|
||||
)
|
||||
|
||||
# restore external build flags
|
||||
env.ProcessFlags()
|
||||
env.ProcessFlags([
|
||||
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"),
|
||||
env.get("BUILD_FLAGS"),
|
||||
getenv("PLATFORMIO_BUILD_FLAGS"),
|
||||
])
|
||||
|
||||
# Hook for K64F and K22F
|
||||
if board_type in ("frdm_k22f", "frdm_k64f"):
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import atexit
|
||||
import re
|
||||
from glob import glob
|
||||
|
||||
@@ -12,7 +12,9 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from os.path import join, isfile
|
||||
from __future__ import absolute_import
|
||||
|
||||
from os.path import isfile, join
|
||||
from shutil import copyfile
|
||||
from time import sleep
|
||||
|
||||
|
||||
@@ -12,10 +12,12 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import re
|
||||
from glob import glob
|
||||
from os import getenv, listdir, sep, walk
|
||||
from os.path import basename, dirname, isdir, isfile, join, normpath
|
||||
from os.path import basename, dirname, isdir, isfile, join, normpath, realpath
|
||||
|
||||
from SCons.Script import (COMMAND_LINE_TARGETS, DefaultEnvironment, Exit,
|
||||
SConscript)
|
||||
@@ -39,7 +41,11 @@ def BuildProgram(env):
|
||||
ASCOM="$ASPPCOM"
|
||||
)
|
||||
|
||||
env.ProcessFlags()
|
||||
env.ProcessFlags([
|
||||
env.get("BOARD_OPTIONS", {}).get("build", {}).get("extra_flags"),
|
||||
env.get("BUILD_FLAGS"),
|
||||
getenv("PLATFORMIO_BUILD_FLAGS"),
|
||||
])
|
||||
env.BuildFramework()
|
||||
|
||||
# build dependent libs
|
||||
@@ -62,10 +68,10 @@ def BuildProgram(env):
|
||||
)
|
||||
|
||||
# Handle SRC_BUILD_FLAGS
|
||||
if getenv("PLATFORMIO_SRC_BUILD_FLAGS", None):
|
||||
env.MergeFlags(getenv("PLATFORMIO_SRC_BUILD_FLAGS"))
|
||||
if "SRC_BUILD_FLAGS" in env:
|
||||
env.MergeFlags(env['SRC_BUILD_FLAGS'])
|
||||
env.ProcessFlags([
|
||||
env.get("SRC_BUILD_FLAGS", None),
|
||||
getenv("PLATFORMIO_SRC_BUILD_FLAGS"),
|
||||
])
|
||||
|
||||
env.Append(
|
||||
CPPDEFINES=["PLATFORMIO={0:02d}{1:02d}{2:02d}".format(
|
||||
@@ -77,25 +83,25 @@ def BuildProgram(env):
|
||||
env.LookupSources(
|
||||
"$BUILDSRC_DIR", "$PROJECTSRC_DIR", duplicate=False,
|
||||
src_filter=getenv("PLATFORMIO_SRC_FILTER",
|
||||
env.get("SRC_FILTER", None))),
|
||||
env.get("SRC_FILTER"))),
|
||||
LIBS=env.get("LIBS", []) + deplibs,
|
||||
LIBPATH=env.get("LIBPATH", []) + ["$BUILD_DIR"]
|
||||
)
|
||||
|
||||
|
||||
def ProcessFlags(env):
|
||||
if "extra_flags" in env.get("BOARD_OPTIONS", {}).get("build", {}):
|
||||
env.MergeFlags(env.subst("${BOARD_OPTIONS['build']['extra_flags']}"))
|
||||
def ProcessFlags(env, flags):
|
||||
for f in flags:
|
||||
if f:
|
||||
env.MergeFlags(str(f))
|
||||
|
||||
# Handle BUILD_FLAGS
|
||||
if getenv("PLATFORMIO_BUILD_FLAGS", None):
|
||||
env.MergeFlags(getenv("PLATFORMIO_BUILD_FLAGS"))
|
||||
if "BUILD_FLAGS" in env:
|
||||
env.MergeFlags(env['BUILD_FLAGS'])
|
||||
# fix relative CPPPATH
|
||||
for i, p in enumerate(env.get("CPPPATH", [])):
|
||||
if isdir(p):
|
||||
env['CPPPATH'][i] = realpath(p)
|
||||
|
||||
# Cancel any previous definition of name, either built in or
|
||||
# provided with a -D option // Issue #191
|
||||
undefines = [f for f in env.get("CCFLAGS", []) if f.startswith("-U")]
|
||||
undefines = [u for u in env.get("CCFLAGS", []) if u.startswith("-U")]
|
||||
if undefines:
|
||||
for undef in undefines:
|
||||
env['CCFLAGS'].remove(undef)
|
||||
|
||||
@@ -99,8 +99,7 @@ def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913
|
||||
_exclude_contents(build_dir, exclude)
|
||||
|
||||
# initialise project
|
||||
ctx.invoke(cmd_init, project_dir=build_dir, board=board,
|
||||
disable_auto_uploading=True)
|
||||
ctx.invoke(cmd_init, project_dir=build_dir, board=board)
|
||||
|
||||
# process project
|
||||
ctx.invoke(cmd_run, project_dir=build_dir, verbose=verbose)
|
||||
|
||||
@@ -45,21 +45,11 @@ def validate_boards(ctx, param, value): # pylint: disable=W0613
|
||||
callback=validate_boards)
|
||||
@click.option("--ide",
|
||||
type=click.Choice(ProjectGenerator.get_supported_ides()))
|
||||
@click.option("--disable-auto-uploading", is_flag=True)
|
||||
@click.option("--enable-auto-uploading", is_flag=True)
|
||||
@click.option("--env-prefix", default="")
|
||||
@click.pass_context
|
||||
def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
|
||||
disable_auto_uploading, env_prefix):
|
||||
|
||||
# ask about auto-uploading
|
||||
if board and app.get_setting("enable_prompts"):
|
||||
disable_auto_uploading = not click.confirm(
|
||||
"Would you like to enable firmware auto-uploading when project "
|
||||
"is successfully built using `platformio run` command? \n"
|
||||
"Don't forget that you can upload firmware manually using "
|
||||
"`platformio run --target upload` command."
|
||||
)
|
||||
click.echo("")
|
||||
enable_auto_uploading, env_prefix):
|
||||
|
||||
if project_dir == getcwd():
|
||||
click.secho("\nThe current working directory", fg="yellow", nl=False)
|
||||
@@ -93,9 +83,108 @@ def cli(ctx, project_dir, board, ide, # pylint: disable=R0913
|
||||
if not isdir(d):
|
||||
makedirs(d)
|
||||
|
||||
if not isfile(join(lib_dir, "readme.txt")):
|
||||
with open(join(lib_dir, "readme.txt"), "w") as f:
|
||||
f.write("""
|
||||
init_lib_readme(lib_dir)
|
||||
init_ci_conf(project_dir)
|
||||
init_cvs_ignore(project_dir)
|
||||
|
||||
if not isfile(project_file):
|
||||
copyfile(join(get_source_dir(), "projectconftpl.ini"),
|
||||
project_file)
|
||||
|
||||
if board:
|
||||
fill_project_envs(
|
||||
ctx, project_file, board, enable_auto_uploading, env_prefix,
|
||||
ide is not None
|
||||
)
|
||||
|
||||
if ide:
|
||||
if not board:
|
||||
raise exception.BoardNotDefined()
|
||||
if len(board) > 1:
|
||||
click.secho(
|
||||
"Warning! You have initialised project with more than 1 board"
|
||||
" for the specified IDE.\n"
|
||||
"However, the IDE features (code autocompletion, syntax lint)"
|
||||
" have been configured for the first board '%s' from your list"
|
||||
" '%s'." % (board[0], ", ".join(board)),
|
||||
fg="yellow"
|
||||
)
|
||||
pg = ProjectGenerator(
|
||||
project_dir, ide, board[0])
|
||||
pg.generate()
|
||||
|
||||
click.secho(
|
||||
"\nProject has been successfully initialized!\nUseful commands:\n"
|
||||
"`platformio run` - process/build project from the current "
|
||||
"directory\n"
|
||||
"`platformio run --target upload` or `platformio run -t upload` "
|
||||
"- upload firmware to embedded board\n"
|
||||
"`platformio run --target clean` - clean project (remove compiled "
|
||||
"files)\n"
|
||||
"`platformio run --help` - additional information",
|
||||
fg="green"
|
||||
)
|
||||
|
||||
|
||||
def fill_project_envs( # pylint: disable=too-many-arguments,too-many-locals
|
||||
ctx, project_file, board_types, enable_auto_uploading,
|
||||
env_prefix, force_download):
|
||||
builtin_boards = get_boards()
|
||||
content = []
|
||||
used_envs = []
|
||||
used_platforms = []
|
||||
|
||||
with open(project_file) as f:
|
||||
used_envs = [l.strip() for l in f.read().splitlines() if
|
||||
l.strip().startswith("[env:")]
|
||||
|
||||
for type_ in board_types:
|
||||
data = builtin_boards[type_]
|
||||
used_platforms.append(data['platform'])
|
||||
env_name = "[env:%s%s]" % (env_prefix, type_)
|
||||
|
||||
if env_name in used_envs:
|
||||
continue
|
||||
|
||||
content.append("")
|
||||
content.append(env_name)
|
||||
content.append("platform = %s" % data['platform'])
|
||||
|
||||
# find default framework for board
|
||||
frameworks = data.get("frameworks")
|
||||
if frameworks:
|
||||
content.append("framework = %s" % frameworks[0])
|
||||
|
||||
content.append("board = %s" % type_)
|
||||
if enable_auto_uploading:
|
||||
content.append("targets = upload")
|
||||
|
||||
if force_download and used_platforms:
|
||||
_install_dependent_platforms(ctx, used_platforms)
|
||||
|
||||
if not content:
|
||||
return
|
||||
|
||||
with open(project_file, "a") as f:
|
||||
content.append("")
|
||||
f.write("\n".join(content))
|
||||
|
||||
|
||||
def _install_dependent_platforms(ctx, platforms):
|
||||
installed_platforms = PlatformFactory.get_platforms(installed=True).keys()
|
||||
if set(platforms) <= set(installed_platforms):
|
||||
return
|
||||
ctx.invoke(
|
||||
cli_platforms_install,
|
||||
platforms=list(set(platforms) - set(installed_platforms))
|
||||
)
|
||||
|
||||
|
||||
def init_lib_readme(lib_dir):
|
||||
if isfile(join(lib_dir, "readme.txt")):
|
||||
return
|
||||
with open(join(lib_dir, "readme.txt"), "w") as f:
|
||||
f.write("""
|
||||
This directory is intended for the project specific (private) libraries.
|
||||
PlatformIO will compile them to static libraries and link to executable file.
|
||||
|
||||
@@ -135,77 +224,81 @@ http://docs.platformio.org/en/latest/projectconf.html#lib-install
|
||||
|
||||
""")
|
||||
|
||||
if not isfile(project_file):
|
||||
copyfile(join(get_source_dir(), "projectconftpl.ini"),
|
||||
project_file)
|
||||
|
||||
if board:
|
||||
fill_project_envs(
|
||||
ctx, project_file, board, disable_auto_uploading, env_prefix)
|
||||
|
||||
if ide:
|
||||
pg = ProjectGenerator(project_dir, ide, board[0] if board else None)
|
||||
pg.generate()
|
||||
|
||||
click.secho(
|
||||
"\nProject has been successfully initialized!\nUseful commands:\n"
|
||||
"`platformio run` - process/build project from the current "
|
||||
"directory\n"
|
||||
"`platformio run --target upload` or `platformio run -t upload` "
|
||||
"- upload firmware to embedded board\n"
|
||||
"`platformio run --target clean` - clean project (remove compiled "
|
||||
"files)",
|
||||
fg="green"
|
||||
)
|
||||
|
||||
|
||||
def fill_project_envs(ctx, project_file, board_types, disable_auto_uploading,
|
||||
env_prefix):
|
||||
builtin_boards = get_boards()
|
||||
content = []
|
||||
used_envs = []
|
||||
used_platforms = []
|
||||
|
||||
with open(project_file) as f:
|
||||
used_envs = [l.strip() for l in f.read().splitlines() if
|
||||
l.strip().startswith("[env:")]
|
||||
|
||||
for type_ in board_types:
|
||||
data = builtin_boards[type_]
|
||||
used_platforms.append(data['platform'])
|
||||
env_name = "[env:%s%s]" % (env_prefix, type_)
|
||||
|
||||
if env_name in used_envs:
|
||||
continue
|
||||
|
||||
content.append("")
|
||||
content.append(env_name)
|
||||
content.append("platform = %s" % data['platform'])
|
||||
|
||||
# find default framework for board
|
||||
frameworks = data.get("frameworks")
|
||||
if frameworks:
|
||||
content.append("framework = %s" % frameworks[0])
|
||||
|
||||
content.append("board = %s" % type_)
|
||||
content.append("%stargets = upload" % ("# " if disable_auto_uploading
|
||||
else ""))
|
||||
|
||||
_install_dependent_platforms(ctx, used_platforms)
|
||||
|
||||
if not content:
|
||||
def init_ci_conf(project_dir):
|
||||
if isfile(join(project_dir, ".travis.yml")):
|
||||
return
|
||||
|
||||
with open(project_file, "a") as f:
|
||||
content.append("")
|
||||
f.write("\n".join(content))
|
||||
with open(join(project_dir, ".travis.yml"), "w") as f:
|
||||
f.write("""# Continuous Integration (CI) is the practice, in software
|
||||
# engineering, of merging all developer working copies with a shared mainline
|
||||
# several times a day < http://docs.platformio.org/en/latest/ci/index.html >
|
||||
#
|
||||
# Documentation:
|
||||
#
|
||||
# * Travis CI Embedded Builds with PlatformIO
|
||||
# < https://docs.travis-ci.com/user/integration/platformio/ >
|
||||
#
|
||||
# * PlatformIO integration with Travis CI
|
||||
# < http://docs.platformio.org/en/latest/ci/travis.html >
|
||||
#
|
||||
# * User Guide for `platformio ci` command
|
||||
# < http://docs.platformio.org/en/latest/userguide/cmd_ci.html >
|
||||
#
|
||||
#
|
||||
# Please choice one of the following templates (proposed below) and uncomment
|
||||
# it (remove "# " before each line) or use own configuration according to the
|
||||
# Travis CI documentation (see above).
|
||||
#
|
||||
|
||||
|
||||
def _install_dependent_platforms(ctx, platforms):
|
||||
installed_platforms = PlatformFactory.get_platforms(installed=True).keys()
|
||||
if set(platforms) <= set(installed_platforms):
|
||||
#
|
||||
# Template #1: General project. Test it using existing `platformio.ini`.
|
||||
#
|
||||
|
||||
# language: python
|
||||
# python:
|
||||
# - "2.7"
|
||||
#
|
||||
# sudo: false
|
||||
# cache:
|
||||
# directories:
|
||||
# - "~/.platformio"
|
||||
#
|
||||
# install:
|
||||
# - pip install -U platformio
|
||||
#
|
||||
# script:
|
||||
# - platformio run
|
||||
|
||||
|
||||
#
|
||||
# Template #2: The project is intended to by used as a library with examples
|
||||
#
|
||||
|
||||
# language: python
|
||||
# python:
|
||||
# - "2.7"
|
||||
#
|
||||
# sudo: false
|
||||
# cache:
|
||||
# directories:
|
||||
# - "~/.platformio"
|
||||
#
|
||||
# env:
|
||||
# - PLATFORMIO_CI_SRC=path/to/test/file.c
|
||||
# - PLATFORMIO_CI_SRC=examples/file.ino
|
||||
# - PLATFORMIO_CI_SRC=path/to/test/directory
|
||||
#
|
||||
# install:
|
||||
# - pip install -U platformio
|
||||
#
|
||||
# script:
|
||||
# - platformio ci --lib="." --board=TYPE_1 --board=TYPE_2 --board=TYPE_N
|
||||
""")
|
||||
|
||||
|
||||
def init_cvs_ignore(project_dir):
|
||||
if isfile(join(project_dir, ".gitignore")):
|
||||
return
|
||||
ctx.invoke(
|
||||
cli_platforms_install,
|
||||
platforms=list(set(platforms) - set(installed_platforms))
|
||||
)
|
||||
with open(join(project_dir, ".gitignore"), "w") as f:
|
||||
f.write(".pioevs")
|
||||
|
||||
@@ -135,7 +135,7 @@ def lib_install(ctx, libid, version):
|
||||
except AssertionError:
|
||||
raise exception.LibInstallDependencyError(str(item))
|
||||
|
||||
except exception.LibAlreadyInstalledError:
|
||||
except exception.LibAlreadyInstalled:
|
||||
click.secho("Already installed", fg="yellow")
|
||||
|
||||
|
||||
@@ -159,7 +159,7 @@ def lib_install_dependency(ctx, data):
|
||||
ctx.invoke(lib_install, libid=[result['items'][0]['id']])
|
||||
else:
|
||||
click.secho(
|
||||
"Conflict: More then one dependent libraries have been found "
|
||||
"Conflict: More than one dependent libraries have been found "
|
||||
"by request %s:" % json.dumps(data), fg="red")
|
||||
|
||||
echo_liblist_header()
|
||||
|
||||
@@ -57,10 +57,10 @@ if int(PYSERIAL_VERSION[0]) == 3:
|
||||
help="Enable RTS/CTS flow control, default=Off")
|
||||
@click.option("--xonxoff", is_flag=True,
|
||||
help="Enable software flow control, default=Off")
|
||||
@click.option("--rts", default="0", type=click.Choice(["0", "1"]),
|
||||
help="Set initial RTS line state, default=0")
|
||||
@click.option("--dtr", default="0", type=click.Choice(["0", "1"]),
|
||||
help="Set initial DTR line state, default=0")
|
||||
@click.option("--rts", default=None, type=click.Choice(["0", "1"]),
|
||||
help="Set initial RTS line state")
|
||||
@click.option("--dtr", default=None, type=click.Choice(["0", "1"]),
|
||||
help="Set initial DTR line state")
|
||||
@click.option("--encoding", default="UTF-8",
|
||||
help="Set the encoding for the serial port (e.g. hexlify, "
|
||||
"Latin1, UTF-8), default: UTF-8")
|
||||
|
||||
@@ -32,7 +32,6 @@ def cli():
|
||||
fg="yellow")
|
||||
|
||||
cmds = (
|
||||
["pip", "install", "--upgrade", "pip", "setuptools"],
|
||||
["pip", "install", "--upgrade", "platformio"],
|
||||
["platformio", "--version"]
|
||||
)
|
||||
@@ -56,11 +55,15 @@ def cli():
|
||||
click.echo("Release notes: ", nl=False)
|
||||
click.secho("http://docs.platformio.org/en/latest/history.html",
|
||||
fg="cyan")
|
||||
except (OSError, AssertionError) as e:
|
||||
except Exception as e: # pylint: disable=W0703
|
||||
if not r:
|
||||
raise exception.PlatformioUpgradeError(
|
||||
raise exception.UpgradeError(
|
||||
"\n".join([str(cmd), str(e)]))
|
||||
if ("Permission denied" in r['err'] and
|
||||
permission_errors = (
|
||||
"permission denied",
|
||||
"not permitted"
|
||||
)
|
||||
if (any([m in r['err'].lower() for m in permission_errors]) and
|
||||
"windows" not in util.get_systype()):
|
||||
click.secho("""
|
||||
-----------------
|
||||
@@ -68,13 +71,13 @@ Permission denied
|
||||
-----------------
|
||||
You need the `sudo` permission to install Python packages. Try
|
||||
|
||||
> sudo platformio upgrade
|
||||
> sudo pip install -U platformio
|
||||
|
||||
WARNING! Don't use `sudo` for the rest PlatformIO commands.
|
||||
""", fg="yellow", err=True)
|
||||
raise exception.ReturnErrorCode()
|
||||
else:
|
||||
raise exception.PlatformioUpgradeError(
|
||||
raise exception.UpgradeError(
|
||||
"\n".join([str(cmd), r['out'], r['err']]))
|
||||
|
||||
|
||||
|
||||
@@ -48,10 +48,11 @@ class PlatformNotInstalledYet(PlatformioException):
|
||||
"Use `platformio platforms install` command"
|
||||
|
||||
|
||||
class UnknownCLICommand(PlatformioException):
|
||||
class BoardNotDefined(PlatformioException):
|
||||
|
||||
MESSAGE = "Unknown command '%s'. Please use `platformio --help`"\
|
||||
" to see all available commands"
|
||||
MESSAGE = "You need to specify board type using `-b` or `--board` "\
|
||||
"option. Supported boards list is available via "\
|
||||
" `platformio boards` command"
|
||||
|
||||
|
||||
class UnknownBoard(PlatformioException):
|
||||
@@ -149,11 +150,11 @@ class APIRequestError(PlatformioException):
|
||||
MESSAGE = "[API] %s"
|
||||
|
||||
|
||||
class LibAlreadyInstalledError(PlatformioException):
|
||||
class LibAlreadyInstalled(PlatformioException):
|
||||
pass
|
||||
|
||||
|
||||
class LibNotInstalledError(PlatformioException):
|
||||
class LibNotInstalled(PlatformioException):
|
||||
|
||||
MESSAGE = "Library #%d has not been installed yet"
|
||||
|
||||
@@ -183,11 +184,6 @@ class InvalidSettingValue(PlatformioException):
|
||||
MESSAGE = "Invalid value '%s' for the setting '%s'"
|
||||
|
||||
|
||||
class UpgraderFailed(PlatformioException):
|
||||
|
||||
MESSAGE = "An error occurred while upgrading PlatformIO"
|
||||
|
||||
|
||||
class CIBuildEnvsEmpty(PlatformioException):
|
||||
|
||||
MESSAGE = "Can't find PlatformIO build environments.\n"\
|
||||
@@ -195,20 +191,21 @@ class CIBuildEnvsEmpty(PlatformioException):
|
||||
"predefined environments using `--project-conf` option"
|
||||
|
||||
|
||||
class SConsNotInstalled(PlatformioException):
|
||||
class SConsNotInstalledError(PlatformioException):
|
||||
|
||||
MESSAGE = "The PlatformIO and `scons` aren't installed properly. "\
|
||||
"More details in FAQ/Troubleshooting section: "\
|
||||
"http://docs.platformio.org/en/latest/faq.html"
|
||||
|
||||
|
||||
class PlatformioUpgradeError(PlatformioException):
|
||||
class UpgradeError(PlatformioException):
|
||||
|
||||
MESSAGE = "%s \n\n"\
|
||||
"1. Please report this issue here: "\
|
||||
"https://github.com/platformio/platformio/issues \n"\
|
||||
"2. Try different installation/upgrading steps: "\
|
||||
"http://docs.platformio.org/en/latest/installation.html"
|
||||
MESSAGE = """%s
|
||||
|
||||
* Upgrade using `pip install -U platformio`
|
||||
* Try different installation/upgrading steps:
|
||||
http://docs.platformio.org/en/latest/installation.html
|
||||
"""
|
||||
|
||||
|
||||
class CygwinEnvDetected(PlatformioException):
|
||||
|
||||
@@ -20,12 +20,12 @@ from os.path import abspath, basename, expanduser, isdir, join, relpath
|
||||
import bottle
|
||||
import click
|
||||
|
||||
from platformio import util
|
||||
from platformio import exception, util
|
||||
|
||||
|
||||
class ProjectGenerator(object):
|
||||
|
||||
def __init__(self, project_dir, ide, board=None):
|
||||
def __init__(self, project_dir, ide, board):
|
||||
self.project_dir = project_dir
|
||||
self.ide = ide
|
||||
self.board = board
|
||||
@@ -50,7 +50,7 @@ class ProjectGenerator(object):
|
||||
data = {"env_name": section[4:]}
|
||||
for k, v in config.items(section):
|
||||
data[k] = v
|
||||
if self.board and self.board == data.get("board"):
|
||||
if self.board == data.get("board"):
|
||||
break
|
||||
return data
|
||||
|
||||
@@ -68,16 +68,15 @@ class ProjectGenerator(object):
|
||||
["platformio", "-f", "run", "-t", "idedata",
|
||||
"-e", envdata['env_name'], "-d", self.project_dir]
|
||||
)
|
||||
|
||||
if result['returncode'] != 0 or '"includes":' not in result['out']:
|
||||
return data
|
||||
raise exception.PlatformioException(
|
||||
"\n".join([result['out'], result['err']]))
|
||||
|
||||
output = result['out']
|
||||
try:
|
||||
start_index = output.index('\n{"')
|
||||
stop_index = output.rindex('}')
|
||||
data = json.loads(output[start_index + 1:stop_index + 1])
|
||||
except ValueError:
|
||||
pass
|
||||
start_index = output.index('\n{"')
|
||||
stop_index = output.rindex('}')
|
||||
data = json.loads(output[start_index + 1:stop_index + 1])
|
||||
|
||||
return data
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ from tempfile import gettempdir
|
||||
|
||||
from platformio import telemetry, util
|
||||
from platformio.downloader import FileDownloader
|
||||
from platformio.exception import LibAlreadyInstalledError, LibNotInstalledError
|
||||
from platformio.exception import LibAlreadyInstalled, LibNotInstalled
|
||||
from platformio.unpacker import FileUnpacker
|
||||
|
||||
|
||||
@@ -73,17 +73,17 @@ class LibraryManager(object):
|
||||
for item in self.get_installed().values():
|
||||
if "id" in item and item['id'] == id_:
|
||||
return item
|
||||
raise LibNotInstalledError(id_)
|
||||
raise LibNotInstalled(id_)
|
||||
|
||||
def is_installed(self, id_):
|
||||
try:
|
||||
return int(self.get_info(id_)['id']) == id_
|
||||
except LibNotInstalledError:
|
||||
except LibNotInstalled:
|
||||
return False
|
||||
|
||||
def install(self, id_, version=None):
|
||||
if self.is_installed(id_):
|
||||
raise LibAlreadyInstalledError()
|
||||
raise LibAlreadyInstalled()
|
||||
|
||||
dlinfo = util.get_api_result(
|
||||
"/lib/download/" + str(id_),
|
||||
@@ -120,4 +120,4 @@ class LibraryManager(object):
|
||||
label="#%d %s" % (id_, item['name'])
|
||||
)
|
||||
return True
|
||||
raise LibNotInstalledError(id_)
|
||||
raise LibNotInstalled(id_)
|
||||
|
||||
@@ -141,15 +141,10 @@ def after_upgrade(ctx):
|
||||
(click.style("follow", 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"),
|
||||
click.echo("- %s it on GitHub! > %s" % (
|
||||
click.style("star", fg="cyan"),
|
||||
click.style("https://github.com/platformio/platformio", fg="cyan")
|
||||
))
|
||||
click.echo("- %s for the new features/issues on Bountysource > %s" % (
|
||||
click.style("vote", fg="cyan"),
|
||||
click.style("https://www.bountysource.com/teams/platformio/issues",
|
||||
fg="cyan")
|
||||
))
|
||||
click.echo("*" * terminal_width)
|
||||
click.echo("")
|
||||
|
||||
@@ -171,7 +166,7 @@ def after_upgrade(ctx):
|
||||
telemetry.on_event(category="Auto", action="Upgrade",
|
||||
label="%s > %s" % (last_version, __version__))
|
||||
else:
|
||||
raise exception.UpgraderFailed()
|
||||
raise exception.UpgradeError("Auto upgrading...")
|
||||
click.echo("")
|
||||
|
||||
|
||||
|
||||
@@ -15,6 +15,7 @@
|
||||
import os
|
||||
import re
|
||||
from imp import load_source
|
||||
from multiprocessing import cpu_count
|
||||
from os.path import isdir, isfile, join
|
||||
|
||||
import click
|
||||
@@ -389,13 +390,15 @@ class BasePlatform(object):
|
||||
[
|
||||
"scons",
|
||||
"-Q",
|
||||
"-j %d" % self.get_job_nums(),
|
||||
"--warn=no-no-parallel-support",
|
||||
"-f", join(util.get_source_dir(), "builder", "main.py")
|
||||
] + variables + targets,
|
||||
stdout=util.AsyncPipe(self.on_run_out),
|
||||
stderr=util.AsyncPipe(self.on_run_err)
|
||||
)
|
||||
except (OSError, AssertionError):
|
||||
raise exception.SConsNotInstalled()
|
||||
raise exception.SConsNotInstalledError()
|
||||
|
||||
assert "returncode" in result
|
||||
# if self._found_error:
|
||||
@@ -432,3 +435,10 @@ class BasePlatform(object):
|
||||
self._last_echo_line = line
|
||||
|
||||
click.secho(line, fg=fg, err=level < 3)
|
||||
|
||||
@staticmethod
|
||||
def get_job_nums():
|
||||
try:
|
||||
return cpu_count()
|
||||
except NotImplementedError:
|
||||
return 1
|
||||
|
||||
@@ -291,7 +291,10 @@ def on_exception(e):
|
||||
return
|
||||
mp = MeasurementProtocol()
|
||||
mp['exd'] = "%s: %s" % (type(e).__name__, e)
|
||||
mp['exf'] = int(not isinstance(e, exception.PlatformioException))
|
||||
mp['exf'] = int(any([
|
||||
not isinstance(e, exception.PlatformioException),
|
||||
"Error" in e.__class__.__name__
|
||||
]))
|
||||
mp.send("exception")
|
||||
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ class ZIPArchive(ArchiveBase):
|
||||
def preserve_mtime(item, dest_dir):
|
||||
util.change_filemtime(
|
||||
join(dest_dir, item.filename),
|
||||
mktime(list(item.date_time) + [0]*3)
|
||||
mktime(list(item.date_time) + [0] * 3)
|
||||
)
|
||||
|
||||
def get_items(self):
|
||||
|
||||
@@ -27,6 +27,7 @@ from threading import Thread
|
||||
|
||||
from platformio import __apiurl__, __version__, exception
|
||||
|
||||
# pylint: disable=wrong-import-order
|
||||
try:
|
||||
from configparser import ConfigParser
|
||||
except ImportError:
|
||||
@@ -67,6 +68,7 @@ class AsyncPipe(Thread):
|
||||
|
||||
|
||||
class cd(object):
|
||||
|
||||
def __init__(self, new_path):
|
||||
self.new_path = new_path
|
||||
self.prev_path = os.getcwd()
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
bottle==0.12.9
|
||||
click==5.1
|
||||
colorama==0.3.3
|
||||
lockfile==0.11.0
|
||||
lockfile==0.12.2
|
||||
pyserial==2.7
|
||||
requests==2.8.1
|
||||
scons==2.4.1
|
||||
|
||||
13
setup.py
13
setup.py
@@ -21,7 +21,7 @@ from platformio import (__author__, __description__, __email__, __license__,
|
||||
|
||||
install_requires = [
|
||||
"bottle",
|
||||
"click>=3.2",
|
||||
"click>=3.2,<6",
|
||||
"lockfile>=0.9.1",
|
||||
"pyserial",
|
||||
"requests>=2.4.0"
|
||||
@@ -71,10 +71,9 @@ setup(
|
||||
"Topic :: Software Development :: Build Tools",
|
||||
"Topic :: Software Development :: Compilers"
|
||||
],
|
||||
keywords=(
|
||||
"builder library manager embedded development ide continuous "
|
||||
"integration atmel avr sam espressif esp freescale kinetis nordic "
|
||||
"nrf51 nxp lpc silicon labs efm32 st stm32 ti msp430 tiva teensy "
|
||||
"arduino mbed libopencm3"
|
||||
)
|
||||
keywords=[
|
||||
"iot", "build tool", "compiler", "builder", "library manager",
|
||||
"embedded", "ci", "continuous integration", "arduino", "mbed",
|
||||
"framework", "ide", "ide integration", "library.json"
|
||||
]
|
||||
)
|
||||
|
||||
@@ -16,7 +16,7 @@ from os import makedirs, getcwd
|
||||
from os.path import getsize, isdir, isfile, join
|
||||
|
||||
from platformio.commands.init import cli
|
||||
from platformio import exception, util
|
||||
from platformio import util
|
||||
|
||||
|
||||
def validate_pioproject(pioproject_dir):
|
||||
@@ -53,8 +53,7 @@ def test_init_special_board(platformio_setup, clirunner, validate_cliresult):
|
||||
expected_result = [
|
||||
("platform", str(uno['platform'])),
|
||||
("framework", str(uno['frameworks'][0])),
|
||||
("board", "uno"),
|
||||
("targets", "upload")
|
||||
("board", "uno")
|
||||
]
|
||||
|
||||
assert config.has_section("env:uno")
|
||||
@@ -62,18 +61,19 @@ def test_init_special_board(platformio_setup, clirunner, validate_cliresult):
|
||||
set(config.items("env:uno")))) == 0
|
||||
|
||||
|
||||
def test_init_disable_auto_uploading(platformio_setup, clirunner,
|
||||
validate_cliresult):
|
||||
def test_init_enable_auto_uploading(platformio_setup, clirunner,
|
||||
validate_cliresult):
|
||||
with clirunner.isolated_filesystem():
|
||||
result = clirunner.invoke(cli,
|
||||
["-b", "uno", "--disable-auto-uploading"])
|
||||
["-b", "uno", "--enable-auto-uploading"])
|
||||
validate_cliresult(result)
|
||||
validate_pioproject(getcwd())
|
||||
config = util.get_project_config()
|
||||
expected_result = [
|
||||
("platform", "atmelavr"),
|
||||
("framework", "arduino"),
|
||||
("board", "uno")
|
||||
("board", "uno"),
|
||||
("targets", "upload")
|
||||
]
|
||||
assert config.has_section("env:uno")
|
||||
assert len(set(expected_result).symmetric_difference(
|
||||
|
||||
Reference in New Issue
Block a user