forked from platformio/platformio-core
Merge branch 'develop' into feature/platformio-30
* develop: Update docs for Teensy USB Features // Issue #722 Implement Teensy 2.0 USB functionality (HID, SERIAL_HID, DISK, MIDI, etc.) // Resolve #722 Add support for Pinoccio Scout board // Resolve #52 Fix broken LD Script for Element14 chipKIT Pi board // Resolve #725 Resolve #726 Fix USB flags processing for teensy platform // Issue #722 Add Pinoccio board // Issue #52 Minor improvements for CLion docs Improved docs for integration with CLion IDE Version bump to 2.11.1 (issues #472, #629, #710, #711, #712, #713, #718) Typo fix Add "udev" rules for OpenOCD CMSIS-DAP adapters // Resolve #718 Update history Ignore "[platformio]" section from custom project configuration CI Bump to 2.11.1b1 Add Arduino M0 Pro and Tian to the examples // Issue #472 Fix issue when `pioenvs` folder doesn't exist Add more info about `.pioenvs` directory Improve CMSIS selection for SAMD21 boards Improve support for SAMD21 based boards Add contributing guidelines
This commit is contained in:
21
CONTRIBUTING.md
Normal file
21
CONTRIBUTING.md
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
Contributing
|
||||||
|
------------
|
||||||
|
|
||||||
|
To get started, <a href="https://www.clahub.com/agreements/platformio/platformio">sign the Contributor License Agreement</a>.
|
||||||
|
|
||||||
|
1. Fork the repository on GitHub.
|
||||||
|
2. Make a branch off of ``develop``
|
||||||
|
3. Run ``pip install tox``
|
||||||
|
4. Go to the root of project where is located ``tox.ini`` and run ``tox -e develop``
|
||||||
|
5. Activate current development environment:
|
||||||
|
|
||||||
|
* Windows: ``.tox\develop\Scripts\activate``
|
||||||
|
* Bash/ZSH: ``source .tox/develop/bin/activate``
|
||||||
|
* Fish: ``source .tox/bin/activate.fish``
|
||||||
|
|
||||||
|
6. Make changes to code, documentation, etc.
|
||||||
|
7. Lint source code ``tox -e lint``
|
||||||
|
8. Run the tests ``tox -e py27``
|
||||||
|
9. Build documentation ``tox -e docs`` (creates a directory _build under docs where you can find the html)
|
||||||
|
10. Commit changes to your forked repository
|
||||||
|
11. Submit a Pull Request on GitHub.
|
20
HISTORY.rst
20
HISTORY.rst
@ -38,17 +38,35 @@ PlatformIO 3.0
|
|||||||
PlatformIO 2.0
|
PlatformIO 2.0
|
||||||
--------------
|
--------------
|
||||||
|
|
||||||
2.11.1 (2016-??-??)
|
2.11.2 (2016-??-??)
|
||||||
~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Added support for Pinoccio Scout board
|
||||||
|
(`issue #52 <https://github.com/platformio/platformio/issues/52>`_)
|
||||||
|
* Added support for `Teensy USB Features <http://docs.platformio.org/en/latest/platforms/teensy.html#usb-features>`__
|
||||||
|
(HID, SERIAL_HID, DISK, DISK_SDFLASH, MIDI, etc.)
|
||||||
|
(`issue #722 <https://github.com/platformio/platformio/issues/722>`_)
|
||||||
|
* Fixed broken LD Script for Element14 chipKIT Pi board
|
||||||
|
(`issue #725 <https://github.com/platformio/platformio/issues/725>`_)
|
||||||
|
|
||||||
|
2.11.1 (2016-07-12)
|
||||||
|
~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
* Added support for Arduino M0, M0 Pro and Tian boards
|
||||||
|
(`issue #472 <https://github.com/platformio/platformio/issues/472>`_)
|
||||||
* Added support for Microchip chipKIT Lenny board
|
* Added support for Microchip chipKIT Lenny board
|
||||||
* Updated Microchip PIC32 Arduino framework to v1.2.1
|
* Updated Microchip PIC32 Arduino framework to v1.2.1
|
||||||
* Documented `uploading of EEPROM data <http://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-eeprom-data>`__
|
* Documented `uploading of EEPROM data <http://docs.platformio.org/en/latest/platforms/atmelavr.html#upload-eeprom-data>`__
|
||||||
(from EEMEM directive)
|
(from EEMEM directive)
|
||||||
* Added ``Rebuild C/C++ Project Index`` target to CLion and Eclipse IDEs
|
* Added ``Rebuild C/C++ Project Index`` target to CLion and Eclipse IDEs
|
||||||
* Improved project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__
|
* Improved project generator for `CLion IDE <http://docs.platformio.org/en/latest/ide/clion.html>`__
|
||||||
|
* Added ``udev`` rules for OpenOCD CMSIS-DAP adapters
|
||||||
|
(`issue #718 <https://github.com/platformio/platformio/issues/718>`_)
|
||||||
* Auto-remove project cache when PlatformIO is upgraded
|
* Auto-remove project cache when PlatformIO is upgraded
|
||||||
* Keep user changes for ``.gitignore`` file when re-generate/update project data
|
* Keep user changes for ``.gitignore`` file when re-generate/update project data
|
||||||
|
* Ignore ``[platformio]`` section from custom project configuration file when
|
||||||
|
`platformio ci --project-conf <http://docs.platformio.org/en/latest/userguide/cmd_ci.html>`__
|
||||||
|
command is used
|
||||||
* Fixed missed ``--boot`` flag for the firmware uploader for ATSAM3X8E
|
* Fixed missed ``--boot`` flag for the firmware uploader for ATSAM3X8E
|
||||||
Cortex-M3 MCU based boards (Arduino Due, etc)
|
Cortex-M3 MCU based boards (Arduino Due, etc)
|
||||||
(`issue #710 <https://github.com/platformio/platformio/issues/710>`_)
|
(`issue #710 <https://github.com/platformio/platformio/issues/710>`_)
|
||||||
|
21
README.rst
21
README.rst
@ -185,27 +185,12 @@ For further details, please refer to `What is PlatformIO? <http://docs.platformi
|
|||||||
Contributing
|
Contributing
|
||||||
------------
|
------------
|
||||||
|
|
||||||
1. Fork the repository on GitHub.
|
See `contributing guidelines <https://github.com/platformio/platformio/blob/develop/CONTRIBUTING.md>`_.
|
||||||
2. Make a branch off of ``develop``
|
|
||||||
3. Run ``pip install tox``
|
|
||||||
4. Go to the root of project where is located ``tox.ini`` and run ``tox -e develop``
|
|
||||||
5. Activate current development environment:
|
|
||||||
|
|
||||||
* Windows: ``.tox\develop\Scripts\activate``
|
License
|
||||||
* Bash/ZSH: ``source .tox/develop/bin/activate``
|
|
||||||
* Fish: ``source .tox/bin/activate.fish``
|
|
||||||
|
|
||||||
6. Make changes to code, documentation, etc.
|
|
||||||
7. Lint source code ``tox -e lint``
|
|
||||||
8. Run the tests ``tox -e py27``
|
|
||||||
9. Build documentation ``tox -e docs`` (creates a directory _build under docs where you can find the html)
|
|
||||||
10. Commit changes to your forked repository
|
|
||||||
11. Submit a Pull Request on GitHub.
|
|
||||||
|
|
||||||
Licence
|
|
||||||
-------
|
-------
|
||||||
|
|
||||||
Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
Copyright 2014-2016 Ivan Kravets <me@ikravets.com>
|
||||||
|
|
||||||
The PlatformIO is licensed under the permissive Apache 2.0 licence,
|
The PlatformIO is licensed under the permissive Apache 2.0 license,
|
||||||
so you can use it in both commercial and personal projects with confidence.
|
so you can use it in both commercial and personal projects with confidence.
|
||||||
|
@ -1341,6 +1341,26 @@ PanStamp
|
|||||||
- 32 Kb
|
- 32 Kb
|
||||||
- 4 Kb
|
- 4 Kb
|
||||||
|
|
||||||
|
Pinoccio
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
|
||||||
|
* - Type ``board``
|
||||||
|
- Name
|
||||||
|
- Microcontroller
|
||||||
|
- Frequency
|
||||||
|
- Flash
|
||||||
|
- RAM
|
||||||
|
|
||||||
|
* - ``pinoccio``
|
||||||
|
- `Pinoccio Scout <https://www.crowdsupply.com/pinoccio/mesh-sensor-network>`_
|
||||||
|
- ATMEGA256RFR2
|
||||||
|
- 16 MHz
|
||||||
|
- 256 Kb
|
||||||
|
- 32 Kb
|
||||||
|
|
||||||
Punch Through
|
Punch Through
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -43,12 +43,17 @@ command and generate project via :option:`platformio init --ide` command:
|
|||||||
|
|
||||||
Then:
|
Then:
|
||||||
|
|
||||||
1. Place source files (``*.c, *.cpp, *.h, *.ino, etc.``) to ``src`` directory
|
1. Place source files (``*.c, *.cpp, *.h, *.hpp``) to ``src`` directory
|
||||||
2. Import this project via ``Menu: File > Import Project``
|
2. Import this project via ``Menu: File > Import Project``
|
||||||
and specify root directory where is located :ref:`projectconf`
|
and specify root directory where is located :ref:`projectconf`
|
||||||
3. Open source file from ``src`` directory
|
3. Open source file from ``src`` directory
|
||||||
4. Build project (*DO NOT RUN*): ``Menu: Run > Build``.
|
4. Build project (*DO NOT RUN*): ``Menu: Run > Build``.
|
||||||
|
|
||||||
|
.. warning::
|
||||||
|
|
||||||
|
See know issue: :ref:`ide_clion_knownissues_inopde_not_supported` and how
|
||||||
|
to resolve it.
|
||||||
|
|
||||||
There are 6 predefined targets for building (*NOT FOR RUNNING*, see marks on
|
There are 6 predefined targets for building (*NOT FOR RUNNING*, see marks on
|
||||||
the screenshot below):
|
the screenshot below):
|
||||||
|
|
||||||
@ -68,6 +73,65 @@ the screenshot below):
|
|||||||
after generating process wont be reflected in IDE. To fix it please run
|
after generating process wont be reflected in IDE. To fix it please run
|
||||||
``PLATFORMIO_REBUILD_PROJECT_INDEX`` target.
|
``PLATFORMIO_REBUILD_PROJECT_INDEX`` target.
|
||||||
|
|
||||||
|
Known issues
|
||||||
|
------------
|
||||||
|
|
||||||
|
.. _ide_clion_knownissues_inopde_not_supported:
|
||||||
|
|
||||||
|
Arduino ``.ino`` files are not supported
|
||||||
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
CLion uses "CMake" tool for code completion and code linting. As result, it
|
||||||
|
doesn't support Arduino files (``*.ino`` and ``.pde``) because they are
|
||||||
|
not valid C/C++ based source files:
|
||||||
|
|
||||||
|
1. Missing includes such as ``#include <Arduino.h>``
|
||||||
|
2. Function declarations are omitted.
|
||||||
|
|
||||||
|
Convert Arduino file to C++ manually
|
||||||
|
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
|
For example, we have the next ``Demo.ino`` file:
|
||||||
|
|
||||||
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
void function setup () {
|
||||||
|
someFunction(13);
|
||||||
|
}
|
||||||
|
|
||||||
|
void function loop() {
|
||||||
|
delay(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
void someFunction(int num) {
|
||||||
|
}
|
||||||
|
|
||||||
|
Let's convert it to ``Demo.cpp``:
|
||||||
|
|
||||||
|
1. Add ``#include <Arduino.h>`` at the top of the source file
|
||||||
|
2. Declare each custom function (excluding built-in, such as ``setup`` and ``loop``)
|
||||||
|
before it will be called.
|
||||||
|
|
||||||
|
The final ``Demo.cpp``:
|
||||||
|
|
||||||
|
.. code-block:: cpp
|
||||||
|
|
||||||
|
#include <Arduino.h>
|
||||||
|
|
||||||
|
void someFunction(int num);
|
||||||
|
|
||||||
|
void function setup () {
|
||||||
|
someFunction(13);
|
||||||
|
}
|
||||||
|
|
||||||
|
void function loop() {
|
||||||
|
delay(1000);
|
||||||
|
}
|
||||||
|
|
||||||
|
void someFunction(int num) {
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Articles / Manuals
|
Articles / Manuals
|
||||||
------------------
|
------------------
|
||||||
|
|
||||||
@ -81,6 +145,6 @@ Examples
|
|||||||
--------
|
--------
|
||||||
|
|
||||||
"Blink" Project
|
"Blink" Project
|
||||||
^^^^^^^^^^^^^^^
|
~~~~~~~~~~~~~~~
|
||||||
|
|
||||||
Source code of `CLion "Blink" Project <https://github.com/platformio/platformio-examples/tree/develop/ide/clion>`_.
|
Source code of `CLion "Blink" Project <https://github.com/platformio/platformio-examples/tree/develop/ide/clion>`_.
|
||||||
|
@ -842,6 +842,26 @@ PanStamp
|
|||||||
- 32 Kb
|
- 32 Kb
|
||||||
- 2 Kb
|
- 2 Kb
|
||||||
|
|
||||||
|
Pinoccio
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
|
||||||
|
* - Type ``board``
|
||||||
|
- Name
|
||||||
|
- Microcontroller
|
||||||
|
- Frequency
|
||||||
|
- Flash
|
||||||
|
- RAM
|
||||||
|
|
||||||
|
* - ``pinoccio``
|
||||||
|
- `Pinoccio Scout <https://www.crowdsupply.com/pinoccio/mesh-sensor-network>`_
|
||||||
|
- ATMEGA256RFR2
|
||||||
|
- 16 MHz
|
||||||
|
- 256 Kb
|
||||||
|
- 32 Kb
|
||||||
|
|
||||||
Punch Through
|
Punch Through
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -1726,6 +1726,26 @@ PanStamp
|
|||||||
- 32 Kb
|
- 32 Kb
|
||||||
- 4 Kb
|
- 4 Kb
|
||||||
|
|
||||||
|
Pinoccio
|
||||||
|
~~~~~~~~
|
||||||
|
|
||||||
|
.. list-table::
|
||||||
|
:header-rows: 1
|
||||||
|
|
||||||
|
* - Type ``board``
|
||||||
|
- Name
|
||||||
|
- Microcontroller
|
||||||
|
- Frequency
|
||||||
|
- Flash
|
||||||
|
- RAM
|
||||||
|
|
||||||
|
* - ``pinoccio``
|
||||||
|
- `Pinoccio Scout <https://www.crowdsupply.com/pinoccio/mesh-sensor-network>`_
|
||||||
|
- ATMEGA256RFR2
|
||||||
|
- 16 MHz
|
||||||
|
- 256 Kb
|
||||||
|
- 32 Kb
|
||||||
|
|
||||||
Punch Through
|
Punch Through
|
||||||
~~~~~~~~~~~~~
|
~~~~~~~~~~~~~
|
||||||
|
|
||||||
|
@ -9,6 +9,33 @@
|
|||||||
See the License for the specific language governing permissions and
|
See the License for the specific language governing permissions and
|
||||||
limitations under the License.
|
limitations under the License.
|
||||||
|
|
||||||
|
USB Features
|
||||||
|
------------
|
||||||
|
|
||||||
|
If you want to use Teensy USB Features, you need to add special
|
||||||
|
acros/define using :ref:`projectconf_build_flags`:
|
||||||
|
|
||||||
|
* ``-D USB_HID``
|
||||||
|
* ``-D USB_SERIAL_HID``
|
||||||
|
* ``-D USB_DISK``
|
||||||
|
* ``-D USB_DISK_SDFLASH``
|
||||||
|
* ``-D USB_MIDI``
|
||||||
|
* ``-D USB_RAWHID``
|
||||||
|
* ``-D USB_FLIGHTSIM``
|
||||||
|
* ``-D USB_DISABLED``
|
||||||
|
|
||||||
|
Example:
|
||||||
|
|
||||||
|
.. code-block:: ini
|
||||||
|
|
||||||
|
[env:teensy_hid_device]
|
||||||
|
platform = teensy
|
||||||
|
framework = arduino
|
||||||
|
board = teensy20
|
||||||
|
build_flags = -D USB_RAWHID
|
||||||
|
|
||||||
|
See `Teensy USB Examples <https://www.pjrc.com/teensy/usb_debug_only.html>`_.
|
||||||
|
|
||||||
Examples
|
Examples
|
||||||
--------
|
--------
|
||||||
|
|
||||||
|
@ -97,7 +97,11 @@ This option can be overridden by global environment variable
|
|||||||
``envs_dir``
|
``envs_dir``
|
||||||
^^^^^^^^^^^^
|
^^^^^^^^^^^^
|
||||||
|
|
||||||
This is a cache directory. *PlatformIO Build System* uses this folder for project
|
.. warning::
|
||||||
|
**PLEASE DO NOT EDIT FILES IN THIS FOLDER**. PlatformIO will overwrite
|
||||||
|
your changes on the next build. **THIS IS A CACHE DIRECTORY**.
|
||||||
|
|
||||||
|
*PlatformIO Build System* uses this folder for project
|
||||||
environments to store compiled object files, static libraries, firmwares and
|
environments to store compiled object files, static libraries, firmwares and
|
||||||
other cached information. It allows PlatformIO to build source code extremely
|
other cached information. It allows PlatformIO to build source code extremely
|
||||||
fast!
|
fast!
|
||||||
|
2
examples
2
examples
Submodule examples updated: 6c0a7e4458...a657ca4225
@ -39,15 +39,12 @@ def FlushSerialBuffer(env, port):
|
|||||||
def TouchSerialPort(env, port, baudrate):
|
def TouchSerialPort(env, port, baudrate):
|
||||||
port = env.subst(port)
|
port = env.subst(port)
|
||||||
print "Forcing reset using %dbps open/close on port %s" % (baudrate, port)
|
print "Forcing reset using %dbps open/close on port %s" % (baudrate, port)
|
||||||
if system() != "Windows":
|
try:
|
||||||
try:
|
s = Serial(port=port, baudrate=baudrate)
|
||||||
s = Serial(port)
|
s.setDTR(False)
|
||||||
s.close()
|
s.close()
|
||||||
except: # pylint: disable=W0702
|
except: # pylint: disable=W0702
|
||||||
pass
|
pass
|
||||||
s = Serial(port=port, baudrate=baudrate)
|
|
||||||
s.setDTR(False)
|
|
||||||
s.close()
|
|
||||||
sleep(0.4)
|
sleep(0.4)
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +27,12 @@ from platformio.commands.init import validate_boards
|
|||||||
from platformio.commands.run import cli as cmd_run
|
from platformio.commands.run import cli as cmd_run
|
||||||
from platformio.exception import CIBuildEnvsEmpty
|
from platformio.exception import CIBuildEnvsEmpty
|
||||||
|
|
||||||
|
# pylint: disable=wrong-import-order
|
||||||
|
try:
|
||||||
|
from configparser import ConfigParser
|
||||||
|
except ImportError:
|
||||||
|
from ConfigParser import ConfigParser
|
||||||
|
|
||||||
|
|
||||||
def validate_path(ctx, param, value): # pylint: disable=W0613
|
def validate_path(ctx, param, value): # pylint: disable=W0613
|
||||||
invalid_path = None
|
invalid_path = None
|
||||||
@ -81,7 +87,7 @@ def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913
|
|||||||
_copy_contents(join(build_dir, dir_name), contents)
|
_copy_contents(join(build_dir, dir_name), contents)
|
||||||
|
|
||||||
if project_conf and isfile(project_conf):
|
if project_conf and isfile(project_conf):
|
||||||
copyfile(project_conf, join(build_dir, "platformio.ini"))
|
_copy_project_conf(build_dir, project_conf)
|
||||||
elif not board:
|
elif not board:
|
||||||
raise CIBuildEnvsEmpty()
|
raise CIBuildEnvsEmpty()
|
||||||
|
|
||||||
@ -147,3 +153,12 @@ def _exclude_contents(dst_dir, patterns):
|
|||||||
rmtree(path)
|
rmtree(path)
|
||||||
elif isfile(path):
|
elif isfile(path):
|
||||||
remove(path)
|
remove(path)
|
||||||
|
|
||||||
|
|
||||||
|
def _copy_project_conf(build_dir, project_conf):
|
||||||
|
cp = ConfigParser()
|
||||||
|
cp.read(project_conf)
|
||||||
|
if cp.has_section("platformio"):
|
||||||
|
cp.remove_section("platformio")
|
||||||
|
with open(join(build_dir, "platformio.ini"), "w") as fp:
|
||||||
|
cp.write(fp)
|
||||||
|
@ -220,10 +220,20 @@ def get_projectlib_dir():
|
|||||||
|
|
||||||
|
|
||||||
def get_pioenvs_dir():
|
def get_pioenvs_dir():
|
||||||
return _get_projconf_option_dir(
|
path = _get_projconf_option_dir(
|
||||||
"envs_dir",
|
"envs_dir",
|
||||||
join(get_project_dir(), ".pioenvs")
|
join(get_project_dir(), ".pioenvs")
|
||||||
)
|
)
|
||||||
|
if not isdir(path):
|
||||||
|
os.makedirs(path)
|
||||||
|
dontmod_path = join(path, "do-not-modify-files-here.url")
|
||||||
|
if not isfile(dontmod_path):
|
||||||
|
with open(dontmod_path, "w") as fp:
|
||||||
|
fp.write("""
|
||||||
|
[InternetShortcut]
|
||||||
|
URL=http://docs.platformio.org/en/latest/projectconf.html#envs-dir
|
||||||
|
""")
|
||||||
|
return path
|
||||||
|
|
||||||
|
|
||||||
def get_projectdata_dir():
|
def get_projectdata_dir():
|
||||||
|
@ -76,3 +76,6 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666
|
|||||||
|
|
||||||
#TI MSP430 Launchpad
|
#TI MSP430 Launchpad
|
||||||
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0666"
|
SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0666"
|
||||||
|
|
||||||
|
# CMSIS-DAP compatible adapters
|
||||||
|
ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev"
|
||||||
|
Reference in New Issue
Block a user