Skip to content

Commit eb94b8f

Browse files
committed
Add port "auto" config - that enables auto detect of port
similar to atomvm/exatomvm#12 Existing behaviour is kept - no defaults changed. Signed-off-by: Peter M <petermm@gmail.com>
1 parent 5ee35e0 commit eb94b8f

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/atomvm_esp32_flash_provider.erl

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,10 +142,15 @@ maybe_convert_string(I) ->
142142
%% @private
143143
do_flash(ProjectApps, EspTool, Chip, Port, Baud, Offset) ->
144144
[ProjectAppAVM | _] = [get_avm_file(ProjectApp) || ProjectApp <- ProjectApps],
145+
Portparam =
146+
case Port of
147+
"auto" -> "";
148+
_ -> ["--port ", Port]
149+
end,
145150
Cmd = lists:join(" ", [
146151
EspTool,
147152
"--chip", Chip,
148-
"--port", Port,
153+
Portparam,
149154
"--baud", integer_to_list(Baud),
150155
"--before", "default_reset",
151156
"--after", "hard_reset",

0 commit comments

Comments
 (0)