From ce066417e91f2ea77dcfb797405cca216a4062f0 Mon Sep 17 00:00:00 2001 From: Ivan Kravets Date: Mon, 23 Jan 2017 00:13:58 +0200 Subject: [PATCH] Add new options ``--monitor-rts`` and ``--monitor-dtr`` to `pio test` command --- HISTORY.rst | 3 ++- docs | 2 +- examples | 2 +- platformio/__init__.py | 2 +- platformio/commands/device.py | 4 ++-- platformio/commands/remote.py | 4 ++-- platformio/commands/test.py | 15 ++++++++++++++- platformio/pioplus.py | 2 +- 8 files changed, 24 insertions(+), 10 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index a482bbf4..e52ded32 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -19,7 +19,8 @@ PlatformIO 3.0 * Show detailed info about a library using `pio lib show `__ command (`issue #430 `_) -* Added new option ``--no-reset`` to `pio test `__ +* Added new options ``--no-reset``, ``--monitor-rts`` and ``--monitor-dtr`` + to `pio test `__ command (allows to avoid automatic board's auto-reset when gathering test results) * Added support for templated methods in ``*.ino to *.cpp`` converter (`pull #858 `_) diff --git a/docs b/docs index 80a1f6f6..b1a46aac 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 80a1f6f621fef3b0b9f515eccad0454b6785b46a +Subproject commit b1a46aaca7f6b1d9cc1abd1998506f8675ae4151 diff --git a/examples b/examples index 463f8557..e6e0c19b 160000 --- a/examples +++ b/examples @@ -1 +1 @@ -Subproject commit 463f855761f0af2657e597f6a3cf1b59daecc3fd +Subproject commit e6e0c19bd1149ae7b5e5b8f72c9ccc98f1690441 diff --git a/platformio/__init__.py b/platformio/__init__.py index f62f00ab..ae264f5e 100644 --- a/platformio/__init__.py +++ b/platformio/__init__.py @@ -14,7 +14,7 @@ import sys -VERSION = (3, 3, "0a5") +VERSION = (3, 3, "0a6") __version__ = ".".join([str(s) for s in VERSION]) __title__ = "platformio" diff --git a/platformio/commands/device.py b/platformio/commands/device.py index bf5499ae..cba2054c 100644 --- a/platformio/commands/device.py +++ b/platformio/commands/device.py @@ -61,12 +61,12 @@ def device_list(json_output): @click.option( "--rts", default=None, - type=click.Choice(["0", "1"]), + type=click.IntRange(0, 1), help="Set initial RTS line state") @click.option( "--dtr", default=None, - type=click.Choice(["0", "1"]), + type=click.IntRange(0, 1), help="Set initial DTR line state") @click.option("--echo", is_flag=True, help="Enable local echo, default=Off") @click.option( diff --git a/platformio/commands/remote.py b/platformio/commands/remote.py index 1d57d913..b3d4cbed 100644 --- a/platformio/commands/remote.py +++ b/platformio/commands/remote.py @@ -147,12 +147,12 @@ def device_list(json_output): @click.option( "--rts", default=None, - type=click.Choice(["0", "1"]), + type=click.IntRange(0, 1), help="Set initial RTS line state") @click.option( "--dtr", default=None, - type=click.Choice(["0", "1"]), + type=click.IntRange(0, 1), help="Set initial DTR line state") @click.option("--echo", is_flag=True, help="Enable local echo, default=Off") @click.option( diff --git a/platformio/commands/test.py b/platformio/commands/test.py index 99760db6..d63374c4 100644 --- a/platformio/commands/test.py +++ b/platformio/commands/test.py @@ -37,7 +37,20 @@ from platformio.pioplus import pioplus_call resolve_path=True)) @click.option("--without-building", is_flag=True) @click.option("--without-uploading", is_flag=True) -@click.option("--no-reset", is_flag=True) +@click.option( + "--no-reset", + is_flag=True, + help="Disable software reset via Serial.DTR/RST") +@click.option( + "--monitor-rts", + default=None, + type=click.IntRange(0, 1), + help="Set initial RTS line state for Serial Monitor") +@click.option( + "--monitor-dtr", + default=None, + type=click.IntRange(0, 1), + help="Set initial DTR line state for Serial Monitor") @click.option("--verbose", "-v", is_flag=True) def cli(*args, **kwargs): # pylint: disable=unused-argument pioplus_call(sys.argv[1:]) diff --git a/platformio/pioplus.py b/platformio/pioplus.py index 0008c178..91a7447b 100644 --- a/platformio/pioplus.py +++ b/platformio/pioplus.py @@ -27,7 +27,7 @@ PACKAGE_DEPS = { }, "tool": { "name": "tool-pioplus", - "requirements": ">=0.6.9,<2" + "requirements": ">=0.6.10,<2" } }