From 13cd09d161c44d7a3365ed9183caefd6f8261373 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Sat, 29 Apr 2017 01:42:23 +0300 Subject: [PATCH] PIO Unified Debugger --- HISTORY.rst | 8 ++++ docs | 2 +- scripts/docspregen.py | 83 +++++++++++++++++++++++++++++++++++++ tests/commands/test_init.py | 2 +- 4 files changed, 93 insertions(+), 2 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index c56a4597..86f9f294 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -7,6 +7,14 @@ PlatformIO 3.0 3.4.0 (2017-??-??) ~~~~~~~~~~~~~~~~~~ +* `PIO Unified Debugger `__ + + - 100+ boards + - Multiple architectures and development platforms + - Zero Configuration + - Compatibility with the popular IDEs: Eclipse, Atom, VSCode, Sublime Text, etc + - Windows, MacOS, Linux (+ARMv6-8) + * Multi-line support for the different options in `Project Configuration File "platformio.ini" `__, such as: ``build_flags``, ``build_unflags``, etc. (`issue #889 `_) diff --git a/docs b/docs index 723f9369..78fb29eb 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 723f9369f5fcc77936b473834abdd4bb6c397806 +Subproject commit 78fb29eb21d2ac7a0382dc3806af89e1176371ad diff --git a/scripts/docspregen.py b/scripts/docspregen.py index e67c9e50..3b1f93d9 100644 --- a/scripts/docspregen.py +++ b/scripts/docspregen.py @@ -48,6 +48,8 @@ def generate_boards(boards): return int(ceil(size / b) * b) assert NotImplemented() + platforms = {m['name']: m['title'] for m in PLATFORM_MANIFESTS} + lines = [] lines.append(""" @@ -56,6 +58,7 @@ def generate_boards(boards): * - ID - Name + - Platform - Microcontroller - Frequency - Flash @@ -66,12 +69,15 @@ def generate_boards(boards): lines.append(""" * - ``{id}`` - `{name} <{url}>`_ + - :ref:`{platform_title} ` - {mcu} - {f_cpu:d} MHz - {rom} Kb - {ram} Kb""".format( id=data['id'], name=data['name'], + platform=data['platform'], + platform_title=platforms[data['platform']], url=data['url'], mcu=data['mcu'].upper(), f_cpu=int(data['fcpu']) / 1000000, @@ -423,11 +429,88 @@ popular embedded boards and IDE. f.write("\n".join(lines)) +def update_debugging(): + vendors = {} + platforms = [] + frameworks = [] + for data in BOARDS: + if not data['debug']: + continue + platforms.append(data['platform']) + frameworks.extend(data['frameworks']) + vendor = data['vendor'] + if vendor in vendors: + vendors[vendor].append(data) + else: + vendors[vendor] = [data] + + lines = [] + # Platforms + lines.append(""".. _debugging_platforms: + +Platforms +--------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description""") + + for manifest in PLATFORM_MANIFESTS: + if manifest['name'] not in platforms: + continue + p = PlatformFactory.newPlatform(manifest['name']) + lines.append( + """ + * - :ref:`platform_{type_}` + - {description}""" + .format(type_=manifest['name'], description=p.description)) + + # Frameworks + lines.append(""" +Frameworks +---------- +.. list-table:: + :header-rows: 1 + + * - Name + - Description""") + for framework in API_FRAMEWORKS: + if framework['name'] not in frameworks: + continue + lines.append(""" + * - :ref:`framework_{name}` + - {description}""".format(**framework)) + + # Boards + lines.append(""" +Boards +------ + +.. note:: + For more detailed ``board`` information please scroll tables below by horizontal. +""") + for vendor, boards in sorted(vendors.iteritems()): + lines.append(str(vendor)) + lines.append("~" * len(vendor)) + lines.append(generate_boards(boards)) + + with open( + join(util.get_source_dir(), "..", "docs", "plus", + "debugging.rst"), "r+") as fp: + content = fp.read() + fp.seek(0) + fp.truncate() + fp.write(content[:content.index(".. _debugging_platforms:")] + + "\n".join(lines)) + + def main(): update_create_platform_doc() update_platform_docs() update_framework_docs() update_embedded_boards() + update_debugging() if __name__ == "__main__": diff --git a/tests/commands/test_init.py b/tests/commands/test_init.py index 3f0cb3d7..6f366f90 100644 --- a/tests/commands/test_init.py +++ b/tests/commands/test_init.py @@ -73,7 +73,7 @@ def test_init_ide_atom(clirunner, validate_cliresult, tmpdir): # switch to NodeMCU result = clirunner.invoke( - cmd_init, ["--ide", "atom", "-b", "nodemcuv2", "-b", "uno"]) + cmd_init, ["--ide", "atom", "-b", "nodemcuv2"]) validate_cliresult(result) validate_pioproject(str(tmpdir)) assert "arduinoespressif" in tmpdir.join(".clang_complete").read()