diff --git a/platformio/project/config.py b/platformio/project/config.py index bf5870c9..c2b072ef 100644 --- a/platformio/project/config.py +++ b/platformio/project/config.py @@ -401,11 +401,22 @@ class ProjectConfigBase: ", ".join(unknown_envs), ", ".join(known_envs) ) - # check envs names for env in known_envs: + # check envs names if not self.ENVNAME_RE.match(env): raise exception.InvalidEnvNameError(env) + # check simultaneous use of `monitor_raw` and `monitor_filters` + if self.get(f"env:{env}", "monitor_raw", False) and self.get( + f"env:{env}", "monitor_filters", None + ): + self.warnings.append( + "The `monitor_raw` and `monitor_filters` options cannot be " + f"used simultaneously for the `{env}` environment in the " + "`platformio.ini` file. The `monitor_filters` option will " + "be disabled to avoid conflicts." + ) + if not silent: for warning in self.warnings: click.secho("Warning! %s" % warning, fg="yellow")