diff --git a/HISTORY.rst b/HISTORY.rst index 2c41f427..f5c1f3b8 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -4,6 +4,15 @@ Release Notes PlatformIO 2.0 -------------- +2.8.3 (2016-02-02) +~~~~~~~~~~~~~~~~~~ + +* Better integration of PlatformIO Builder with PlatformIO IDE Linter +* Fixed issue with removing temporary file while converting ``*.ino`` to + ``*.cpp`` +* Fixed missing dependency (mbed framework) for Atmel SAM development platform + (`issue #487 `_) + 2.8.2 (2016-01-29) ~~~~~~~~~~~~~~~~~~ diff --git a/docs/_static/extra.css b/docs/_static/extra.css index edf97bb8..e88d4b07 100644 --- a/docs/_static/extra.css +++ b/docs/_static/extra.css @@ -35,10 +35,10 @@ nav { display: block !important; } body { - padding-top: 100px; + padding-top: 50px; } .wy-nav-side { - top: 100px; + top: 50px; } .container { diff --git a/docs/_static/ide-atom-platformio-install.png b/docs/_static/ide-atom-platformio-install.png new file mode 100644 index 00000000..16e51a23 Binary files /dev/null and b/docs/_static/ide-atom-platformio-install.png differ diff --git a/docs/_static/ide-atom-platformio-menu-item.png b/docs/_static/ide-atom-platformio-menu-item.png index 43141631..0409ffb1 100644 Binary files a/docs/_static/ide-atom-platformio-menu-item.png and b/docs/_static/ide-atom-platformio-menu-item.png differ diff --git a/docs/_static/ide-atom-platformio-toolbar.png b/docs/_static/ide-atom-platformio-toolbar.png new file mode 100644 index 00000000..96d40be2 Binary files /dev/null and b/docs/_static/ide-atom-platformio-toolbar.png differ diff --git a/docs/_static/ide-atom-platformio.png b/docs/_static/ide-atom-platformio.png index b4764138..f133855c 100644 Binary files a/docs/_static/ide-atom-platformio.png and b/docs/_static/ide-atom-platformio.png differ diff --git a/docs/ide/atom.rst b/docs/ide/atom.rst index 97ec1982..cbac0e2c 100644 --- a/docs/ide/atom.rst +++ b/docs/ide/atom.rst @@ -14,11 +14,9 @@ PlatformIO IDE for Atom ======================= -PlatformIO IDE for `Atom `_ is the missing integrated -development environment which provides comprehensive facilities -for IoT development: +PlatformIO IDE is the next generation integrated development environment for IoT: -* Cross-platform builder without external dependencies to the system +* Cross-platform code builder without external dependencies to the system software: - 200+ embedded boards @@ -26,48 +24,41 @@ for IoT development: - 10+ frameworks * C/C++ Intelligent code completion -* C/C++ Smart code linter +* C/C++ Smart code linter for super-fast coding * Library Manager for the hundreds popular libraries -* Built-in Terminal with :ref:`PlatformIO CLI ` (``pio``, ``platformio``) +* Multi-projects workflow with multiple panes +* Multiple panes +* Themes support with dark and light colors +* Serial Port Monitor +* Built-in Terminal with :ref:`PlatformIO CLI ` tool (``pio``, ``platformio``) -Atom is a source code editor that's modern, approachable, -yet hackable to the core—a tool you can customize to do anything but also use -productively without ever touching a config file. +PlatformIO IDE is based on GitHub's `Atom `_ source +code editor that's modern, approachable, yet hackable to the core; a tool you +can customize to do anything but also use productively without ever touching a +config file. -.. warning:: - - PlatformIO IDE is **in beta testing**. Please report all issues to - `PlatformIO IDE issues tracker `_. .. contents:: -Requirements ------------- - -The only one requirement is `Python Interpreter `_. -PlatformIO is written in Python and works on Mac OS X, Linux, Windows OS and -ARM-based credit-card sized computers (Raspberry Pi, BeagleBone, CubieBoard). - Installation ------------ -:Python: +1. Download and install Atom source code editor - Python is installed on Mac OS X and Linux OS by default. The only **Windows Users** - should install it manually. Please `Download the latest Python 2.7.x `_ - and install it. **DON'T FORGET** to select ``Add python.exe to Path`` feature on the - "Customize" stage, otherwise ``python`` command will not be available. + - `Download for Mac `_ + - `Download for Windows `_ + - `Download .deb `_ + - `Download .rpm `_ + - `Other platforms `_ -:Atom: Download and install `Atom `_ source code editor -:PlatformIO IDE: +2. Open Atom Package Manager and search for `platformio-ide `_ - Install `platformio-ide `_ package - using: + - **Mac OS X**: ``Menu: Atom > Preferences > Install`` + - **Windows**: ``Menu: File > Settings > Install`` + - **Linux**: ``Menu: Edit > Preferences > Install`` - - **Mac OS X**: ``Menu: Atom > Preferences > Install`` - - **Windows**: ``Menu: File > Settings > Install`` - - **Linux**: ``Menu: Edit > Preferences > Install`` +.. image:: ../_static/ide-atom-platformio-install.png User Guide ---------- @@ -83,8 +74,58 @@ new menu item named ``Menu: PlatformIO`` (after ``Menu: Help`` item). .. image:: ../_static/ide-atom-platformio-menu-item.png -Building / Uploading / etc. -~~~~~~~~~~~~~~~~~~~~~~~~~~~ +PlatformIO Toolbar +~~~~~~~~~~~~~~~~~~ + + +PlatformIO IDE Toolbar contains the quick access button to the popular commands. +Each button contains hint (delay mouse on it). + +.. image:: ../_static/ide-atom-platformio-toolbar.png + +* PlatformIO: Build +* PlatformIO: Upload +* PlatformIO: Clean +* Toggle build panel +* || +* New File +* Add/Open Project Folder... +* Find in Project... +* || +* Terminal +* Serial Ports +* Serial Monitor +* || +* Settings +* PlatformIO Documentation + +.. _ide_atom_quickstart: + +Quickstart +~~~~~~~~~~ + +:Step 1: + + Create empty directory for the future project. Add it to PlatformIO IDE + using (folder) button on the Toolbar or ``Menu: File > Add Project + Folder...`` + +:Step 2: + + Initialize new PlatformIO based project using ``Menu: PlatformIO > + Initialize new Project (or update existing)`` and select boards. + Put your source code ``*.h, *.c, *.cpp, *.S, *.ino, etc``. files to ``src`` + directory. + +:Step 3: + + Process the project environments. More details :ref:`ide_atom_building_targets`. + + +.. _ide_atom_building_targets: + +Building / Uploading / Targets +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * ``cmd-alt-b`` / ``ctrl-alt-b`` / ``f9`` builds project without auto-uploading. * ``cmd-alt-u`` / ``ctrl-alt-u`` builds and uploads (if no errors). @@ -113,39 +154,35 @@ Terminal and run ``clang --version``. If ``clang`` is not installed, then instal - **Other Systems**: Download the latest `Clang for the other systems `_. .. warning:: - The libraries which are added, installed or used in the project - after initializing process will not be reflected in code completion. To fix - it you need to reinitialize project using ``Menu: PlatformIO > Initialize new Project (or update existing)``. + The libraries which are added/installed after initializing process will + not be reflected in code linter. You need ``Menu: PlatformIO > + Rebuild C/C++ Project Index (Autocomplete, Linter)``. Code linter ~~~~~~~~~~~ -PlatformIO IDE uses PlatformIO's pre-built GCC toolchains for code linting. You -can customize it in ``.gcc-flags.json`` which will be generated for the selected -board in the project directory using +PlatformIO IDE uses PlatformIO's pre-built GCC toolchains for code linting. The +settings for Linter are located in ``.gcc-flags.json``. This file will be +automatically created and preconfigured when you initialize project using ``Menu: PlatformIO > Initialize new Project (or update existing)``. .. warning:: - The libraries which are added, installed or used in the project - after initializing process will not be reflected in code linter. To fix - it you need to reinitialize project using ``Menu: PlatformIO > Initialize new Project (or update existing)``. + The libraries which are added/installed after initializing process will + not be reflected in code linter. You need ``Menu: PlatformIO > + Rebuild C/C++ Project Index (Autocomplete, Linter)``. + + +.. error:: + If you have error like ``linter-gcc: Executable not found`` and + ``"***/.platformio/packages/toolchain-atmelavr/bin/avr-g++" not found`` + please ``Menu: PlatformIO > Initialize new Project (or update existing)``. Install Shell Commands ~~~~~~~~~~~~~~~~~~~~~~ To install ``platformio`` and ``pio`` shell commands please use ``Menu: PlatformIO > Install Shell Commands``. It will allow you to call PlatformIO from -other process, terminals and etc. - -Serial Monitor -~~~~~~~~~~~~~~ - -Serial Monitor was temporary disabled in PlatformIO IDE 0.2.1. See -`issue #17 `_. - -Temporary solution is to ``Menu: PlatformIO > Install Shell Commands`` and use -:ref:`cmd_serialports_monitor` from system Terminal application (not built-in in -PlatformIO IDE). +other process, terminal and etc. Known issues ~~~~~~~~~~~~ diff --git a/docs/userguide/cmd_init.rst b/docs/userguide/cmd_init.rst index 5a4d88a2..dace0f91 100644 --- a/docs/userguide/cmd_init.rst +++ b/docs/userguide/cmd_init.rst @@ -35,7 +35,6 @@ This command will create: * :ref:`projectconf` * ``src`` - a source directory. Put your source files here * ``lib`` - a directory for the project specific (private) libraries. - PlatformIO will compile them to static libraries and link to executable file * ``.travis.yml`` configuration file (template) for Continuous Integration with :ref:`ci_travis` diff --git a/platformio/__init__.py b/platformio/__init__.py index 234572c2..4f8be12c 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (2, 8, 2) +VERSION = (2, 8, 3) __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/builder/tools/piomisc.py b/platformio/builder/tools/piomisc.py index 352c3ff5..dc768ba1 100644 --- a/platformio/builder/tools/piomisc.py +++ b/platformio/builder/tools/piomisc.py @@ -116,8 +116,10 @@ def ConvertInoToCpp(env): def delete_tmpcpp_file(file_): try: remove(file_) - except WindowsError: # pylint: disable=undefined-variable - pass + except: # pylint: disable=bare-except + if isfile(file_): + print ("Warning: Could not remove temporary file '%s'. " + "Please remove it manually." % file_) ino_nodes = (env.Glob(join("$PROJECTSRC_DIR", "*.ino")) + env.Glob(join("$PROJECTSRC_DIR", "*.pde"))) @@ -214,6 +216,9 @@ def DumpIDEData(env): return { "defines": get_defines(), "includes": get_includes(), + "cc_flags": env.subst("$SHCFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"), + "cxx_flags": env.subst( + "$SHCXXFLAGS $SHCCFLAGS $CPPFLAGS $_CPPDEFFLAGS"), "cxx_path": where_is_program( env.subst("$CXX"), env.subst("${ENV['PATH']}")) } diff --git a/platformio/builder/tools/platformio.py b/platformio/builder/tools/platformio.py index 7ecfa34e..6a2eb3b5 100644 --- a/platformio/builder/tools/platformio.py +++ b/platformio/builder/tools/platformio.py @@ -185,7 +185,7 @@ def BuildFrameworks(env, frameworks): if not frameworks or "uploadlazy" in COMMAND_LINE_TARGETS: return - board_frameworks = env.get("BOARD_OPTIONS", {}).get("frameworks") + board_frameworks = env.get("BOARD_OPTIONS", {}).get("frameworks", []) if frameworks == ["platformio"]: if board_frameworks: frameworks.insert(0, board_frameworks[0]) diff --git a/platformio/ide/tpls/atom/.gcc-flags.json.tpl b/platformio/ide/tpls/atom/.gcc-flags.json.tpl index 3d613580..3fac39c7 100644 --- a/platformio/ide/tpls/atom/.gcc-flags.json.tpl +++ b/platformio/ide/tpls/atom/.gcc-flags.json.tpl @@ -1,7 +1,7 @@ { "execPath": "{{ cxx_path.replace("\\", "/") }}", - "gccDefaultCFlags": "-Wall -Wno-cpp -fsyntax-only -D{{ ' -D'.join(defines) }}", - "gccDefaultCppFlags": "-Wall -Wno-cpp -fsyntax-only -D{{ ' -D'.join(defines) }}", + "gccDefaultCFlags": "-fsyntax-only {{ cc_flags.replace(' -MMD ', ' ') }}", + "gccDefaultCppFlags": "-fsyntax-only {{ cxx_flags.replace(' -MMD ', ' ') }}", "gccErrorLimit": 15, "gccIncludePaths": "{{ ','.join(includes).replace("\\", "/") }}", "gccSuppressWarnings": false diff --git a/platformio/platforms/atmelsam.py b/platformio/platforms/atmelsam.py index a5b64beb..0c604dc2 100644 --- a/platformio/platforms/atmelsam.py +++ b/platformio/platforms/atmelsam.py @@ -40,6 +40,10 @@ class AtmelsamPlatform(BasePlatform): "alias": "framework" }, + "framework-mbed": { + "alias": "framework" + }, + "tool-bossac": { "alias": "uploader" },