diff --git a/HISTORY.rst b/HISTORY.rst index d5cf04e6..880e1d32 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -25,9 +25,38 @@ PlatformIO 3.0 PlatformIO 2.0 -------------- -2.10.4 (2016-06-??) +2.11.1 (2016-??-??) ~~~~~~~~~~~~~~~~~~~ +* Added support for Microchip chipKIT Lenny board +* Updated Microchip PIC32 Arduino framework to v1.2.1 +* Documented `uploading of EEPROM data `__ + (from EEMEM directive) +* 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 +* Fixed missed ``--boot`` flag for the firmware uploader for ATSAM3X8E + Cortex-M3 MCU based boards (Arduino Due, etc) + (`issue #710 `_) +* Fixed missing trailing ``\`` for the source files list when generate project + for `Qt Creator IDE `__ + (`issue #711 `_) +* Split source files to ``HEADERS`` and ``SOURCES`` when generate project + for `Qt Creator IDE `__ + (`issue #713 `_) + +2.11.0 (2016-06-28) +~~~~~~~~~~~~~~~~~~~ + +* New ESP8266-based boards: Generic ESP8285 Module, Phoenix 1.0 & 2.0, WifInfo +* Added support for Arduino M0 Pro board + (`issue #472 `_) +* Added support for Arduino MKR1000 board + (`issue #620 `_) +* Added support for Adafruit Feather M0, SparkFun SAMD21 and SparkFun SAMD21 + Mini Breakout boards + (`issue #520 `_) +* Updated Arduino ESP8266 core for Espressif platform to 2.3.0 * Better removing unnecessary flags using ``build_unflags`` option (`issue #698 `_) * Fixed issue with ``platformio init --ide`` command for Python 2.6 diff --git a/README.rst b/README.rst index 7976f9ac..391214f2 100644 --- a/README.rst +++ b/README.rst @@ -198,8 +198,9 @@ Contributing 6. Make changes to code, documentation, etc. 7. Lint source code ``tox -e lint`` 8. Run the tests ``tox -e py27`` -9. Commit changes to your forked repository -10. Submit a Pull Request on GitHub. +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 ------- diff --git a/docs/articles.rst b/docs/articles.rst index 8791784c..3dbe604c 100644 --- a/docs/articles.rst +++ b/docs/articles.rst @@ -23,6 +23,10 @@ Here are recent articles about PlatformIO: 2016 ^^^^ +* Jun 14, 2016 - **Glyn Hudson** - `OpenEnergyMonitor Part 2/3: Firmware Continuous Test & Build `_ +* Jun 13, 2016 - **Daniel Eichhorn** - `New Weather Station Demo on Github `_ +* Jun 12, 2016 - **Glyn Hudson** - `OpenEnergyMonitor Part 1/3: PlatformIO open-source embedded development ecosystem `_ +* Jun 12, 2016 - **Uli Wolf** - `Nutzung von PlatformIO im Atom Editor zur Entwicklung von Arduino Code (Use PlatformIO and Atom Editor to develop Arduino code, German) `_ * Jun 3, 2016 - **Daniel Eichhorn** - `ESP8266: Continuous Delivery Pipeline – Push To Production `_ * May 30, 2016 - **Ron Moerman** - `IoT Development with PlatformIO `_ * May 29, 2016 - **Chris Synan** - `Reverse Engineer RF Remote Controller for IoT! `_ diff --git a/docs/frameworks/arduino.rst b/docs/frameworks/arduino.rst index db5b6d92..e0d9c67f 100644 --- a/docs/frameworks/arduino.rst +++ b/docs/frameworks/arduino.rst @@ -92,6 +92,13 @@ Adafruit - Flash - RAM + * - ``adafruit_feather_m0_usb`` + - `Adafruit Feather M0 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``bluefruitmicro`` - `Adafruit Bluefruit Micro `_ - ATMEGA32U4 @@ -377,6 +384,34 @@ Arduino - 32 Kb - 2 Kb + * - ``mkr1000USB`` + - `Arduino MKR1000 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeroUSB`` + - `Arduino M0 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeropro`` + - `Arduino M0 Pro (Programming Port) `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeroproUSB`` + - `Arduino M0 Pro (Native USB Port) `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``nanoatmega168`` - `Arduino Nano ATmega168 `_ - ATMEGA168 @@ -433,6 +468,13 @@ Arduino - 32 Kb - 2.5 Kb + * - ``tian`` + - `Arduino Tian `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``uno`` - `Arduino Uno `_ - ATMEGA328P @@ -802,6 +844,13 @@ Espressif - 4096 Kb - 80 Kb + * - ``esp8285`` + - `Generic ESP8285 Module `_ + - ESP8266 + - 80 MHz + - 448 Kb + - 80 Kb + * - ``esp_wroom_02`` - `ESP-WROOM-02 `_ - ESP8266 @@ -809,6 +858,27 @@ Espressif - 4096 Kb - 50 Kb + * - ``phoenix_v1`` + - `Phoenix 1.0 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``phoenix_v2`` + - `Phoenix 2.0 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``wifinfo`` + - `WifInfo `_ + - ESP8266 + - 80 MHz + - 448 Kb + - 80 Kb + Fubarino ~~~~~~~~ @@ -1563,6 +1633,20 @@ SparkFun - 32 Kb - 2 Kb + * - ``sparkfun_samd21_dev_usb`` + - `SparkFun SAMD21 Dev Breakout `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``sparkfun_samd21_mini_usb`` + - `SparkFun SAMD21 Mini Breakout `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``thing`` - `SparkFun ESP8266 Thing `_ - ESP8266 @@ -1780,6 +1864,26 @@ Wicked Device - 128 Kb - 16 Kb +chipKIT +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lenny`` + - `chipKIT Lenny `_ + - 32MX270F256D + - 40 MHz + - 128 Kb + - 32 Kb + element14 ~~~~~~~~~ diff --git a/docs/ide/clion.rst b/docs/ide/clion.rst index 4ad92d8f..89ad7cfa 100644 --- a/docs/ide/clion.rst +++ b/docs/ide/clion.rst @@ -43,10 +43,11 @@ command and generate project via :option:`platformio init --ide` command: Then: -1. Import this project via ``Menu: File > Import Project`` +1. Place source files (``*.c, *.cpp, *.h, *.ino, etc.``) to ``src`` directory +2. Import this project via ``Menu: File > Import Project`` and specify root directory where is located :ref:`projectconf` -2. Open source file from ``src`` directory (``*.c, *.cpp, *.ino, etc.``) -3. Build project (*DO NOT RUN*): ``Menu: Run > Build``. +3. Open source file from ``src`` directory +4. Build project (*DO NOT RUN*): ``Menu: Run > Build``. There are 6 predefined targets for building (*NOT FOR RUNNING*, see marks on the screenshot below): @@ -63,22 +64,6 @@ the screenshot below): after generating process wont be reflected in IDE. To fix it you need to reinitialize project using :ref:`cmd_init` (repeat it). -.. warning:: - PlatformIO generates empty project by default and **code auto-completion - will not work!** To enable auto-completion please choose one of: - - * Add source files ``*.c, *.cpp, etc`` to ``src`` directory and re-initialize - project with command above - * Manually correct ``add_executable`` command in ``CMakeLists.txt`` file - (will be created in project directory after initialization). - - ``*.ino`` file isn't acceptable for ``add_executable`` command. You should - convert it manually to ``*.cpp``. See `project example `_. - - More info `CLion issue #CPP-3977 `_. - Active discussion is located in - `PlatformIO issue #132 `_. - Articles / Manuals ------------------ diff --git a/docs/librarymanager/creating.rst b/docs/librarymanager/creating.rst index efbfc32f..2fe3dbbd 100644 --- a/docs/librarymanager/creating.rst +++ b/docs/librarymanager/creating.rst @@ -20,6 +20,9 @@ source code structure. The only one requirement is library's manifest file - :ref:`library_config`. It can be located inside your library or in the another location where |PIOAPICR| will have *HTTP* access. +Updates to existing libraries are done every 24 hours. In case a more urgent +update is required, you can post a request on PlatformIO `community `_. + .. contents:: Source Code Location @@ -152,6 +155,12 @@ to :ref:`install ` it. Examples -------- +Command: + +.. code-block:: bash + + $ platformio lib register http://my.example.com/library.json + * `GitHub + fixed release `_ * `Dependencies by author and framework `_ * `Multiple libraries in the one repository `_ diff --git a/docs/platforms/atmelavr.rst b/docs/platforms/atmelavr.rst index fb181900..f5ba50c1 100644 --- a/docs/platforms/atmelavr.rst +++ b/docs/platforms/atmelavr.rst @@ -43,16 +43,6 @@ Packages * - ``tool-micronucleus`` - `Micronucleus `_ -.. warning:: - **Linux Users:** Don't forget to install "udev" rules file - `99-platformio-udev.rules `_ (an instruction is located in the file). - - - **Windows Users:** Please check that you have correctly installed USB - driver from board manufacturer - - - Frameworks ---------- .. list-table:: diff --git a/docs/platforms/atmelavr_extra.rst b/docs/platforms/atmelavr_extra.rst index 8ef5a20f..754de6e0 100644 --- a/docs/platforms/atmelavr_extra.rst +++ b/docs/platforms/atmelavr_extra.rst @@ -95,6 +95,13 @@ Configuration for the programmers: upload_port = SERIAL_PORT_HERE upload_speed = 19200 +Upload EEPROM data +------------------ + +To upload EEPROM data (from EEMEM directive) you need to use ``uploadeep`` +target instead ``upload`` for :option:`platformio run --target` command. +For example, ``platformio run -t uploadeep``. + Articles -------- diff --git a/docs/platforms/atmelsam.rst b/docs/platforms/atmelsam.rst index 3ff2a173..12cbc41a 100644 --- a/docs/platforms/atmelsam.rst +++ b/docs/platforms/atmelsam.rst @@ -28,23 +28,26 @@ Packages * - Name - Contents + * - ``framework-mbed`` + - `mbed Framework `_ + * - ``toolchain-gccarmnoneeabi`` - `gcc-arm-embedded `_, `GDB `_ * - ``framework-arduinosam`` - `Arduino Wiring-based Framework (SAM Core, 1.6) `_ + * - ``ldscripts`` + - `Linker Scripts `_ + * - ``framework-simba`` - `Simba Framework `_ * - ``tool-openocd`` - `OpenOCD `_ - * - ``framework-mbed`` - - `mbed Framework `_ - - * - ``ldscripts`` - - `Linker Scripts `_ + * - ``tool-avrdude`` + - `AVRDUDE `_ * - ``tool-bossac`` - `BOSSA CLI `_ @@ -85,6 +88,26 @@ Boards * For more detailed ``board`` information please scroll tables below by horizontal. +Adafruit +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``adafruit_feather_m0_usb`` + - `Adafruit Feather M0 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + Arduino ~~~~~~~ @@ -112,6 +135,41 @@ Arduino - 512 Kb - 32 Kb + * - ``mkr1000USB`` + - `Arduino MKR1000 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeroUSB`` + - `Arduino M0 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeropro`` + - `Arduino M0 Pro (Programming Port) `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeroproUSB`` + - `Arduino M0 Pro (Native USB Port) `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``tian`` + - `Arduino Tian `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``zero`` - `Arduino Zero (Programming Port) `_ - SAMD21G18A @@ -206,3 +264,30 @@ SainSmart - 84 MHz - 512 Kb - 32 Kb + +SparkFun +~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``sparkfun_samd21_dev_usb`` + - `SparkFun SAMD21 Dev Breakout `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``sparkfun_samd21_mini_usb`` + - `SparkFun SAMD21 Mini Breakout `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb diff --git a/docs/platforms/embedded_boards.rst b/docs/platforms/embedded_boards.rst index bd52ca0c..f5a6a0d6 100644 --- a/docs/platforms/embedded_boards.rst +++ b/docs/platforms/embedded_boards.rst @@ -78,6 +78,13 @@ Adafruit - Flash - RAM + * - ``adafruit_feather_m0_usb`` + - `Adafruit Feather M0 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``bluefruitmicro`` - `Adafruit Bluefruit Micro `_ - ATMEGA32U4 @@ -363,6 +370,34 @@ Arduino - 32 Kb - 2 Kb + * - ``mkr1000USB`` + - `Arduino MKR1000 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeroUSB`` + - `Arduino M0 `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeropro`` + - `Arduino M0 Pro (Programming Port) `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``mzeroproUSB`` + - `Arduino M0 Pro (Native USB Port) `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``nanoatmega168`` - `Arduino Nano ATmega168 `_ - ATMEGA168 @@ -419,6 +454,13 @@ Arduino - 32 Kb - 2.5 Kb + * - ``tian`` + - `Arduino Tian `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``uno`` - `Arduino Uno `_ - ATMEGA328P @@ -957,6 +999,13 @@ Espressif - 4096 Kb - 80 Kb + * - ``esp8285`` + - `Generic ESP8285 Module `_ + - ESP8266 + - 80 MHz + - 448 Kb + - 80 Kb + * - ``esp_wroom_02`` - `ESP-WROOM-02 `_ - ESP8266 @@ -964,6 +1013,27 @@ Espressif - 4096 Kb - 50 Kb + * - ``phoenix_v1`` + - `Phoenix 1.0 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``phoenix_v2`` + - `Phoenix 2.0 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``wifinfo`` + - `WifInfo `_ + - ESP8266 + - 80 MHz + - 448 Kb + - 80 Kb + Freescale ~~~~~~~~~ @@ -2322,6 +2392,20 @@ SparkFun - 32 Kb - 2 Kb + * - ``sparkfun_samd21_dev_usb`` + - `SparkFun SAMD21 Dev Breakout `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + + * - ``sparkfun_samd21_mini_usb`` + - `SparkFun SAMD21 Mini Breakout `_ + - SAMD21G18A + - 48 MHz + - 256 Kb + - 32 Kb + * - ``thing`` - `SparkFun ESP8266 Thing `_ - ESP8266 @@ -2663,6 +2747,26 @@ Wicked Device - 128 Kb - 16 Kb +chipKIT +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lenny`` + - `chipKIT Lenny `_ + - 32MX270F256D + - 40 MHz + - 128 Kb + - 32 Kb + element14 ~~~~~~~~~ diff --git a/docs/platforms/espressif.rst b/docs/platforms/espressif.rst index f8333846..56ffbc43 100644 --- a/docs/platforms/espressif.rst +++ b/docs/platforms/espressif.rst @@ -210,6 +210,13 @@ Espressif - 4096 Kb - 80 Kb + * - ``esp8285`` + - `Generic ESP8285 Module `_ + - ESP8266 + - 80 MHz + - 448 Kb + - 80 Kb + * - ``esp_wroom_02`` - `ESP-WROOM-02 `_ - ESP8266 @@ -217,6 +224,27 @@ Espressif - 4096 Kb - 50 Kb + * - ``phoenix_v1`` + - `Phoenix 1.0 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``phoenix_v2`` + - `Phoenix 2.0 `_ + - ESP8266 + - 80 MHz + - 1024 Kb + - 80 Kb + + * - ``wifinfo`` + - `WifInfo `_ + - ESP8266 + - 80 MHz + - 448 Kb + - 80 Kb + NodeMCU ~~~~~~~ diff --git a/docs/platforms/espressif_extra.rst b/docs/platforms/espressif_extra.rst index fd04de77..65d7356a 100644 --- a/docs/platforms/espressif_extra.rst +++ b/docs/platforms/espressif_extra.rst @@ -240,6 +240,7 @@ Using Arduino Framework with Staging version Articles -------- +* Jun 13, 2016 - **Daniel Eichhorn** - `New Weather Station Demo on Github `_ * Jun 3, 2016 - **Daniel Eichhorn** - `ESP8266: Continuous Delivery Pipeline – Push To Production `_ * May 29, 2016 - **Chris Synan** - `Reverse Engineer RF Remote Controller for IoT! `_ * May 22, 2016 - **Pedro Minatel** - `Estação meteorológica com ESP8266 (Weather station with ESP8266, Portuguese) `_ diff --git a/docs/platforms/microchippic32.rst b/docs/platforms/microchippic32.rst index 7f38d2bb..51c92e8e 100644 --- a/docs/platforms/microchippic32.rst +++ b/docs/platforms/microchippic32.rst @@ -332,6 +332,26 @@ UBW32 - 512 Kb - 128 Kb +chipKIT +~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - Type ``board`` + - Name + - Microcontroller + - Frequency + - Flash + - RAM + + * - ``lenny`` + - `chipKIT Lenny `_ + - 32MX270F256D + - 40 MHz + - 128 Kb + - 32 Kb + element14 ~~~~~~~~~ diff --git a/platformio/__init__.py b/platformio/__init__.py index ca2ab2ae..15f4a2a8 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 0, "0.dev3") +VERSION = (3, 0, "0.dev4") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/run.py b/platformio/commands/run.py index 78591e2e..52af3e32 100644 --- a/platformio/commands/run.py +++ b/platformio/commands/run.py @@ -21,7 +21,7 @@ from time import time import click -from platformio import app, exception, telemetry, util +from platformio import __version__, app, exception, telemetry, util from platformio.commands.lib import lib_install as cmd_lib_install from platformio.commands.platform import \ platform_install as cmd_platform_install @@ -266,7 +266,7 @@ def check_project_envs(project_dir, environments): def calculate_project_hash(): - structure = [] + structure = [__version__] for d in (util.get_projectsrc_dir(), util.get_projectlib_dir()): if not isdir(d): continue diff --git a/platformio/ide/projectgenerator.py b/platformio/ide/projectgenerator.py index b4be53a3..102f7878 100644 --- a/platformio/ide/projectgenerator.py +++ b/platformio/ide/projectgenerator.py @@ -16,11 +16,10 @@ import json import os import re import sys -from os.path import (abspath, basename, expanduser, isdir, join, normpath, - relpath) +from os.path import (abspath, basename, expanduser, isdir, isfile, join, + normpath, relpath) import bottle -import click # pylint: disable=wrong-import-order from platformio import app, exception, util @@ -114,16 +113,18 @@ class ProjectGenerator(object): return tpls def generate(self): - for _relpath, _path in self.get_tpls(): - tpl_dir = self.project_dir - if _relpath: - tpl_dir = join(self.project_dir, _relpath) - if not isdir(tpl_dir): - os.makedirs(tpl_dir) + for tpl_relpath, tpl_path in self.get_tpls(): + dst_dir = self.project_dir + if tpl_relpath: + dst_dir = join(self.project_dir, tpl_relpath) + if not isdir(dst_dir): + os.makedirs(dst_dir) - file_name = basename(_path)[:-4] - with open(join(tpl_dir, file_name), "w") as f: - f.write(self._render_tpl(_path).encode("utf8")) + file_name = basename(tpl_path)[:-4] + self._merge_contents( + join(dst_dir, file_name), + self._render_tpl(tpl_path).encode("utf8") + ) def _render_tpl(self, tpl_path): content = "" @@ -131,23 +132,29 @@ class ProjectGenerator(object): content = f.read() return bottle.template(content, **self._tplvars) + @staticmethod + def _merge_contents(dst_path, contents): + file_name = basename(dst_path) + + # merge .gitignore + if file_name == ".gitignore" and isfile(dst_path): + contents = [l.strip() for l in contents.split("\n") if l.strip()] + with open(dst_path) as f: + for line in f.readlines(): + line = line.strip() + if line and line not in contents: + contents.append(line) + contents = "\n".join(contents) + + with open(dst_path, "w") as f: + f.write(contents) + def _gather_tplvars(self): - src_files = self.get_src_files() - - if (not any([f.endswith((".c", ".cpp")) for f in src_files]) and - self.ide == "clion"): - click.secho( - "Warning! Can not find main source file (*.c, *.cpp). So, " - "code auto-completion is disabled. Please add source files " - "to `src` directory and re-initialize project or edit " - "`CMakeLists.txt` file manually (`add_executable` command).", - fg="yellow") - self._tplvars.update(self.get_project_env()) self._tplvars.update(self.get_project_build_data()) self._tplvars.update({ "project_name": self.get_project_name(), - "src_files": src_files, + "src_files": self.get_src_files(), "user_home_dir": abspath(expanduser("~")), "project_dir": self.project_dir, "systype": util.get_systype(), diff --git a/platformio/ide/tpls/clion/CMakeLists.txt.tpl b/platformio/ide/tpls/clion/CMakeLists.txt.tpl index 25a7b79e..9b56290c 100644 --- a/platformio/ide/tpls/clion/CMakeLists.txt.tpl +++ b/platformio/ide/tpls/clion/CMakeLists.txt.tpl @@ -43,18 +43,5 @@ add_custom_target( WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} ) -% if src_files and any([f.endswith((".c", ".cpp")) for f in src_files]): -add_executable({{project_name}} -% for f in src_files: -% if f.endswith((".c", ".cpp")): - {{f.replace("\\", "/")}} -% end -% end -) -% else: -# -# To enable code auto-completion, please specify path -# to main source file (*.c, *.cpp) and uncomment line below -# -# add_executable({{project_name}} src/main_change_me.cpp) -% end +aux_source_directory(src SRC_LIST) +add_executable(${PROJECT_NAME} ${SRC_LIST}) diff --git a/platformio/ide/tpls/qtcreator/platformio.pro.tpl b/platformio/ide/tpls/qtcreator/platformio.pro.tpl index b33b91cf..2ae9d49d 100644 --- a/platformio/ide/tpls/qtcreator/platformio.pro.tpl +++ b/platformio/ide/tpls/qtcreator/platformio.pro.tpl @@ -17,10 +17,12 @@ INCLUDEPATH += "{{include}}" DEFINES += "{{define}}" % end -OTHER_FILES += \ - platformio.ini +OTHER_FILES += platformio.ini -SOURCES += \ - % for file in src_files: - {{file}} - % end +% for file in src_files: +% if file.endswith((".h", ".hpp")): +HEADERS += {{file}} +% else: +SOURCES += {{file}} +% end +% end