From 581fd356cd77dbb56b2510e7bf2f926e80e5ba11 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sun, 10 Jul 2016 19:15:55 +0300 Subject: [PATCH 01/20] Add contributing guidelines --- CONTRIBUTING.md | 21 +++++++++++++++++++++ README.rst | 17 +---------------- 2 files changed, 22 insertions(+), 16 deletions(-) create mode 100644 CONTRIBUTING.md diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000000..e46d388ced --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,21 @@ +Contributing +------------ + +To get started, sign the Contributor License Agreement. + +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. diff --git a/README.rst b/README.rst index 391214f2bc..44ad2e5b4f 100644 --- a/README.rst +++ b/README.rst @@ -185,22 +185,7 @@ For further details, please refer to `What is PlatformIO? `_. Licence ------- From 3984f80baee847d63a825a4ad893f22847844045 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Mon, 11 Jul 2016 19:12:10 +0300 Subject: [PATCH 02/20] Improve support for SAMD21 based boards --- platformio/boards/arduino.json | 36 +++++++++---------- .../builder/scripts/frameworks/arduino.py | 12 +++++-- platformio/builder/tools/pioupload.py | 15 ++++---- 3 files changed, 32 insertions(+), 31 deletions(-) diff --git a/platformio/boards/arduino.json b/platformio/boards/arduino.json index e5ac7c2500..45c2ffef6a 100644 --- a/platformio/boards/arduino.json +++ b/platformio/boards/arduino.json @@ -958,17 +958,17 @@ }, "mzeropro": { "build": { - "core": "arduino_zero", + "core": "arduino_zero_org", "extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__", "f_cpu": "48000000L", "mcu": "samd21g18a", "cpu": "cortex-m0plus", "usb_product": "Arduino M0 Pro", - "variant": "arduino_zero", + "variant": "arduino_zero_org", "ldscript": "samd21g18a_bootloader_org.ld", "hwids": [ - ["0x03EB", "0x2111"], - ["0x2A03", "0x804F"] + ["0x2A03", "0x804F"], + ["0x03EB", "0x2111"] ] }, "frameworks": ["arduino"], @@ -989,19 +989,17 @@ }, "mzeroproUSB": { "build": { - "core": "arduino_zero", + "core": "arduino_zero_org", "extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__", "f_cpu": "48000000L", "mcu": "samd21g18a", "cpu": "cortex-m0plus", "usb_product": "Arduino M0 Pro", - "variant": "arduino_zero", + "variant": "arduino_zero_org", "ldscript": "samd21g18a_bootloader_org.ld", "hwids": [ - ["0x2A03", "0x004D"], - ["0x2A03", "0x804D"], - ["0x2A03", "0x004F"], - ["0x2A03", "0x804F"] + ["0x2A03", "0x804F"], + ["0x2A03", "0x004F"] ] }, "frameworks": ["arduino"], @@ -1023,19 +1021,17 @@ }, "mzeroUSB": { "build": { - "core": "arduino_zero", + "core": "arduino_zero_org", "extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__", "f_cpu": "48000000L", "mcu": "samd21g18a", "cpu": "cortex-m0plus", "usb_product": "Arduino M0", - "variant": "arduino_zero", + "variant": "arduino_zero_org", "ldscript": "samd21g18a_bootloader_org.ld", "hwids": [ - ["0x2A03", "0x004D"], - ["0x2A03", "0x804D"], - ["0x2A03", "0x004E"], - ["0x2A03", "0x804E"] + ["0x2A03", "0x804E"], + ["0x2A03", "0x004E"] ] }, "frameworks": ["arduino"], @@ -1057,17 +1053,17 @@ }, "tian": { "build": { - "core": "arduino_zero", + "core": "arduino_zero_org", "extra_flags": "-DARDUINO_SAMD_ZERO -DARDUINO_ARCH_SAMD -D__SAMD21G18A__", "f_cpu": "48000000L", "mcu": "samd21g18a", "cpu": "cortex-m0plus", "usb_product": "Arduino Tian", - "variant": "arduino_zero", + "variant": "arduino_zero_org", "ldscript": "samd21g18a_bootloader_org.ld", "hwids": [ - ["0x10C4", "0xEA70"], - ["0x2A03", "0x8052"] + ["0x2A03", "0x8052"], + ["0x10C4", "0xEA70"] ] }, "frameworks": ["arduino"], diff --git a/platformio/builder/scripts/frameworks/arduino.py b/platformio/builder/scripts/frameworks/arduino.py index 1e3874b316..2eedbfda1f 100644 --- a/platformio/builder/scripts/frameworks/arduino.py +++ b/platformio/builder/scripts/frameworks/arduino.py @@ -216,11 +216,19 @@ if env.subst("${PLATFORMFW_DIR}")[-3:] == "sam": env.VariantDirWrap( join("$BUILD_DIR", "FrameworkCMSISInc"), - join("$PLATFORMFW_DIR", "system", "CMSIS", "CMSIS", "Include") + join( + "$PLATFORMFW_DIR", "system", + "CMSIS%s" % ("_ORG" if "_org" in BOARD_CORELIBDIRNAME else ""), + "CMSIS", "Include" + ) ) env.VariantDirWrap( join("$BUILD_DIR", "FrameworkDeviceInc"), - join("$PLATFORMFW_DIR", "system", "CMSIS", "Device", "ATMEL") + join( + "$PLATFORMFW_DIR", "system", + "CMSIS%s" % ("_ORG" if "_org" in BOARD_CORELIBDIRNAME else ""), + "Device", "ATMEL" + ) ) env.VariantDirWrap( join("$BUILD_DIR", "FrameworkLibSam"), diff --git a/platformio/builder/tools/pioupload.py b/platformio/builder/tools/pioupload.py index 37cd482667..bc81941a13 100644 --- a/platformio/builder/tools/pioupload.py +++ b/platformio/builder/tools/pioupload.py @@ -39,15 +39,12 @@ def FlushSerialBuffer(env, port): def TouchSerialPort(env, port, baudrate): port = env.subst(port) print "Forcing reset using %dbps open/close on port %s" % (baudrate, port) - if system() != "Windows": - try: - s = Serial(port) - s.close() - except: # pylint: disable=W0702 - pass - s = Serial(port=port, baudrate=baudrate) - s.setDTR(False) - s.close() + try: + s = Serial(port=port, baudrate=baudrate) + s.setDTR(False) + s.close() + except: # pylint: disable=W0702 + pass sleep(0.4) From 03b0b61aa187f8b66e7bbb46ebbc0d5594b4168a Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Mon, 11 Jul 2016 19:26:07 +0300 Subject: [PATCH 03/20] Improve CMSIS selection for SAMD21 boards --- platformio/builder/scripts/frameworks/arduino.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/platformio/builder/scripts/frameworks/arduino.py b/platformio/builder/scripts/frameworks/arduino.py index 2eedbfda1f..16164d8d6e 100644 --- a/platformio/builder/scripts/frameworks/arduino.py +++ b/platformio/builder/scripts/frameworks/arduino.py @@ -218,7 +218,8 @@ join("$BUILD_DIR", "FrameworkCMSISInc"), join( "$PLATFORMFW_DIR", "system", - "CMSIS%s" % ("_ORG" if "_org" in BOARD_CORELIBDIRNAME else ""), + "CMSIS%s" % ( + "_ORG" if BOARD_CORELIBDIRNAME.endswith("_org") else ""), "CMSIS", "Include" ) ) @@ -226,7 +227,8 @@ join("$BUILD_DIR", "FrameworkDeviceInc"), join( "$PLATFORMFW_DIR", "system", - "CMSIS%s" % ("_ORG" if "_org" in BOARD_CORELIBDIRNAME else ""), + "CMSIS%s" % ( + "_ORG" if BOARD_CORELIBDIRNAME.endswith("_org") else ""), "Device", "ATMEL" ) ) From 2fdc57055ba46c38411f5b70f50d69c06c028fb7 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 11 Jul 2016 19:34:36 +0300 Subject: [PATCH 04/20] Add more info about `.pioenvs` directory --- docs/projectconf.rst | 6 +++++- platformio/util.py | 11 ++++++++++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/docs/projectconf.rst b/docs/projectconf.rst index f340833b14..f683554463 100644 --- a/docs/projectconf.rst +++ b/docs/projectconf.rst @@ -97,7 +97,11 @@ This option can be overridden by global environment variable ``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 other cached information. It allows PlatformIO to build source code extremely fast! diff --git a/platformio/util.py b/platformio/util.py index 864e0ea8b8..34850ff726 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -81,6 +81,7 @@ def __exit__(self, etype, value, traceback): class memoized(object): + ''' Decorator. Caches a function's return value each time it is called. If called later with the same arguments, the cached value is returned @@ -212,10 +213,18 @@ def get_projectlib_dir(): def get_pioenvs_dir(): - return _get_projconf_option_dir( + path = _get_projconf_option_dir( "envs_dir", join(get_project_dir(), ".pioenvs") ) + 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(): From f4cebfdbae86d82dc752aefb3e88fa5482cb4177 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 11 Jul 2016 19:44:36 +0300 Subject: [PATCH 05/20] Fix issue when `pioenvs` folder doesn't exist --- platformio/util.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/platformio/util.py b/platformio/util.py index 34850ff726..727c99574d 100644 --- a/platformio/util.py +++ b/platformio/util.py @@ -217,6 +217,8 @@ def get_pioenvs_dir(): "envs_dir", 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: From 8fd553fbfce4cabd6395ed5c33581affd5121d44 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 11 Jul 2016 19:52:47 +0300 Subject: [PATCH 06/20] Add Arduino M0 Pro and Tian to the examples // Issue #472 --- examples | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples b/examples index 6c0a7e4458..a657ca4225 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 6c0a7e4458056fa04657a14422aeae277560341d +Subproject commit a657ca4225f55af7239b89486350c9f02bb3ee93 From d246ef9a2e11d5c21e73417bdf17f93fac88ae33 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 11 Jul 2016 21:04:40 +0300 Subject: [PATCH 07/20] Bump to 2.11.1b1 --- platformio/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/platformio/__init__.py b/platformio/__init__.py index adf76f9747..3c27dd05dd 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 11, "1.dev2") +VERSION = (2, 11, "1b1") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From b165c3f543533094d65544f3bc59d4f4642abc83 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 11 Jul 2016 22:40:37 +0300 Subject: [PATCH 08/20] Ignore "[platformio]" section from custom project configuration CI --- HISTORY.rst | 3 +++ platformio/__init__.py | 2 +- platformio/commands/ci.py | 17 ++++++++++++++++- 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c9629b4dca..1e644f1d4b 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,9 @@ PlatformIO 2.0 * Improved project generator for `CLion IDE `__ * Auto-remove project cache when PlatformIO is upgraded * 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 `__ + command is used * Fixed missed ``--boot`` flag for the firmware uploader for ATSAM3X8E Cortex-M3 MCU based boards (Arduino Due, etc) (`issue #710 `_) diff --git a/platformio/__init__.py b/platformio/__init__.py index 3c27dd05dd..1bf8e37c57 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 11, "1b1") +VERSION = (2, 11, "1b2") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/ci.py b/platformio/commands/ci.py index 602ef67db2..bb503e40e0 100644 --- a/platformio/commands/ci.py +++ b/platformio/commands/ci.py @@ -27,6 +27,12 @@ from platformio.exception import CIBuildEnvsEmpty from platformio.util import get_boards +# 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 invalid_path = None @@ -91,7 +97,7 @@ def cli(ctx, src, lib, exclude, board, # pylint: disable=R0913 _copy_contents(join(build_dir, dir_name), contents) 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: raise CIBuildEnvsEmpty() @@ -157,3 +163,12 @@ def _exclude_contents(dst_dir, patterns): rmtree(path) elif isfile(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) From b447e0aeab98eb98efa4cc46000dbde92a195fa5 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 11 Jul 2016 23:08:08 +0300 Subject: [PATCH 09/20] Update history --- HISTORY.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 1e644f1d4b..7c1dfa355e 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,8 @@ PlatformIO 2.0 2.11.1 (2016-??-??) ~~~~~~~~~~~~~~~~~~~ +* Added support for Arduino M0, M0 Pro and Tian boards + (`issue #472 `_) * Added support for Microchip chipKIT Lenny board * Updated Microchip PIC32 Arduino framework to v1.2.1 * Documented `uploading of EEPROM data `__ From 6cbd28683688a9f3885db7fb86bb0a8d10a2c1d9 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 12 Jul 2016 19:26:33 +0300 Subject: [PATCH 10/20] Add "udev" rules for OpenOCD CMSIS-DAP adapters // Resolve #718 --- HISTORY.rst | 2 ++ scripts/99-platformio-udev.rules | 3 +++ 2 files changed, 5 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 7c1dfa355e..95da8ced2c 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -15,6 +15,8 @@ PlatformIO 2.0 (from EEMEM directive) * Added ``Rebuild C/C++ Project Index`` target to CLion and Eclipse IDEs * Improved project generator for `CLion IDE `__ +* Added ``udev`` rules for OpenOCD CMSIS-DAP adapters + (`issue #718 `_) * Auto-remove project cache when PlatformIO is upgraded * Keep user changes for ``.gitignore`` file when re-generate/update project data * Ignore ``[platformio]`` section from custom project configuration file when diff --git a/scripts/99-platformio-udev.rules b/scripts/99-platformio-udev.rules index a3c846b7a6..340e723ba8 100644 --- a/scripts/99-platformio-udev.rules +++ b/scripts/99-platformio-udev.rules @@ -76,3 +76,6 @@ SUBSYSTEMS=="usb", ATTRS{idVendor}=="1cbe", ATTRS{idProduct}=="00fd", MODE="0666 #TI MSP430 Launchpad SUBSYSTEMS=="usb", ATTRS{idVendor}=="0451", ATTRS{idProduct}=="f432", MODE="0666" + +# CMSIS-DAP compatible adapters +ATTRS{product}=="*CMSIS-DAP*", MODE="664", GROUP="plugdev" From 77a4d3f773c7cd498ae69186553d2323bc3505eb Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 12 Jul 2016 19:29:49 +0300 Subject: [PATCH 11/20] Typo fix --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 44ad2e5b4f..a385431842 100644 --- a/README.rst +++ b/README.rst @@ -187,10 +187,10 @@ Contributing See `contributing guidelines `_. -Licence +License ------- Copyright 2014-2016 Ivan Kravets -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. From 2dd01247e1f00b60a57987c8f2ba37996e4be23c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Tue, 12 Jul 2016 19:34:14 +0300 Subject: [PATCH 12/20] Version bump to 2.11.1 (issues #472, #629, #710, #711, #712, #713, #718) --- HISTORY.rst | 2 +- platformio/__init__.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 95da8ced2c..2663748bec 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,7 +4,7 @@ Release Notes PlatformIO 2.0 -------------- -2.11.1 (2016-??-??) +2.11.1 (2016-07-12) ~~~~~~~~~~~~~~~~~~~ * Added support for Arduino M0, M0 Pro and Tian boards diff --git a/platformio/__init__.py b/platformio/__init__.py index 1bf8e37c57..2063af7bd3 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 11, "1b2") +VERSION = (2, 11, 1) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" From ba234754253f163d8227ef7fd667b3f9c95d272c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 13 Jul 2016 11:49:52 +0300 Subject: [PATCH 13/20] Improved docs for integration with CLion IDE --- docs/ide/clion.rst | 67 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 65 insertions(+), 2 deletions(-) diff --git a/docs/ide/clion.rst b/docs/ide/clion.rst index bbd6584ad3..aa0a8afa88 100644 --- a/docs/ide/clion.rst +++ b/docs/ide/clion.rst @@ -43,12 +43,17 @@ command and generate project via :option:`platformio init --ide` command: 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`` and specify root directory where is located :ref:`projectconf` 3. Open source file from ``src`` directory 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 the screenshot below): @@ -68,6 +73,64 @@ the screenshot below): after generating process wont be reflected in IDE. To fix it please run ``PLATFORMIO_REBUILD_PROJECT_INDEX`` target. +Known issues +------------ + +.. _ide_clion_knownissues_inopde_not_supported: + +Arduino ``.ino`` files are not supported +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +CLion doesn't support Arduino files (``*.ino`` and ``.pde``) because they are +not valid C/C++ based source files: + +1. Missing includes such as ``#include `` +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 `` 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 + + void someFunction(int num); + + void function setup () { + someFunction(13); + } + + void function loop() { + delay(1000); + } + + void someFunction(int num) { + } + + Articles / Manuals ------------------ @@ -81,6 +144,6 @@ Examples -------- "Blink" Project -^^^^^^^^^^^^^^^ +~~~~~~~~~~~~~~~ Source code of `CLion "Blink" Project `_. From 4f57cc52d442eb284331bc066be07d00a60ea452 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Wed, 13 Jul 2016 11:56:20 +0300 Subject: [PATCH 14/20] Minor improvements for CLion docs --- docs/ide/clion.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/ide/clion.rst b/docs/ide/clion.rst index aa0a8afa88..7a548ee880 100644 --- a/docs/ide/clion.rst +++ b/docs/ide/clion.rst @@ -81,7 +81,8 @@ Known issues Arduino ``.ino`` files are not supported ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -CLion doesn't support Arduino files (``*.ino`` and ``.pde``) because they are +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 `` From 7ad8d08037fc1854177a5fdee42a4dbf57054346 Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Mon, 18 Jul 2016 12:14:48 +0300 Subject: [PATCH 15/20] Add Pinoccio board // Issue #52 --- platformio/boards/misc.json | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/platformio/boards/misc.json b/platformio/boards/misc.json index 114e8022ce..0a9be48ea4 100644 --- a/platformio/boards/misc.json +++ b/platformio/boards/misc.json @@ -820,5 +820,27 @@ }, "url": "https://www.arduboy.com", "vendor": "Arduboy" + }, + + "pinoccio": { + "build": { + "core": "arduino", + "extra_flags": "-DARDUINO_ARCH_AVR -DARDUINO_PINOCCIO -D__PROG_TYPES_COMPAT__", + "f_cpu": "16000000L", + "mcu": "atmega256rfr2", + "variant": "pinoccio" + }, + "frameworks": ["arduino"], + "name": "Pinoccio Scout", + "platform": "atmelavr", + "upload": { + "maximum_ram_size": 32768, + "maximum_size": 253952, + "protocol": "wiring", + "require_upload_port" : true, + "speed": 115200 + }, + "url": "https://www.crowdsupply.com/pinoccio/mesh-sensor-network", + "vendor": "Pinoccio" } } From 79a4a943dc79cbfde4d576077c0525972c94de5a Mon Sep 17 00:00:00 2001 From: Valeriy Koval Date: Mon, 18 Jul 2016 14:52:25 +0300 Subject: [PATCH 16/20] Fix USB flags processing for teensy platform // Issue #722 --- platformio/builder/scripts/frameworks/arduino.py | 16 ++++++++++++++++ platformio/builder/scripts/teensy.py | 1 - 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/platformio/builder/scripts/frameworks/arduino.py b/platformio/builder/scripts/frameworks/arduino.py index 16164d8d6e..558852a888 100644 --- a/platformio/builder/scripts/frameworks/arduino.py +++ b/platformio/builder/scripts/frameworks/arduino.py @@ -198,6 +198,20 @@ "ARDUINO=10600", "TEENSYDUINO=%d" % ARDUINO_VERSION ] + + USB_FLAGS = ( + "USB_HID", + "USB_SERIAL_HID", + "USB_DISK", + "USB_DISK_SDFLASH", + "USB_MIDI", + "USB_RAWHID", + "USB_FLIGHTSIM", + "USB_DISABLED" + ) + + if not any(f in env.get("BUILD_FLAGS", []) for f in USB_FLAGS): + env.Append(CPPDEFINES=["USB_SERIAL"]) else: ARDUINO_USBDEFINES += ["ARDUINO=%d" % ARDUINO_VERSION] @@ -310,6 +324,8 @@ with open(file_path, "w") as fp: fp.write(content) + env.Append(CPPPATH=[join("$PLATFORMFW_DIR", "cores")]) + # # Target: Build Core Library # diff --git a/platformio/builder/scripts/teensy.py b/platformio/builder/scripts/teensy.py index 43e293f34b..c01c67e850 100644 --- a/platformio/builder/scripts/teensy.py +++ b/platformio/builder/scripts/teensy.py @@ -40,7 +40,6 @@ env.Append( CPPDEFINES=[ - "USB_SERIAL", "LAYOUT_US_ENGLISH" ], From 7b8fb77250decbb2baf15c0a07cfe18a836e898c Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 18 Jul 2016 20:36:24 +0300 Subject: [PATCH 17/20] Fix broken LD Script for Element14 chipKIT Pi board // Resolve #725 Resolve #726 --- HISTORY.rst | 6 ++++++ platformio/boards/microchippic32.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/HISTORY.rst b/HISTORY.rst index 2663748bec..bf969585c2 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,12 @@ Release Notes PlatformIO 2.0 -------------- +2.11.2 (2016-??-??) +~~~~~~~~~~~~~~~~~~~ + +* Fixed broken LD Script for Element14 chipKIT Pi board + (`issue #725 `_) + 2.11.1 (2016-07-12) ~~~~~~~~~~~~~~~~~~~ diff --git a/platformio/boards/microchippic32.json b/platformio/boards/microchippic32.json index 7090d97c13..0b569c036d 100644 --- a/platformio/boards/microchippic32.json +++ b/platformio/boards/microchippic32.json @@ -119,7 +119,7 @@ "core": "pic32", "extra_flags": "-D_BOARD_CHIPKIT_PI_", "f_cpu": "40000000L", - "ldscript": "cchipKIT-application-32MX250F128.ld", + "ldscript": "chipKIT-application-32MX250F128.ld", "mcu": "32MX250F128B", "variant": "ChipKIT_Pi" }, From 60b3fef37afedf1f71af5545a19fc0d00c5b44ce Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 18 Jul 2016 20:39:04 +0300 Subject: [PATCH 18/20] Add support for Pinoccio Scout board // Resolve #52 --- HISTORY.rst | 2 ++ docs/frameworks/arduino.rst | 20 ++++++++++++++++++++ docs/platforms/atmelavr.rst | 20 ++++++++++++++++++++ docs/platforms/embedded_boards.rst | 20 ++++++++++++++++++++ 4 files changed, 62 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index bf969585c2..30a316c916 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,8 @@ PlatformIO 2.0 2.11.2 (2016-??-??) ~~~~~~~~~~~~~~~~~~~ +* Added support for Pinoccio Scout board + (`issue #52 `_) * Fixed broken LD Script for Element14 chipKIT Pi board (`issue #725 `_) diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index e0d9c67f72..b16c12d6cc 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -1341,6 +1341,26 @@ PanStamp - 32 Kb - 4 Kb +Pinoccio +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``pinoccio`` + - `Pinoccio Scout `_ + - ATMEGA256RFR2 + - 16 MHz + - 256 Kb + - 32 Kb + Punch Through ~~~~~~~~~~~~~ diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index f5ba50c1d9..52bcb58426 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -842,6 +842,26 @@ PanStamp - 32 Kb - 2 Kb +Pinoccio +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``pinoccio`` + - `Pinoccio Scout `_ + - ATMEGA256RFR2 + - 16 MHz + - 256 Kb + - 32 Kb + Punch Through ~~~~~~~~~~~~~ diff --git a/docs/platforms/embedded_boards.rst b/docs/platforms/embedded_boards.rst index f5a6a0d69a..91df147592 100644 --- a/docs/platforms/embedded_boards.rst +++ b/docs/platforms/embedded_boards.rst @@ -1726,6 +1726,26 @@ PanStamp - 32 Kb - 4 Kb +Pinoccio +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``pinoccio`` + - `Pinoccio Scout `_ + - ATMEGA256RFR2 + - 16 MHz + - 256 Kb + - 32 Kb + Punch Through ~~~~~~~~~~~~~ From d7fa2551662236a81df149e7a8e59395f876e586 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 18 Jul 2016 21:06:45 +0300 Subject: [PATCH 19/20] Implement Teensy 2.0 USB functionality (HID, SERIAL_HID, DISK, MIDI, etc.) // Resolve #722 --- HISTORY.rst | 3 +++ docs/platforms/teensy_extra.rst | 27 +++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/HISTORY.rst b/HISTORY.rst index 30a316c916..5ed2e5c98d 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,6 +9,9 @@ PlatformIO 2.0 * Added support for Pinoccio Scout board (`issue #52 `_) +* Implemented `Teensy 2.0 USB functionality `__ + (HID, SERIAL_HID, DISK, MIDI, etc.) + (`issue #722 `_) * Fixed broken LD Script for Element14 chipKIT Pi board (`issue #725 `_) diff --git a/docs/platforms/teensy_extra.rst b/docs/platforms/teensy_extra.rst index cca6c11991..f2027038e6 100644 --- a/docs/platforms/teensy_extra.rst +++ b/docs/platforms/teensy_extra.rst @@ -9,6 +9,33 @@ See the License for the specific language governing permissions and limitations under the License. +Teensy 2.0 and USB +------------------ + +If you want to implement USB functionality using Teensy 2.0, you need to +add special macros/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 `_. + Examples -------- From f16c05c42973b4aa462f2d53456a74b6a3603b6d Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 18 Jul 2016 22:20:04 +0300 Subject: [PATCH 20/20] Update docs for Teensy USB Features // Issue #722 --- HISTORY.rst | 4 ++-- docs/platforms/teensy_extra.rst | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 5ed2e5c98d..bce24a3ae4 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -9,8 +9,8 @@ PlatformIO 2.0 * Added support for Pinoccio Scout board (`issue #52 `_) -* Implemented `Teensy 2.0 USB functionality `__ - (HID, SERIAL_HID, DISK, MIDI, etc.) +* Added support for `Teensy USB Features `__ + (HID, SERIAL_HID, DISK, DISK_SDFLASH, MIDI, etc.) (`issue #722 `_) * Fixed broken LD Script for Element14 chipKIT Pi board (`issue #725 `_) diff --git a/docs/platforms/teensy_extra.rst b/docs/platforms/teensy_extra.rst index f2027038e6..360ea86cd1 100644 --- a/docs/platforms/teensy_extra.rst +++ b/docs/platforms/teensy_extra.rst @@ -9,11 +9,11 @@ See the License for the specific language governing permissions and limitations under the License. -Teensy 2.0 and USB ------------------- +USB Features +------------ -If you want to implement USB functionality using Teensy 2.0, you need to -add special macros/define using :ref:`projectconf_build_flags`: +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``