forked from platformio/platformio-core
Merge branch 'release/v0.9.1'
This commit is contained in:
15
HISTORY.rst
15
HISTORY.rst
@ -1,6 +1,21 @@
|
|||||||
Release History
|
Release History
|
||||||
===============
|
===============
|
||||||
|
|
||||||
|
0.9.1 (2014-12-05)
|
||||||
|
------------------
|
||||||
|
|
||||||
|
* Ask user to install platform (when it hasn't been installed yet) within
|
||||||
|
`platformio run <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_run.html>`_
|
||||||
|
and `platformio show <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_show.html>`_ commands
|
||||||
|
* Improved main `documentation <http://docs.platformio.ikravets.com>`_
|
||||||
|
* Fixed "*OSError: [Errno 2] No such file or directory*" within
|
||||||
|
`platformio run <http://docs.platformio.ikravets.com/en/latest/userguide/cmd_run.html>`_
|
||||||
|
command when PlatformIO isn't installed properly
|
||||||
|
* Fixed example for `Eclipse IDE with Tiva board <https://github.com/ivankravets/platformio/tree/develop/examples/ide-eclipse>`_
|
||||||
|
(`issue #32 <https://github.com/ivankravets/platformio/issues/32>`_)
|
||||||
|
* Upgraded `Eclipse Project Examples <https://github.com/ivankravets/platformio/tree/develop/examples/ide-eclipse>`_
|
||||||
|
to latest *Luna* and *PlatformIO* releases
|
||||||
|
|
||||||
0.9.0 (2014-12-01)
|
0.9.0 (2014-12-01)
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
|
BIN
docs/_static/ide-platformio-eclipse.png
vendored
BIN
docs/_static/ide-platformio-eclipse.png
vendored
Binary file not shown.
Before Width: | Height: | Size: 695 KiB After Width: | Height: | Size: 265 KiB |
@ -19,6 +19,7 @@ Eclipse
|
|||||||
:target: http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio
|
:target: http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio
|
||||||
|
|
||||||
* `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>`_
|
* `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>`_
|
||||||
|
* `More examples (TI MSP430, TI TIVA and etc) <https://github.com/ivankravets/platformio/tree/develop/examples/ide-eclipse>`_
|
||||||
|
|
||||||
Energia IDE
|
Energia IDE
|
||||||
-----------
|
-----------
|
||||||
|
@ -50,7 +50,9 @@ Example:
|
|||||||
{
|
{
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/shirriff/Arduino-IRremote.git"
|
"url": "https://github.com/shirriff/Arduino-IRremote.git"
|
||||||
}
|
},
|
||||||
|
"frameworks": "arduino",
|
||||||
|
"platforms": "atmelavr"
|
||||||
}
|
}
|
||||||
|
|
||||||
Under CVS (SVN/GIT)
|
Under CVS (SVN/GIT)
|
||||||
@ -83,7 +85,9 @@ Example:
|
|||||||
{
|
{
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://code.google.com/p/xbee-arduino/"
|
"url": "https://code.google.com/p/xbee-arduino/"
|
||||||
}
|
},
|
||||||
|
"frameworks": "arduino",
|
||||||
|
"platforms": "atmelavr"
|
||||||
}
|
}
|
||||||
|
|
||||||
Self-hosted
|
Self-hosted
|
||||||
@ -114,7 +118,9 @@ of **required** fields in the :ref:`library_config` will look like:
|
|||||||
},
|
},
|
||||||
"version": "2.2",
|
"version": "2.2",
|
||||||
"downloadUrl": "http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip",
|
"downloadUrl": "http://www.pjrc.com/teensy/arduino_libraries/OneWire.zip",
|
||||||
"include": "OneWire"
|
"include": "OneWire",
|
||||||
|
"frameworks": "arduino",
|
||||||
|
"platforms": "atmelavr"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ Packages
|
|||||||
- uploader
|
- uploader
|
||||||
- `AVRDUDE <http://www.nongnu.org/avrdude/>`_
|
- `AVRDUDE <http://www.nongnu.org/avrdude/>`_
|
||||||
* - ``framework-arduinoavr``
|
* - ``framework-arduinoavr``
|
||||||
-
|
- framework
|
||||||
- See below in :ref:`atmelavr_frameworks`
|
- See below in :ref:`atmelavr_frameworks`
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,9 +3,9 @@
|
|||||||
Platforms & Embedded Boards
|
Platforms & Embedded Boards
|
||||||
===========================
|
===========================
|
||||||
|
|
||||||
*PlatformIO* has pre-built different development platforms for popular OS (Mac,
|
*PlatformIO* has pre-built different development platforms for popular OS
|
||||||
Linux 32/64/ARM and Windows). Each of them include compiler, debugger, uploader
|
(*Mac OS X, Linux (+ARMv6) and Windows*). Each of them include compiler,
|
||||||
(for embedded) and many other useful tools.
|
debugger, uploader (for embedded) and many other useful tools.
|
||||||
|
|
||||||
Also it has pre-configured settings for most popular **Embedded Platform
|
Also it has pre-configured settings for most popular **Embedded Platform
|
||||||
Boards**. You have no need to specify in :ref:`projectconf` type or frequency of
|
Boards**. You have no need to specify in :ref:`projectconf` type or frequency of
|
||||||
|
@ -27,7 +27,7 @@ Packages
|
|||||||
- uploader
|
- uploader
|
||||||
- `MSPDebug <http://mspdebug.sourceforge.net>`_
|
- `MSPDebug <http://mspdebug.sourceforge.net>`_
|
||||||
* - ``framework-energiamsp430``
|
* - ``framework-energiamsp430``
|
||||||
-
|
- framework
|
||||||
- See below in :ref:`timsp430_frameworks`
|
- See below in :ref:`timsp430_frameworks`
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ Packages
|
|||||||
- uploader
|
- uploader
|
||||||
- `Flash Programmer <http://www.ti.com/tool/lmflashprogrammer>`_
|
- `Flash Programmer <http://www.ti.com/tool/lmflashprogrammer>`_
|
||||||
* - ``framework-energiativa``
|
* - ``framework-energiativa``
|
||||||
-
|
- framework
|
||||||
- See below in :ref:`titiva_frameworks`
|
- See below in :ref:`titiva_frameworks`
|
||||||
|
|
||||||
.. note::
|
.. note::
|
||||||
|
@ -113,6 +113,9 @@ This option is used by "uploader" tool to send firmware to the board via
|
|||||||
* ``/dev/ttyUSB0`` - Unix-based OS
|
* ``/dev/ttyUSB0`` - Unix-based OS
|
||||||
* ``COM3`` - Windows OS
|
* ``COM3`` - Windows OS
|
||||||
|
|
||||||
|
If ``upload_port`` isn't specified, then *PlatformIO* will try to detect
|
||||||
|
``upload_port`` automatically.
|
||||||
|
|
||||||
To print all available serial ports use :ref:`cmd_serialports` command.
|
To print all available serial ports use :ref:`cmd_serialports` command.
|
||||||
|
|
||||||
|
|
||||||
@ -142,6 +145,8 @@ When no targets are defined, *PlatformIO* will build only sources by default.
|
|||||||
(``targets = upload``).
|
(``targets = upload``).
|
||||||
|
|
||||||
|
|
||||||
|
.. _projectconf_build_flags:
|
||||||
|
|
||||||
``build_flags``
|
``build_flags``
|
||||||
^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
@ -232,6 +237,8 @@ For more detailed information about available flags/options go to:
|
|||||||
This is option ``srcbuild_flags`` has the same behaviour like ``build_flags``
|
This is option ``srcbuild_flags`` has the same behaviour like ``build_flags``
|
||||||
but will be applied only for project source code from ``src`` directory.
|
but will be applied only for project source code from ``src`` directory.
|
||||||
|
|
||||||
|
.. _projectconf_examples:
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -13,7 +13,7 @@ Print all available development platforms for installing
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ platformio search all
|
$ platformio search
|
||||||
[ ... ]
|
[ ... ]
|
||||||
|
|
||||||
|
|
||||||
@ -33,16 +33,22 @@ Initialize new PlatformIO based project
|
|||||||
|
|
||||||
.. code-block:: bash
|
.. code-block:: bash
|
||||||
|
|
||||||
$ cd /path/to/empty/directory
|
|
||||||
$ platformio init
|
$ platformio init
|
||||||
Project has been initialized!
|
The current working directory *** will be used for the new project.
|
||||||
Please put your source code to `src` directory, external libraries to `lib`
|
You can specify another project directory via
|
||||||
and setup environments in `platformio.ini` file.
|
`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.
|
||||||
Then process project with `platformio run` command.
|
|
||||||
|
The next files/directories will be created in ***
|
||||||
|
`platformio.ini` - Project Configuration File
|
||||||
|
`src` - a source directory. Put your source code here
|
||||||
|
`lib` - a directory for the project specific libraries
|
||||||
|
Do you want to continue? [y/N]: y
|
||||||
|
Project has been successfully initialized!
|
||||||
|
Now you can process it with `platformio run` command.
|
||||||
|
|
||||||
|
|
||||||
Setup environments in ``platformio.ini``. For more examples go to
|
Setup environments in ``platformio.ini``. For more examples go to
|
||||||
:ref:`projectconf`
|
:ref:`Project Configuration File <projectconf_examples>`
|
||||||
|
|
||||||
.. code-block:: ini
|
.. code-block:: ini
|
||||||
|
|
||||||
|
@ -45,7 +45,7 @@ Examples
|
|||||||
$ platformio init
|
$ platformio init
|
||||||
The current working directory *** will be used for the new project.
|
The current working directory *** will be used for the new project.
|
||||||
You can specify another project directory via
|
You can specify another project directory via
|
||||||
`platformio init -d %PATH_TO_PROJECT_DIR%` command.
|
`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.
|
||||||
|
|
||||||
The next files/directories will be created in ***
|
The next files/directories will be created in ***
|
||||||
platformio.ini - Project Configuration File
|
platformio.ini - Project Configuration File
|
||||||
|
@ -23,7 +23,7 @@ There are several predefined aliases for packages, such as:
|
|||||||
|
|
||||||
* ``toolchain``
|
* ``toolchain``
|
||||||
* ``uploader``
|
* ``uploader``
|
||||||
|
* ``framework``
|
||||||
|
|
||||||
Options
|
Options
|
||||||
-------
|
-------
|
||||||
|
@ -5,7 +5,7 @@ The detailed information and steps are described in this article:
|
|||||||
`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>`_.
|
`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>`_.
|
||||||
|
|
||||||
|
|
||||||
.. image:: http://www.ikravets.com/wp-content/uploads/2014/06/eclipse_build_arduino_pro5v-1024x822.png
|
.. image:: http://www.ikravets.com/wp-content/uploads/2014/06/eclipse_platformio_build_arduino_uno.png
|
||||||
:width: 850px
|
:width: 850px
|
||||||
:target: http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio
|
:target: http://www.ikravets.com/computer-life/programming/2014/06/20/building-and-debugging-atmel-avr-arduino-based-project-using-eclipse-ideplatformio
|
||||||
|
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?fileVersion 4.0.0?>
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
|
||||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
<cconfiguration id="0.910961921">
|
<cconfiguration id="0.910961921">
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.910961921" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.910961921" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
||||||
@ -13,41 +11,46 @@
|
|||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.910961921" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.910961921" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
||||||
<folderInfo id="0.910961921." name="/" resourcePath="">
|
<folderInfo id="0.910961921." name="/" resourcePath="">
|
||||||
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.952979152" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.952979152" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
||||||
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.952979152.52310970" name=""/>
|
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.952979152.52310970" name=""/>
|
||||||
<builder id="org.eclipse.cdt.build.core.settings.default.builder.1519453406" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
<builder cleanBuildTarget="run --target clean" command="platformio" id="org.eclipse.cdt.build.core.settings.default.builder.1519453406" incrementalBuildTarget="run" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1409095472" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1409095472" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1624502120" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.1624502120" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.239157887" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.239157887" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-atmelavr/avr/include""/>
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/frameworks/arduino/cores/arduino""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-arduinoavr/cores/arduino""/>
|
||||||
</option>
|
</option>
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.922107295" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.922107295" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.149990277" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.149990277" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.54121539" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.54121539" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1096940598" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1096940598" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/frameworks/arduino/cores/arduino""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/frameworks/arduino/cores/arduino""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-atmelavr/avr/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-arduinoavr/cores/arduino""/>
|
||||||
</option>
|
</option>
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1198905600" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1198905600" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.762536863" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.762536863" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1310559623" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.1310559623" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.41298875" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.41298875" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/frameworks/arduino/cores/arduino""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/frameworks/arduino/cores/arduino""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-atmelavr/avr/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-arduinoavr/cores/arduino""/>
|
||||||
</option>
|
</option>
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.884639970" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.884639970" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.549319812" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.549319812" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
@ -74,4 +77,5 @@
|
|||||||
<resource resourceType="PROJECT" workspacePath="/arduino_pro5"/>
|
<resource resourceType="PROJECT" workspacePath="/arduino_pro5"/>
|
||||||
</configuration>
|
</configuration>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
|
<storageModule moduleId="org.eclipse.cdt.internal.ui.text.commentOwnerProjectMappings"/>
|
||||||
</cproject>
|
</cproject>
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
all:
|
|
||||||
platformio run -t upload
|
|
||||||
|
|
||||||
clean:
|
|
||||||
platformio run -t clean
|
|
@ -4,5 +4,4 @@
|
|||||||
[env:arduino_pro5v]
|
[env:arduino_pro5v]
|
||||||
platform = atmelavr
|
platform = atmelavr
|
||||||
framework = arduino
|
framework = arduino
|
||||||
board = pro16MHzatmega168
|
board = pro16MHzatmega168
|
||||||
upload_port = /dev/tty.SLAB_USBtoUART
|
|
@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?fileVersion 4.0.0?>
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
|
||||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
<cconfiguration id="0.1706826288">
|
<cconfiguration id="0.1706826288">
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1706826288" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1706826288" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
||||||
@ -13,18 +11,19 @@
|
|||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.1706826288" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.1706826288" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
||||||
<folderInfo id="0.1706826288." name="/" resourcePath="">
|
<folderInfo id="0.1706826288." name="/" resourcePath="">
|
||||||
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.944229927" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.944229927" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
||||||
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.944229927.1146791472" name=""/>
|
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.944229927.1146791472" name=""/>
|
||||||
<builder id="org.eclipse.cdt.build.core.settings.default.builder.81097189" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
<builder cleanBuildTarget="run --target clean" command="platformio" id="org.eclipse.cdt.build.core.settings.default.builder.81097189" incrementalBuildTarget="run" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.615700392" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.615700392" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.509191184" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.509191184" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1976688999" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1976688999" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-atmelavr/avr/include""/>
|
||||||
</option>
|
</option>
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1146079252" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1146079252" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
||||||
@ -34,6 +33,7 @@
|
|||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.524184308" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.524184308" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1379816017" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1379816017" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-atmelavr/avr/include""/>
|
||||||
</option>
|
</option>
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1180078676" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1180078676" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
||||||
@ -43,6 +43,7 @@
|
|||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.746817635" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.746817635" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.905883681" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.905883681" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/atmelavr/tools/toolchain/avr/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-atmelavr/avr/include""/>
|
||||||
</option>
|
</option>
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1589314232" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
<option id="org.eclipse.cdt.build.core.settings.holder.symbols.1589314232" name="Symbols" superClass="org.eclipse.cdt.build.core.settings.holder.symbols" valueType="definedSymbols">
|
||||||
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
<listOptionValue builtIn="false" value="__AVR_ATmega168__"/>
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
all:
|
|
||||||
platformio run -t upload
|
|
||||||
|
|
||||||
clean:
|
|
||||||
platformio run -t clean
|
|
@ -6,7 +6,9 @@ platform = atmelavr
|
|||||||
board_mcu = atmega168
|
board_mcu = atmega168
|
||||||
board_f_cpu = 16000000L
|
board_f_cpu = 16000000L
|
||||||
|
|
||||||
upload_port = /dev/tty.SLAB_USBtoUART
|
# Allow autodetection for upload port or uncomment line below
|
||||||
|
# upload_port = /dev/ttyUSB0
|
||||||
# upload_port = COM3
|
# upload_port = COM3
|
||||||
|
|
||||||
upload_protocol = arduino
|
upload_protocol = arduino
|
||||||
upload_speed = 19200
|
upload_speed = 19200
|
||||||
|
@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?fileVersion 4.0.0?>
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
|
||||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
<cconfiguration id="0.1778616297">
|
<cconfiguration id="0.1778616297">
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1778616297" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.1778616297" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
||||||
@ -13,30 +11,36 @@
|
|||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.1778616297" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.1778616297" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
||||||
<folderInfo id="0.1778616297." name="/" resourcePath="">
|
<folderInfo id="0.1778616297." name="/" resourcePath="">
|
||||||
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.576447412" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.576447412" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
||||||
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.576447412.203226592" name=""/>
|
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.576447412.203226592" name=""/>
|
||||||
<builder id="org.eclipse.cdt.build.core.settings.default.builder.592280532" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
<builder cleanBuildTarget="run --target clean" command="platformio" id="org.eclipse.cdt.build.core.settings.default.builder.592280532" incrementalBuildTarget="run" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.251286138" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.251286138" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1824859462" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.1824859462" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.2021826184" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.2021826184" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/timsp430/tools/toolchain/msp430/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-timsp430/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-energiamsp430/cores/msp430""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1509314343" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1509314343" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1251065831" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.1251065831" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1876118829" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1876118829" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/timsp430/tools/toolchain/msp430/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/timsp430/tools/toolchain/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-timsp430/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-energiamsp430/cores/msp430""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.518683230" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.518683230" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.847615484" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.847615484" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1922525168" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1922525168" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/timsp430/tools/toolchain/msp430/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/timsp430/tools/toolchain/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-timsp430/msp430/include""/>
|
||||||
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-energiamsp430/cores/msp430""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.68822385" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.68822385" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
</tool>
|
</tool>
|
||||||
@ -57,5 +61,9 @@
|
|||||||
</scannerConfigBuildInfo>
|
</scannerConfigBuildInfo>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
<storageModule moduleId="org.eclipse.cdt.core.LanguageSettingsProviders"/>
|
||||||
<storageModule moduleId="refreshScope"/>
|
<storageModule moduleId="refreshScope" versionNumber="2">
|
||||||
|
<configuration configurationName="Default">
|
||||||
|
<resource resourceType="PROJECT" workspacePath="/tilaunchpad_msp430g2"/>
|
||||||
|
</configuration>
|
||||||
|
</storageModule>
|
||||||
</cproject>
|
</cproject>
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
all:
|
|
||||||
platformio run -t upload
|
|
||||||
|
|
||||||
clean:
|
|
||||||
platformio run -t clean
|
|
@ -1,7 +1,5 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
<?fileVersion 4.0.0?>
|
<?fileVersion 4.0.0?><cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
||||||
|
|
||||||
<cproject storage_type_id="org.eclipse.cdt.core.XmlProjectDescriptionStorage">
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
||||||
<cconfiguration id="0.18931736">
|
<cconfiguration id="0.18931736">
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.18931736" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
<storageModule buildSystemId="org.eclipse.cdt.managedbuilder.core.configurationDataProvider" id="0.18931736" moduleId="org.eclipse.cdt.core.settings" name="Default">
|
||||||
@ -13,33 +11,34 @@
|
|||||||
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GCCErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GASErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
<extension id="org.eclipse.cdt.core.GLDErrorParser" point="org.eclipse.cdt.core.ErrorParser"/>
|
||||||
|
<extension id="org.eclipse.cdt.core.ELF" point="org.eclipse.cdt.core.BinaryParser"/>
|
||||||
</extensions>
|
</extensions>
|
||||||
</storageModule>
|
</storageModule>
|
||||||
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
<storageModule moduleId="cdtBuildSystem" version="4.0.0">
|
||||||
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.18931736" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
<configuration artifactName="${ProjName}" buildProperties="" description="" id="0.18931736" name="Default" parent="org.eclipse.cdt.build.core.prefbase.cfg">
|
||||||
<folderInfo id="0.18931736." name="/" resourcePath="">
|
<folderInfo id="0.18931736." name="/" resourcePath="">
|
||||||
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.946409409" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
<toolChain id="org.eclipse.cdt.build.core.prefbase.toolchain.946409409" name="No ToolChain" resourceTypeBasedDiscovery="false" superClass="org.eclipse.cdt.build.core.prefbase.toolchain">
|
||||||
<targetPlatform id="org.eclipse.cdt.build.core.prefbase.toolchain.946409409.264614082" name=""/>
|
<targetPlatform binaryParser="org.eclipse.cdt.core.ELF" id="org.eclipse.cdt.build.core.prefbase.toolchain.946409409.264614082" name=""/>
|
||||||
<builder id="org.eclipse.cdt.build.core.settings.default.builder.2099118713" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
<builder cleanBuildTarget="run --target clean" command="platformio" id="org.eclipse.cdt.build.core.settings.default.builder.2099118713" incrementalBuildTarget="run" keepEnvironmentInBuildfile="false" managedBuildOn="false" name="Gnu Make Builder" superClass="org.eclipse.cdt.build.core.settings.default.builder"/>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1860044306" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
<tool id="org.eclipse.cdt.build.core.settings.holder.libs.1860044306" name="holder for library settings" superClass="org.eclipse.cdt.build.core.settings.holder.libs"/>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.490604788" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.490604788" name="Assembly" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1186638432" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1186638432" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/titiva/frameworks/energia/cores/lm4f""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include""/>
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/titiva/tools/toolchain/arm-none-eabi/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-energiativa/cores/lm4f""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1338936035" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1338936035" languageId="org.eclipse.cdt.core.assembly" languageName="Assembly" sourceContentType="org.eclipse.cdt.core.asmSource" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.1620533967" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.1620533967" name="GNU C++" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1007143336" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.1007143336" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/titiva/frameworks/energia/cores/lm4f""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include""/>
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/titiva/tools/toolchain/arm-none-eabi/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-energiativa/cores/lm4f""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.2051673558" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.2051673558" languageId="org.eclipse.cdt.core.g++" languageName="GNU C++" sourceContentType="org.eclipse.cdt.core.cxxSource,org.eclipse.cdt.core.cxxHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
</tool>
|
</tool>
|
||||||
<tool id="org.eclipse.cdt.build.core.settings.holder.549164281" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
<tool id="org.eclipse.cdt.build.core.settings.holder.549164281" name="GNU C" superClass="org.eclipse.cdt.build.core.settings.holder">
|
||||||
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.454536693" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
<option id="org.eclipse.cdt.build.core.settings.holder.incpaths.454536693" name="Include Paths" superClass="org.eclipse.cdt.build.core.settings.holder.incpaths" valueType="includePath">
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/titiva/frameworks/energia/cores/lm4f""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/toolchain-gccarmnoneeabi/arm-none-eabi/include""/>
|
||||||
<listOptionValue builtIn="false" value=""${HOME}/.platformio/titiva/tools/toolchain/arm-none-eabi/include""/>
|
<listOptionValue builtIn="false" value=""${HOME}/.platformio/packages/framework-energiativa/cores/lm4f""/>
|
||||||
</option>
|
</option>
|
||||||
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1468046922" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
<inputType id="org.eclipse.cdt.build.core.settings.holder.inType.1468046922" languageId="org.eclipse.cdt.core.gcc" languageName="GNU C" sourceContentType="org.eclipse.cdt.core.cSource,org.eclipse.cdt.core.cHeader" superClass="org.eclipse.cdt.build.core.settings.holder.inType"/>
|
||||||
</tool>
|
</tool>
|
||||||
|
@ -1,5 +0,0 @@
|
|||||||
all:
|
|
||||||
platformio run -t upload
|
|
||||||
|
|
||||||
clean:
|
|
||||||
platformio run -t clean
|
|
@ -3,9 +3,9 @@
|
|||||||
* See LICENSE for details.
|
* See LICENSE for details.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define false 0
|
#define false 0
|
||||||
#define true 1
|
#define true 1
|
||||||
typedef int bool;
|
typedef int bool;
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include "inc/hw_memmap.h"
|
#include "inc/hw_memmap.h"
|
||||||
@ -16,27 +16,21 @@ typedef int bool;
|
|||||||
#define LED_BLUE GPIO_PIN_2
|
#define LED_BLUE GPIO_PIN_2
|
||||||
#define LED_GREEN GPIO_PIN_3
|
#define LED_GREEN GPIO_PIN_3
|
||||||
|
|
||||||
int main(void)
|
|
||||||
{
|
void setup() {
|
||||||
SysCtlClockSet(
|
SysCtlClockSet(
|
||||||
SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
|
SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN);
|
||||||
|
|
||||||
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
|
SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
|
||||||
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN);
|
GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN);
|
||||||
|
|
||||||
while (1)
|
|
||||||
{
|
|
||||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_RED);
|
|
||||||
SysCtlDelay(3000000);
|
|
||||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_BLUE);
|
|
||||||
SysCtlDelay(3000000);
|
|
||||||
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_GREEN);
|
|
||||||
SysCtlDelay(3000000);
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// hook for Energia main.cpp where these methods are defined
|
|
||||||
void setup() {}
|
void loop() {
|
||||||
void loop() {}
|
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_RED);
|
||||||
|
SysCtlDelay(3000000);
|
||||||
|
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_BLUE);
|
||||||
|
SysCtlDelay(3000000);
|
||||||
|
GPIOPinWrite(GPIO_PORTF_BASE, LED_RED|LED_BLUE|LED_GREEN, LED_GREEN);
|
||||||
|
SysCtlDelay(3000000);
|
||||||
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
VERSION = (0, 9, 0)
|
VERSION = (0, 9, 1)
|
||||||
__version__ = ".".join([str(s) for s in VERSION])
|
__version__ = ".".join([str(s) for s in VERSION])
|
||||||
|
|
||||||
__title__ = "platformio"
|
__title__ = "platformio"
|
||||||
|
@ -29,7 +29,7 @@ def cli(project_dir):
|
|||||||
click.secho(
|
click.secho(
|
||||||
"will be used for the new project.\n"
|
"will be used for the new project.\n"
|
||||||
"You can specify another project directory via\n"
|
"You can specify another project directory via\n"
|
||||||
"`platformio init -d %PATH_TO_PROJECT_DIR%` command.\n",
|
"`platformio init -d %PATH_TO_THE_PROJECT_DIR%` command.\n",
|
||||||
fg="yellow"
|
fg="yellow"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -1,20 +1,20 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from click import argument, command, option, secho
|
import click
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
|
|
||||||
|
|
||||||
@command("install", short_help="Install new platforms")
|
@click.command("install", short_help="Install new platforms")
|
||||||
@argument("platforms", nargs=-1)
|
@click.argument("platforms", nargs=-1)
|
||||||
@option("--with-package", multiple=True, metavar="<package>")
|
@click.option("--with-package", multiple=True, metavar="<package>")
|
||||||
@option("--without-package", multiple=True, metavar="<package>")
|
@click.option("--without-package", multiple=True, metavar="<package>")
|
||||||
@option("--skip-default-package", is_flag=True)
|
@click.option("--skip-default-package", is_flag=True)
|
||||||
def cli(platforms, with_package, without_package, skip_default_package):
|
def cli(platforms, with_package, without_package, skip_default_package):
|
||||||
|
|
||||||
for platform in platforms:
|
for platform in platforms:
|
||||||
p = PlatformFactory().newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
if p.install(with_package, without_package, skip_default_package):
|
if p.install(with_package, without_package, skip_default_package):
|
||||||
secho("The platform '%s' has been successfully installed!" %
|
click.secho("The platform '%s' has been successfully installed!" %
|
||||||
platform, fg="green")
|
platform, fg="green")
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from click import command, echo, style
|
import click
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
|
|
||||||
|
|
||||||
@command("list", short_help="List installed platforms")
|
@click.command("list", short_help="List installed platforms")
|
||||||
def cli():
|
def cli():
|
||||||
|
|
||||||
installed_platforms = PlatformFactory.get_platforms(
|
installed_platforms = PlatformFactory.get_platforms(
|
||||||
@ -14,8 +14,8 @@ def cli():
|
|||||||
installed_platforms.sort()
|
installed_platforms.sort()
|
||||||
|
|
||||||
for platform in installed_platforms:
|
for platform in installed_platforms:
|
||||||
p = PlatformFactory().newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
echo("{name:<20} with packages: {pkgs}".format(
|
click.echo("{name:<20} with packages: {pkgs}".format(
|
||||||
name=style(p.get_name(), fg="cyan"),
|
name=click.style(p.get_name(), fg="cyan"),
|
||||||
pkgs=", ".join(p.get_installed_packages())
|
pkgs=", ".join(p.get_installed_packages())
|
||||||
))
|
))
|
||||||
|
@ -1,66 +1,80 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from click import command, echo, option, secho, style
|
import click
|
||||||
|
|
||||||
from platformio import telemetry
|
from platformio import exception, telemetry
|
||||||
from platformio.exception import (InvalidEnvName, ProjectEnvsNotAvaialable,
|
from platformio.commands.install import cli as cmd_install
|
||||||
UndefinedEnvPlatform, UnknownEnvNames)
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
from platformio.util import get_project_config
|
from platformio.util import get_project_config
|
||||||
|
|
||||||
|
|
||||||
@command("run", short_help="Process project environments")
|
@click.command("run", short_help="Process project environments")
|
||||||
@option("--environment", "-e", multiple=True, metavar="<environment>")
|
@click.option("--environment", "-e", multiple=True, metavar="<environment>")
|
||||||
@option("--target", "-t", multiple=True, metavar="<target>")
|
@click.option("--target", "-t", multiple=True, metavar="<target>")
|
||||||
@option("--upload-port", metavar="<upload port>")
|
@click.option("--upload-port", metavar="<upload port>")
|
||||||
def cli(environment, target, upload_port):
|
@click.pass_context
|
||||||
|
def cli(ctx, environment, target, upload_port):
|
||||||
|
|
||||||
config = get_project_config()
|
config = get_project_config()
|
||||||
|
|
||||||
if not config.sections():
|
if not config.sections():
|
||||||
raise ProjectEnvsNotAvaialable()
|
raise exception.ProjectEnvsNotAvailable()
|
||||||
|
|
||||||
unknown = set(environment) - set([s[4:] for s in config.sections()])
|
unknown = set(environment) - set([s[4:] for s in config.sections()])
|
||||||
if unknown:
|
if unknown:
|
||||||
raise UnknownEnvNames(", ".join(unknown))
|
raise exception.UnknownEnvNames(", ".join(unknown))
|
||||||
|
|
||||||
for section in config.sections():
|
for section in config.sections():
|
||||||
# skip main configuration section
|
# skip main configuration section
|
||||||
if section == "platformio":
|
if section == "platformio":
|
||||||
continue
|
continue
|
||||||
elif section[:4] != "env:":
|
elif section[:4] != "env:":
|
||||||
raise InvalidEnvName(section)
|
raise exception.InvalidEnvName(section)
|
||||||
|
|
||||||
envname = section[4:]
|
envname = section[4:]
|
||||||
if environment and envname not in environment:
|
if environment and envname not in environment:
|
||||||
# echo("Skipped %s environment" % style(envname, fg="yellow"))
|
# echo("Skipped %s environment" % style(envname, fg="yellow"))
|
||||||
continue
|
continue
|
||||||
|
|
||||||
echo("Processing %s environment:" % style(envname, fg="cyan"))
|
click.echo("Processing %s environment:" %
|
||||||
|
click.style(envname, fg="cyan"))
|
||||||
|
|
||||||
variables = ["PIOENV=" + envname]
|
options = {}
|
||||||
if upload_port:
|
|
||||||
variables.append("UPLOAD_PORT=%s" % upload_port)
|
|
||||||
for k, v in config.items(section):
|
for k, v in config.items(section):
|
||||||
k = k.upper()
|
options[k] = v
|
||||||
if k == "TARGETS" or (k == "UPLOAD_PORT" and upload_port):
|
process_environment(ctx, envname, options, target, upload_port)
|
||||||
continue
|
|
||||||
variables.append("%s=%s" % (k.upper(), v))
|
|
||||||
|
|
||||||
envtargets = []
|
|
||||||
if target:
|
|
||||||
envtargets = [t for t in target]
|
|
||||||
elif config.has_option(section, "targets"):
|
|
||||||
envtargets = config.get(section, "targets").split()
|
|
||||||
|
|
||||||
if not config.has_option(section, "platform"):
|
def process_environment(ctx, name, options, targets, upload_port):
|
||||||
raise UndefinedEnvPlatform(envname)
|
variables = ["PIOENV=" + name]
|
||||||
|
if upload_port:
|
||||||
|
variables.append("UPLOAD_PORT=%s" % upload_port)
|
||||||
|
for k, v in options.items():
|
||||||
|
k = k.upper()
|
||||||
|
if k == "TARGETS" or (k == "UPLOAD_PORT" and upload_port):
|
||||||
|
continue
|
||||||
|
variables.append("%s=%s" % (k.upper(), v))
|
||||||
|
|
||||||
telemetry.on_run_environment(config.items(section), envtargets)
|
envtargets = []
|
||||||
|
if targets:
|
||||||
|
envtargets = [t for t in targets]
|
||||||
|
elif "targets" in options:
|
||||||
|
envtargets = options['targets'].split()
|
||||||
|
|
||||||
p = PlatformFactory().newPlatform(config.get(section, "platform"))
|
if "platform" not in options:
|
||||||
result = p.run(variables, envtargets)
|
raise exception.UndefinedEnvPlatform(name)
|
||||||
secho(result['out'], fg="green")
|
platform = options['platform']
|
||||||
secho(result['err'],
|
|
||||||
fg="red" if "Error" in result['err'] else "yellow")
|
telemetry.on_run_environment(options, envtargets)
|
||||||
|
|
||||||
|
if (platform not in PlatformFactory.get_platforms(installed=True) and
|
||||||
|
click.confirm("The platform '%s' has not been installed yet. "
|
||||||
|
"Would you like to install it now?" % platform)):
|
||||||
|
ctx.invoke(cmd_install, platforms=[platform])
|
||||||
|
|
||||||
|
p = PlatformFactory.newPlatform(platform)
|
||||||
|
result = p.run(variables, envtargets)
|
||||||
|
click.secho(result['out'], fg="green")
|
||||||
|
click.secho(result['err'],
|
||||||
|
fg="red" if "Error" in result['err'] else "yellow")
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from click import argument, command, echo, style
|
import click
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
|
|
||||||
|
|
||||||
@command("search", short_help="Search for development platforms")
|
@click.command("search", short_help="Search for development platforms")
|
||||||
@argument("query", required=False)
|
@click.argument("query", required=False)
|
||||||
def cli(query):
|
def cli(query):
|
||||||
for platform in PlatformFactory.get_platforms().keys():
|
for platform in PlatformFactory.get_platforms().keys():
|
||||||
p = PlatformFactory().newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
name = p.get_name()
|
name = p.get_name()
|
||||||
shinfo = p.get_short_info()
|
shinfo = p.get_short_info()
|
||||||
|
|
||||||
@ -21,5 +21,5 @@ def cli(query):
|
|||||||
if query and query.lower() not in search_data.lower():
|
if query and query.lower() not in search_data.lower():
|
||||||
continue
|
continue
|
||||||
|
|
||||||
echo("{name:<20} - {info}".format(name=style(name, fg="cyan"),
|
click.echo("{name:<20} - {info}".format(
|
||||||
info=shinfo))
|
name=click.style(name, fg="cyan"), info=shinfo))
|
||||||
|
@ -3,13 +3,13 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from click import Choice, echo, group, option, secho
|
import click
|
||||||
from serial.tools import miniterm
|
from serial.tools import miniterm
|
||||||
|
|
||||||
from platformio.util import get_serialports
|
from platformio.util import get_serialports
|
||||||
|
|
||||||
|
|
||||||
@group(short_help="List or Monitor Serial ports")
|
@click.group(short_help="List or Monitor Serial ports")
|
||||||
def cli():
|
def cli():
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@ -18,48 +18,49 @@ def cli():
|
|||||||
def serialports_list():
|
def serialports_list():
|
||||||
|
|
||||||
for item in get_serialports():
|
for item in get_serialports():
|
||||||
secho(item['port'], fg="cyan")
|
click.secho(item['port'], fg="cyan")
|
||||||
echo("----------")
|
click.echo("----------")
|
||||||
echo("Hardware ID: %s" % item['hwid'])
|
click.echo("Hardware ID: %s" % item['hwid'])
|
||||||
echo("Description: %s" % item['description'])
|
click.echo("Description: %s" % item['description'])
|
||||||
echo("")
|
click.echo("")
|
||||||
|
|
||||||
|
|
||||||
@cli.command("monitor", short_help="Monitor Serial port")
|
@cli.command("monitor", short_help="Monitor Serial port")
|
||||||
@option("--port", "-p", help="Port, a number or a device name")
|
@click.option("--port", "-p", help="Port, a number or a device name")
|
||||||
@option("--baud", "-b", type=int, default=9600,
|
@click.option("--baud", "-b", type=int, default=9600,
|
||||||
help="Set baud rate, default=9600")
|
help="Set baud rate, default=9600")
|
||||||
@option("--parity", default="N", type=Choice(["N", "E", "O", "S", "M"]),
|
@click.option("--parity", default="N",
|
||||||
help="Set parity, default=N")
|
type=click.Choice(["N", "E", "O", "S", "M"]),
|
||||||
@option("--rtscts", is_flag=True,
|
help="Set parity, default=N")
|
||||||
help="Enable RTS/CTS flow control, default=Off")
|
@click.option("--rtscts", is_flag=True,
|
||||||
@option("--xonxoff", is_flag=True,
|
help="Enable RTS/CTS flow control, default=Off")
|
||||||
help="Enable software flow control, default=Off")
|
@click.option("--xonxoff", is_flag=True,
|
||||||
@option("--rts", default="0", type=Choice(["0", "1"]),
|
help="Enable software flow control, default=Off")
|
||||||
help="Set initial RTS line state, default=0")
|
@click.option("--rts", default="0", type=click.Choice(["0", "1"]),
|
||||||
@option("--dtr", default="0", type=Choice(["0", "1"]),
|
help="Set initial RTS line state, default=0")
|
||||||
help="Set initial DTR line state, default=0")
|
@click.option("--dtr", default="0", type=click.Choice(["0", "1"]),
|
||||||
@option("--echo", is_flag=True,
|
help="Set initial DTR line state, default=0")
|
||||||
help="Enable local echo, default=Off")
|
@click.option("--echo", is_flag=True,
|
||||||
@option("--cr", is_flag=True,
|
help="Enable local echo, default=Off")
|
||||||
help="Do not send CR+LF, send CR only, default=Off")
|
@click.option("--cr", is_flag=True,
|
||||||
@option("--lf", is_flag=True,
|
help="Do not send CR+LF, send CR only, default=Off")
|
||||||
help="Do not send CR+LF, send LF only, default=Off")
|
@click.option("--lf", is_flag=True,
|
||||||
@option("--debug", "-d", count=True,
|
help="Do not send CR+LF, send LF only, default=Off")
|
||||||
help="""Debug received data (escape non-printable chars)
|
@click.option("--debug", "-d", count=True,
|
||||||
|
help="""Debug received data (escape non-printable chars)
|
||||||
# --debug can be given multiple times:
|
# --debug can be given multiple times:
|
||||||
# 0: just print what is received
|
# 0: just print what is received
|
||||||
# 1: escape non-printable characters, do newlines as unusual
|
# 1: escape non-printable characters, do newlines as unusual
|
||||||
# 2: escape non-printable characters, newlines too
|
# 2: escape non-printable characters, newlines too
|
||||||
# 3: hex dump everything""")
|
# 3: hex dump everything""")
|
||||||
@option("--exit-char", type=int, default=0x1d,
|
@click.option("--exit-char", type=int, default=0x1d,
|
||||||
help="ASCII code of special character that is used to exit the "
|
help="ASCII code of special character that is used to exit the "
|
||||||
"application, default=0x1d")
|
"application, default=0x1d")
|
||||||
@option("--menu-char", type=int, default=0x14,
|
@click.option("--menu-char", type=int, default=0x14,
|
||||||
help="ASCII code of special character that is used to control "
|
help="ASCII code of special character that is used to control "
|
||||||
"miniterm (menu), default=0x14")
|
"miniterm (menu), default=0x14")
|
||||||
@option("--quiet", is_flag=True,
|
@click.option("--quiet", is_flag=True,
|
||||||
help="Diagnostics: suppress non-error messages, default=Off")
|
help="Diagnostics: suppress non-error messages, default=Off")
|
||||||
def serialports_monitor(**_):
|
def serialports_monitor(**_):
|
||||||
sys.argv = sys.argv[3:]
|
sys.argv = sys.argv[3:]
|
||||||
try:
|
try:
|
||||||
|
@ -3,35 +3,41 @@
|
|||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
|
||||||
from click import argument, command, echo, style
|
import click
|
||||||
|
|
||||||
|
from platformio.commands.install import cli as cmd_install
|
||||||
from platformio.exception import PlatformNotInstalledYet
|
from platformio.exception import PlatformNotInstalledYet
|
||||||
from platformio.pkgmanager import PackageManager
|
from platformio.pkgmanager import PackageManager
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
|
|
||||||
|
|
||||||
@command("show", short_help="Show details about installed platforms")
|
@click.command("show", short_help="Show details about installed platforms")
|
||||||
@argument("platform")
|
@click.argument("platform")
|
||||||
def cli(platform):
|
@click.pass_context
|
||||||
|
def cli(ctx, platform):
|
||||||
|
|
||||||
installed_platforms = PlatformFactory.get_platforms(
|
installed_platforms = PlatformFactory.get_platforms(
|
||||||
installed=True).keys()
|
installed=True).keys()
|
||||||
|
|
||||||
if platform not in installed_platforms:
|
if platform not in installed_platforms:
|
||||||
raise PlatformNotInstalledYet(platform)
|
if click.confirm("The platform '%s' has not been installed yet. "
|
||||||
|
"Would you like to install it now?" % platform):
|
||||||
|
ctx.invoke(cmd_install, platforms=[platform])
|
||||||
|
else:
|
||||||
|
raise PlatformNotInstalledYet(platform)
|
||||||
|
|
||||||
p = PlatformFactory().newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
echo("{name:<20} - {info}".format(name=style(p.get_name(), fg="cyan"),
|
click.echo("{name:<20} - {info}".format(
|
||||||
info=p.get_short_info()))
|
name=click.style(p.get_name(), fg="cyan"), info=p.get_short_info()))
|
||||||
|
|
||||||
installed_packages = PackageManager.get_installed()
|
installed_packages = PackageManager.get_installed()
|
||||||
for name in p.get_installed_packages():
|
for name in p.get_installed_packages():
|
||||||
data = installed_packages[name]
|
data = installed_packages[name]
|
||||||
pkgalias = p.get_pkg_alias(name)
|
pkgalias = p.get_pkg_alias(name)
|
||||||
echo("----------")
|
click.echo("----------")
|
||||||
echo("Package: %s" % style(name, fg="yellow"))
|
click.echo("Package: %s" % click.style(name, fg="yellow"))
|
||||||
if pkgalias:
|
if pkgalias:
|
||||||
echo("Alias: %s" % pkgalias)
|
click.echo("Alias: %s" % pkgalias)
|
||||||
echo("Version: %d" % int(data['version']))
|
click.echo("Version: %d" % int(data['version']))
|
||||||
echo("Installed: %s" % datetime.fromtimestamp(
|
click.echo("Installed: %s" % datetime.fromtimestamp(
|
||||||
data['time']).strftime("%Y-%m-%d %H:%M:%S"))
|
data['time']).strftime("%Y-%m-%d %H:%M:%S"))
|
||||||
|
@ -1,17 +1,17 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from click import argument, command, secho
|
import click
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
|
|
||||||
|
|
||||||
@command("uninstall", short_help="Uninstall platforms")
|
@click.command("uninstall", short_help="Uninstall platforms")
|
||||||
@argument("platforms", nargs=-1)
|
@click.argument("platforms", nargs=-1)
|
||||||
def cli(platforms):
|
def cli(platforms):
|
||||||
|
|
||||||
for platform in platforms:
|
for platform in platforms:
|
||||||
p = PlatformFactory().newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
if p.uninstall():
|
if p.uninstall():
|
||||||
secho("The platform '%s' has been successfully "
|
click.secho("The platform '%s' has been successfully "
|
||||||
"uninstalled!" % platform, fg="green")
|
"uninstalled!" % platform, fg="green")
|
||||||
|
@ -1,12 +1,12 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from click import command, echo, style
|
import click
|
||||||
|
|
||||||
from platformio.platforms.base import PlatformFactory
|
from platformio.platforms.base import PlatformFactory
|
||||||
|
|
||||||
|
|
||||||
@command("update", short_help="Update installed platforms")
|
@click.command("update", short_help="Update installed platforms")
|
||||||
def cli():
|
def cli():
|
||||||
|
|
||||||
installed_platforms = PlatformFactory.get_platforms(
|
installed_platforms = PlatformFactory.get_platforms(
|
||||||
@ -14,7 +14,7 @@ def cli():
|
|||||||
installed_platforms.sort()
|
installed_platforms.sort()
|
||||||
|
|
||||||
for platform in installed_platforms:
|
for platform in installed_platforms:
|
||||||
echo("\nPlatform %s" % style(platform, fg="cyan"))
|
click.echo("\nPlatform %s" % click.style(platform, fg="cyan"))
|
||||||
echo("--------")
|
click.echo("--------")
|
||||||
p = PlatformFactory().newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
p.update()
|
p.update()
|
||||||
|
@ -1,15 +1,16 @@
|
|||||||
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
# Copyright (C) Ivan Kravets <me@ikravets.com>
|
||||||
# See LICENSE for details.
|
# See LICENSE for details.
|
||||||
|
|
||||||
from click import command, secho
|
import click
|
||||||
from requests import get
|
import requests
|
||||||
|
|
||||||
from platformio import __version__
|
from platformio import __version__
|
||||||
from platformio.exception import GetLatestVersionError
|
from platformio.exception import GetLatestVersionError
|
||||||
from platformio.util import exec_command
|
from platformio.util import exec_command
|
||||||
|
|
||||||
|
|
||||||
@command("upgrade", short_help="Upgrade PlatformIO to the latest version")
|
@click.command("upgrade",
|
||||||
|
short_help="Upgrade PlatformIO to the latest version")
|
||||||
def cli():
|
def cli():
|
||||||
try:
|
try:
|
||||||
last = get_latest_version()
|
last = get_latest_version()
|
||||||
@ -17,14 +18,17 @@ def cli():
|
|||||||
raise GetLatestVersionError()
|
raise GetLatestVersionError()
|
||||||
|
|
||||||
if __version__ == last:
|
if __version__ == last:
|
||||||
return secho("You're up-to-date!\nPlatformIO %s is currently the "
|
return click.secho(
|
||||||
"newest version available." % __version__, fg="green")
|
"You're up-to-date!\nPlatformIO %s is currently the "
|
||||||
|
"newest version available." % __version__, fg="green"
|
||||||
|
)
|
||||||
else:
|
else:
|
||||||
result = exec_command(["pip", "install", "--upgrade", "platformio"])
|
result = exec_command(["pip", "install", "--upgrade", "platformio"])
|
||||||
secho(result['out'], fg="green")
|
click.secho(result['out'], fg="green")
|
||||||
secho(result['err'], fg="red")
|
click.secho(result['err'], fg="red")
|
||||||
|
|
||||||
|
|
||||||
def get_latest_version():
|
def get_latest_version():
|
||||||
pkgdata = get("https://pypi.python.org/pypi/platformio/json").json()
|
pkgdata = requests.get(
|
||||||
|
"https://pypi.python.org/pypi/platformio/json").json()
|
||||||
return pkgdata['info']['version']
|
return pkgdata['info']['version']
|
||||||
|
@ -26,7 +26,8 @@ class PlatformNotInstalledYet(PlatformioException):
|
|||||||
|
|
||||||
class UnknownCLICommand(PlatformioException):
|
class UnknownCLICommand(PlatformioException):
|
||||||
|
|
||||||
MESSAGE = "Unknown command '%s'"
|
MESSAGE = ("Unknown command '%s'. Please use `platformio --help`"
|
||||||
|
" to see all available commands")
|
||||||
|
|
||||||
|
|
||||||
class UnknownPackage(PlatformioException):
|
class UnknownPackage(PlatformioException):
|
||||||
@ -63,7 +64,7 @@ class FDSHASumMismatch(PlatformioException):
|
|||||||
|
|
||||||
class NotPlatformProject(PlatformioException):
|
class NotPlatformProject(PlatformioException):
|
||||||
|
|
||||||
MESSAGE = "Not a PlatformIO project. Use `platformio init` command"
|
MESSAGE = "Not a PlatformIO project (%s). Use `platformio init` command"
|
||||||
|
|
||||||
|
|
||||||
class UndefinedEnvPlatform(PlatformioException):
|
class UndefinedEnvPlatform(PlatformioException):
|
||||||
@ -82,7 +83,7 @@ class ProjectInitialized(PlatformioException):
|
|||||||
"Process it with `platformio run` command")
|
"Process it with `platformio run` command")
|
||||||
|
|
||||||
|
|
||||||
class ProjectEnvsNotAvaialable(PlatformioException):
|
class ProjectEnvsNotAvailable(PlatformioException):
|
||||||
|
|
||||||
MESSAGE = "Please setup environments in `platformio.ini` file."
|
MESSAGE = "Please setup environments in `platformio.ini` file."
|
||||||
|
|
||||||
@ -144,3 +145,12 @@ class InvalidSettingValue(PlatformioException):
|
|||||||
class UpgraderFailed(PlatformioException):
|
class UpgraderFailed(PlatformioException):
|
||||||
|
|
||||||
MESSAGE = "An error occurred while upgrading PlatformIO"
|
MESSAGE = "An error occurred while upgrading PlatformIO"
|
||||||
|
|
||||||
|
|
||||||
|
class SConsNotInstalled(PlatformioException):
|
||||||
|
|
||||||
|
MESSAGE = (
|
||||||
|
"The PlatformIO and `scons` aren't installed properly. "
|
||||||
|
"Please use official installation manual: "
|
||||||
|
"http://docs.platformio.ikravets.com/en/latest/installation.html"
|
||||||
|
)
|
||||||
|
@ -10,8 +10,8 @@ from time import time
|
|||||||
import click
|
import click
|
||||||
|
|
||||||
from platformio import __version__, app, telemetry
|
from platformio import __version__, app, telemetry
|
||||||
from platformio.commands.install import cli as cli_install
|
from platformio.commands.install import cli as cmd_install
|
||||||
from platformio.commands.lib import lib_update as cli_libraries_update
|
from platformio.commands.lib import lib_update as cmd_libraries_update
|
||||||
from platformio.commands.update import cli as cli_platforms_update
|
from platformio.commands.update import cli as cli_platforms_update
|
||||||
from platformio.commands.upgrade import get_latest_version
|
from platformio.commands.upgrade import get_latest_version
|
||||||
from platformio.exception import UpgraderFailed
|
from platformio.exception import UpgraderFailed
|
||||||
@ -75,7 +75,7 @@ class Upgrader(object):
|
|||||||
remove(join(get_home_dir(), fname))
|
remove(join(get_home_dir(), fname))
|
||||||
|
|
||||||
if prev_platforms:
|
if prev_platforms:
|
||||||
ctx.invoke(cli_install, platforms=prev_platforms)
|
ctx.invoke(cmd_install, platforms=prev_platforms)
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
@ -156,7 +156,7 @@ def check_internal_updates(ctx, what):
|
|||||||
outdated_items = []
|
outdated_items = []
|
||||||
if what == "platforms":
|
if what == "platforms":
|
||||||
for platform in PlatformFactory.get_platforms(installed=True).keys():
|
for platform in PlatformFactory.get_platforms(installed=True).keys():
|
||||||
p = PlatformFactory().newPlatform(platform)
|
p = PlatformFactory.newPlatform(platform)
|
||||||
if p.is_outdated():
|
if p.is_outdated():
|
||||||
outdated_items.append(platform)
|
outdated_items.append(platform)
|
||||||
elif what == "libraries":
|
elif what == "libraries":
|
||||||
@ -180,7 +180,7 @@ def check_internal_updates(ctx, what):
|
|||||||
if what == "platforms":
|
if what == "platforms":
|
||||||
ctx.invoke(cli_platforms_update)
|
ctx.invoke(cli_platforms_update)
|
||||||
elif what == "libraries":
|
elif what == "libraries":
|
||||||
ctx.invoke(cli_libraries_update)
|
ctx.invoke(cmd_libraries_update)
|
||||||
click.echo()
|
click.echo()
|
||||||
|
|
||||||
telemetry.on_event(category="Auto", action="Update",
|
telemetry.on_event(category="Auto", action="Update",
|
||||||
|
@ -6,13 +6,11 @@ from os.path import isdir, join
|
|||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
from time import time
|
from time import time
|
||||||
|
|
||||||
from click import echo, secho, style
|
import click
|
||||||
|
|
||||||
from platformio import telemetry
|
from platformio import exception, telemetry
|
||||||
from platformio.app import get_state_item, set_state_item
|
from platformio.app import get_state_item, set_state_item
|
||||||
from platformio.downloader import FileDownloader
|
from platformio.downloader import FileDownloader
|
||||||
from platformio.exception import (InvalidPackageVersion, NonSystemPackage,
|
|
||||||
UnknownPackage)
|
|
||||||
from platformio.unpacker import FileUnpacker
|
from platformio.unpacker import FileUnpacker
|
||||||
from platformio.util import get_api_result, get_home_dir, get_systype
|
from platformio.util import get_api_result, get_home_dir, get_systype
|
||||||
|
|
||||||
@ -62,28 +60,28 @@ class PackageManager(object):
|
|||||||
def get_info(self, name, version=None):
|
def get_info(self, name, version=None):
|
||||||
manifest = self.get_manifest()
|
manifest = self.get_manifest()
|
||||||
if name not in manifest:
|
if name not in manifest:
|
||||||
raise UnknownPackage(name)
|
raise exception.UnknownPackage(name)
|
||||||
|
|
||||||
# check system platform
|
# check system platform
|
||||||
systype = get_systype()
|
systype = get_systype()
|
||||||
builds = ([b for b in manifest[name] if b['system'] == "all" or systype
|
builds = ([b for b in manifest[name] if b['system'] == "all" or systype
|
||||||
in b['system']])
|
in b['system']])
|
||||||
if not builds:
|
if not builds:
|
||||||
raise NonSystemPackage(name, systype)
|
raise exception.NonSystemPackage(name, systype)
|
||||||
|
|
||||||
if version:
|
if version:
|
||||||
for b in builds:
|
for b in builds:
|
||||||
if b['version'] == version:
|
if b['version'] == version:
|
||||||
return b
|
return b
|
||||||
raise InvalidPackageVersion(name, version)
|
raise exception.InvalidPackageVersion(name, version)
|
||||||
else:
|
else:
|
||||||
return sorted(builds, key=lambda s: s['version'])[-1]
|
return sorted(builds, key=lambda s: s['version'])[-1]
|
||||||
|
|
||||||
def install(self, name):
|
def install(self, name):
|
||||||
echo("Installing %s package:" % style(name, fg="cyan"))
|
click.echo("Installing %s package:" % click.style(name, fg="cyan"))
|
||||||
|
|
||||||
if self.is_installed(name):
|
if self.is_installed(name):
|
||||||
secho("Already installed", fg="yellow")
|
click.secho("Already installed", fg="yellow")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
info = self.get_info(name)
|
info = self.get_info(name)
|
||||||
@ -101,36 +99,36 @@ class PackageManager(object):
|
|||||||
category="PackageManager", action="Install", label=name)
|
category="PackageManager", action="Install", label=name)
|
||||||
|
|
||||||
def uninstall(self, name):
|
def uninstall(self, name):
|
||||||
echo("Uninstalling %s package: \t" % style(name, fg="cyan"),
|
click.echo("Uninstalling %s package: \t" %
|
||||||
nl=False)
|
click.style(name, fg="cyan"), nl=False)
|
||||||
|
|
||||||
if not self.is_installed(name):
|
if not self.is_installed(name):
|
||||||
secho("Not installed", fg="yellow")
|
click.secho("Not installed", fg="yellow")
|
||||||
return False
|
return False
|
||||||
|
|
||||||
rmtree(join(self._package_dir, name))
|
rmtree(join(self._package_dir, name))
|
||||||
self._unregister(name)
|
self._unregister(name)
|
||||||
echo("[%s]" % style("OK", fg="green"))
|
click.echo("[%s]" % click.style("OK", fg="green"))
|
||||||
|
|
||||||
# report usage
|
# report usage
|
||||||
telemetry.on_event(
|
telemetry.on_event(
|
||||||
category="PackageManager", action="Uninstall", label=name)
|
category="PackageManager", action="Uninstall", label=name)
|
||||||
|
|
||||||
def update(self, name):
|
def update(self, name):
|
||||||
echo("Updating %s package:" % style(name, fg="yellow"))
|
click.echo("Updating %s package:" % click.style(name, fg="yellow"))
|
||||||
|
|
||||||
installed = self.get_installed()
|
installed = self.get_installed()
|
||||||
current_version = installed[name]['version']
|
current_version = installed[name]['version']
|
||||||
latest_version = self.get_info(name)['version']
|
latest_version = self.get_info(name)['version']
|
||||||
|
|
||||||
echo("Versions: Current=%d, Latest=%d \t " % (
|
click.echo("Versions: Current=%d, Latest=%d \t " %
|
||||||
current_version, latest_version), nl=False)
|
(current_version, latest_version), nl=False)
|
||||||
|
|
||||||
if current_version == latest_version:
|
if current_version == latest_version:
|
||||||
echo("[%s]" % (style("Up-to-date", fg="green")))
|
click.echo("[%s]" % (click.style("Up-to-date", fg="green")))
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
echo("[%s]" % (style("Out-of-date", fg="red")))
|
click.echo("[%s]" % (click.style("Out-of-date", fg="red")))
|
||||||
|
|
||||||
self.uninstall(name)
|
self.uninstall(name)
|
||||||
self.install(name)
|
self.install(name)
|
||||||
|
@ -5,9 +5,8 @@ from imp import load_source
|
|||||||
from os import listdir
|
from os import listdir
|
||||||
from os.path import isdir, isfile, join
|
from os.path import isdir, isfile, join
|
||||||
|
|
||||||
|
from platformio import exception
|
||||||
from platformio.app import get_state_item, set_state_item
|
from platformio.app import get_state_item, set_state_item
|
||||||
from platformio.exception import (BuildScriptNotFound, PlatformNotInstalledYet,
|
|
||||||
UnknownPackage, UnknownPlatform)
|
|
||||||
from platformio.pkgmanager import PackageManager
|
from platformio.pkgmanager import PackageManager
|
||||||
from platformio.util import exec_command, get_home_dir, get_source_dir
|
from platformio.util import exec_command, get_home_dir, get_source_dir
|
||||||
|
|
||||||
@ -25,7 +24,7 @@ class PlatformFactory(object):
|
|||||||
module = load_source(
|
module = load_source(
|
||||||
"platformio.platforms.%s" % name, path)
|
"platformio.platforms.%s" % name, path)
|
||||||
except ImportError:
|
except ImportError:
|
||||||
raise UnknownPlatform(name)
|
raise exception.UnknownPlatform(name)
|
||||||
return module
|
return module
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
@ -47,7 +46,7 @@ class PlatformFactory(object):
|
|||||||
)
|
)
|
||||||
if isplatform:
|
if isplatform:
|
||||||
platforms[name] = path
|
platforms[name] = path
|
||||||
except UnknownPlatform:
|
except exception.UnknownPlatform:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if not installed:
|
if not installed:
|
||||||
@ -63,7 +62,7 @@ class PlatformFactory(object):
|
|||||||
def newPlatform(cls, name):
|
def newPlatform(cls, name):
|
||||||
platforms = cls.get_platforms()
|
platforms = cls.get_platforms()
|
||||||
if name not in platforms:
|
if name not in platforms:
|
||||||
raise UnknownPlatform(name)
|
raise exception.UnknownPlatform(name)
|
||||||
|
|
||||||
_instance = getattr(
|
_instance = getattr(
|
||||||
cls.load_module(name, platforms[name]),
|
cls.load_module(name, platforms[name]),
|
||||||
@ -123,7 +122,7 @@ class BasePlatform(object):
|
|||||||
upkgs = with_packages | without_packages
|
upkgs = with_packages | without_packages
|
||||||
ppkgs = set(self.get_packages().keys())
|
ppkgs = set(self.get_packages().keys())
|
||||||
if not upkgs.issubset(ppkgs):
|
if not upkgs.issubset(ppkgs):
|
||||||
raise UnknownPackage(", ".join(upkgs - ppkgs))
|
raise exception.UnknownPackage(", ".join(upkgs - ppkgs))
|
||||||
|
|
||||||
requirements = []
|
requirements = []
|
||||||
for name, opts in self.get_packages().items():
|
for name, opts in self.get_packages().items():
|
||||||
@ -151,13 +150,13 @@ class BasePlatform(object):
|
|||||||
installed=True).keys()
|
installed=True).keys()
|
||||||
|
|
||||||
if platform not in installed_platforms:
|
if platform not in installed_platforms:
|
||||||
raise PlatformNotInstalledYet(platform)
|
raise exception.PlatformNotInstalledYet(platform)
|
||||||
|
|
||||||
deppkgs = set()
|
deppkgs = set()
|
||||||
for item in installed_platforms:
|
for item in installed_platforms:
|
||||||
if item == platform:
|
if item == platform:
|
||||||
continue
|
continue
|
||||||
p = PlatformFactory().newPlatform(item)
|
p = PlatformFactory.newPlatform(item)
|
||||||
deppkgs = deppkgs.union(set(p.get_packages().keys()))
|
deppkgs = deppkgs.union(set(p.get_packages().keys()))
|
||||||
|
|
||||||
pm = PackageManager()
|
pm = PackageManager()
|
||||||
@ -191,7 +190,7 @@ class BasePlatform(object):
|
|||||||
installed_packages = PackageManager.get_installed()
|
installed_packages = PackageManager.get_installed()
|
||||||
|
|
||||||
if self.get_name() not in installed_platforms:
|
if self.get_name() not in installed_platforms:
|
||||||
raise PlatformNotInstalledYet(self.get_name())
|
raise exception.PlatformNotInstalledYet(self.get_name())
|
||||||
|
|
||||||
if "clean" in targets:
|
if "clean" in targets:
|
||||||
targets.remove("clean")
|
targets.remove("clean")
|
||||||
@ -205,20 +204,23 @@ class BasePlatform(object):
|
|||||||
continue
|
continue
|
||||||
_, path = v.split("=", 2)
|
_, path = v.split("=", 2)
|
||||||
if not isfile(path):
|
if not isfile(path):
|
||||||
raise BuildScriptNotFound(path)
|
raise exception.BuildScriptNotFound(path)
|
||||||
|
|
||||||
# append aliases of installed packages
|
# append aliases of the installed packages
|
||||||
for name, options in self.get_packages().items():
|
for name, options in self.get_packages().items():
|
||||||
if name not in installed_packages:
|
if name not in installed_packages:
|
||||||
continue
|
continue
|
||||||
variables.append(
|
variables.append(
|
||||||
"PIOPACKAGE_%s=%s" % (options['alias'].upper(), name))
|
"PIOPACKAGE_%s=%s" % (options['alias'].upper(), name))
|
||||||
|
|
||||||
result = exec_command([
|
try:
|
||||||
"scons",
|
result = exec_command([
|
||||||
"-Q",
|
"scons",
|
||||||
"-f", join(get_source_dir(), "builder", "main.py")
|
"-Q",
|
||||||
] + variables + targets)
|
"-f", join(get_source_dir(), "builder", "main.py")
|
||||||
|
] + variables + targets)
|
||||||
|
except OSError:
|
||||||
|
raise exception.SConsNotInstalled()
|
||||||
|
|
||||||
return self.after_run(result)
|
return self.after_run(result)
|
||||||
|
|
||||||
|
@ -101,7 +101,7 @@ class MeasurementProtocol(TelemetryBase):
|
|||||||
if not args:
|
if not args:
|
||||||
return
|
return
|
||||||
|
|
||||||
if args[0] in ("lib", "settings"):
|
if args[0] in ("lib", "serialports", "settings"):
|
||||||
cmd_path = args[:2]
|
cmd_path = args[:2]
|
||||||
else:
|
else:
|
||||||
cmd_path = args[:1]
|
cmd_path = args[:1]
|
||||||
@ -135,9 +135,9 @@ def on_command(ctx): # pylint: disable=W0613
|
|||||||
|
|
||||||
|
|
||||||
def on_run_environment(options, targets):
|
def on_run_environment(options, targets):
|
||||||
opts = ["%s=%s" % (opt, value) for opt, value in sorted(options)]
|
opts = ["%s=%s" % (opt, value) for opt, value in sorted(options.items())]
|
||||||
targets = [t.title() for t in targets or ["run"]]
|
targets = [t.title() for t in targets or ["run"]]
|
||||||
on_event("Env", " ".join(targets), " ".join(opts))
|
on_event("Env", " ".join(targets), "&".join(opts))
|
||||||
|
|
||||||
|
|
||||||
def on_event(category, action, label=None, value=None, screen_name=None):
|
def on_event(category, action, label=None, value=None, screen_name=None):
|
||||||
|
@ -22,8 +22,6 @@ except ImportError:
|
|||||||
|
|
||||||
|
|
||||||
def get_systype():
|
def get_systype():
|
||||||
if system() == "Windows":
|
|
||||||
return "windows"
|
|
||||||
data = uname()
|
data = uname()
|
||||||
return ("%s_%s" % (data[0], data[4])).lower()
|
return ("%s_%s" % (data[0], data[4])).lower()
|
||||||
|
|
||||||
@ -79,7 +77,7 @@ def get_pioenvs_dir():
|
|||||||
def get_project_config():
|
def get_project_config():
|
||||||
path = join(get_project_dir(), "platformio.ini")
|
path = join(get_project_dir(), "platformio.ini")
|
||||||
if not isfile(path):
|
if not isfile(path):
|
||||||
raise NotPlatformProject()
|
raise NotPlatformProject(get_project_dir())
|
||||||
cp = ConfigParser()
|
cp = ConfigParser()
|
||||||
cp.read(path)
|
cp.read(path)
|
||||||
return cp
|
return cp
|
||||||
@ -128,8 +126,7 @@ def get_api_result(path, params=None, data=None):
|
|||||||
if path == "/packages":
|
if path == "/packages":
|
||||||
r = requests.get(
|
r = requests.get(
|
||||||
"https://sourceforge.net/projects/platformio-storage/files/"
|
"https://sourceforge.net/projects/platformio-storage/files/"
|
||||||
"packages/manifest.json/download",
|
"packages/manifest.json", params=params, headers=headers)
|
||||||
params=params, headers=headers)
|
|
||||||
elif data:
|
elif data:
|
||||||
r = requests.post(__apiurl__ + path, params=params, data=data,
|
r = requests.post(__apiurl__ + path, params=params, data=data,
|
||||||
headers=headers)
|
headers=headers)
|
||||||
|
Reference in New Issue
Block a user