From e9f18e29c2028bfd8d2a59e19569c782e2fb0c15 Mon Sep 17 00:00:00 2001 From: Peter M Date: Thu, 14 Mar 2024 14:11:11 +0100 Subject: [PATCH] allow port "auto" config - that enables auto detect of port Existing behaviour is kept - no defaults changed. Signed-off-by: Peter M --- lib/mix/tasks/esp32_flash.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/mix/tasks/esp32_flash.ex b/lib/mix/tasks/esp32_flash.ex index b432b95..efc2749 100644 --- a/lib/mix/tasks/esp32_flash.ex +++ b/lib/mix/tasks/esp32_flash.ex @@ -39,8 +39,6 @@ defmodule Mix.Tasks.Atomvm.Esp32.Flash do tool_args = [ "--chip", chip, - "--port", - port, "--baud", baud, "--before", @@ -59,6 +57,8 @@ defmodule Mix.Tasks.Atomvm.Esp32.Flash do "#{Project.config()[:app]}.avm" ] + tool_args = if port == "auto", do: tool_args, else: ["--port", port] ++ tool_args + tool_full_path = get_esptool_path(idf_path) System.cmd(tool_full_path, tool_args, stderr_to_stdout: true, into: IO.stream(:stdio, 1)) end