diff --git a/HISTORY.rst b/HISTORY.rst index 2b10f752..9a9b8145 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -10,11 +10,12 @@ PlatformIO 4.0 * **Project Management** - Unified workspace storage (`workspace_dir `__ -> ``.pio``) for PlatformIO Build System, Library Manager, and other internal services (`issue #1778 `_) + - Switched to workspace ``.pio/build`` folder for build artifacts instead of ``.pioenvs`` - Share common (global) options between build environments using ``[env]`` section in `"platformio.ini" (Project Configuration File) `__ (`issue #1643 `_) - Include external configuration files in `"platformio.ini" (Project Configuration File) `__ with `extra_configs `__ option (`issue #1590 `_) - Override default `"platformio.ini" (Project Configuration File) `__ with a custom using ``-c, --project-conf`` option for `platformio run `__, `platformio debug `__, or `platformio test `__ commands (`issue #1913 `_) - Custom project ``***_dir`` options declared in "platformio" section of `"platformio.ini" (Project Configuration File) `__ have higher priority than `Environment variables `__ - - Use workspace ``.pio/build`` folder for build artifacts instead of ``.pioenvs`` + - Added new `monitor_flags `__ option to `"platformio.ini" (Project Configuration File) `__ which allows passing extra flags and options to `platformio device monitor `__ command (`issue #2165 `_) * **Library Management** @@ -22,7 +23,7 @@ PlatformIO 4.0 - Install all project dependencies declared via `lib_deps `__ option using a simple `platformio lib install `__ command (`issue #2147 `_) - Use isolated library dependency storage per project build environment (`issue #1696 `_) - Override default source and include directories for a library via `library.json `__ manifest using ``includeDir`` and ``srcDir`` fields - - Use workspace ``.pio/libdeps`` folder for project dependencies instead of ``.piolibdeps`` + - Switched to workspace ``.pio/libdeps`` folder for project dependencies instead of ``.piolibdeps`` * **Infrastructure** @@ -43,7 +44,7 @@ PlatformIO 3.0 * Support custom CMake configuration for CLion IDE using ``CMakeListsUser.txt`` file * Fixed an issue with hardcoded C stadard version when generating project for CLion IDE (`issue #2527 `_) -* Fixed "systemd-udevd" warnings in `99-platformio-udev.rules `__ (`issue #2442 `_) +* Fixed "systemd-udevd" warnings in `99-platformio-udev.rules `__ (`issue #2442 `_) * Fixed an issue when ``-U`` in ``build_flags`` does not remove macro previously defined via ``-D`` flag (`issue #2508 `_) * Fixed an issue for Project Generator when include path search order is inconsistent to what passed to the compiler (`issue #2509 `_) diff --git a/docs b/docs index 401b1447..158fb3c0 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit 401b1447a3667bf256d6d13718bc8454c7f76888 +Subproject commit 158fb3c0484586ef4b87dbd6ef7d780cbe74786c diff --git a/platformio/commands/device.py b/platformio/commands/device.py index e75660ea..9f80062e 100644 --- a/platformio/commands/device.py +++ b/platformio/commands/device.py @@ -162,16 +162,20 @@ def device_list( # pylint: disable=too-many-branches "--environment", help="Load configuration from `platformio.ini` and specified environment") def device_monitor(**kwargs): # pylint: disable=too-many-branches + custom_monitor_flags = [] try: - monitor_options = get_project_options(kwargs['project_dir'], - kwargs['environment']) - if monitor_options: + env_options = get_project_options(kwargs['project_dir'], + kwargs['environment']) + if "monitor_flags" in env_options: + custom_monitor_flags = ProjectConfig.parse_multi_values( + env_options['monitor_flags']) + if env_options: for k in ("port", "speed", "rts", "dtr"): k2 = "monitor_%s" % k if k == "speed": k = "baud" - if kwargs[k] is None and k2 in monitor_options: - kwargs[k] = monitor_options[k2] + if kwargs[k] is None and k2 in env_options: + kwargs[k] = env_options[k2] if k != "port": kwargs[k] = int(kwargs[k]) except exception.NotPlatformIOProject: @@ -182,11 +186,13 @@ def device_monitor(**kwargs): # pylint: disable=too-many-branches if len(ports) == 1: kwargs['port'] = ports[0]['port'] - sys.argv = ["monitor"] + sys.argv = ["monitor"] + custom_monitor_flags for k, v in kwargs.items(): if k in ("port", "baud", "rts", "dtr", "environment", "project_dir"): continue k = "--" + k.replace("_", "-") + if k in custom_monitor_flags: + continue if isinstance(v, bool): if v: sys.argv.append(k) @@ -196,6 +202,8 @@ def device_monitor(**kwargs): # pylint: disable=too-many-branches else: sys.argv.extend([k, str(v)]) + print(sys.argv) + try: miniterm.main( default_port=kwargs['port'], diff --git a/platformio/project/config.py b/platformio/project/config.py index 7b5baac0..d67df78b 100644 --- a/platformio/project/config.py +++ b/platformio/project/config.py @@ -86,6 +86,7 @@ KNOWN_ENV_OPTIONS = [ "monitor_speed", "monitor_rts", "monitor_dtr", + "monitor_flags", # Library "lib_deps",