Perform reset AFTER flash, not before.
parent
f463c698e0
commit
626fb4e5a4
|
@ -323,8 +323,10 @@ defmodule FarmbotCore.Asset do
|
|||
# the DB / API.
|
||||
sorted = CriteriaRetriever.run(point_group)
|
||||
|> sort_points(sort_by || "xy_ascending")
|
||||
|> Enum.map(&Map.fetch!(&1, :id))
|
||||
|> Enum.map(fn point -> point.id end)
|
||||
|
||||
count = Enum.count(sorted)
|
||||
Logger.debug("There are #{count} points. #{inspect(sorted)}")
|
||||
%{ point_group | point_ids: sorted }
|
||||
other ->
|
||||
# Swallow all other errors
|
||||
|
|
|
@ -29,8 +29,6 @@ defmodule Avrdude do
|
|||
"-Uflash:w:#{hex_path}:i"
|
||||
]
|
||||
|
||||
# call the function for resetting the line before executing avrdude.
|
||||
call_reset_fun(reset_fun)
|
||||
FarmbotCore.Logger.info(3, "Writing firmware to MCU...")
|
||||
|
||||
FarmbotCore.Logger.debug(
|
||||
|
@ -50,12 +48,11 @@ defmodule Avrdude do
|
|||
{a, exit_code} = result
|
||||
FarmbotCore.Logger.info(3, inspect(a))
|
||||
FarmbotCore.Logger.info(3, "Exit code #{exit_code}")
|
||||
# Manually override errors while debugging.
|
||||
{a, 0}
|
||||
else
|
||||
result
|
||||
end
|
||||
|
||||
call_reset_fun(reset_fun)
|
||||
|
||||
result
|
||||
end
|
||||
|
||||
def call_reset_fun(reset_fun) do
|
||||
|
|
Loading…
Reference in New Issue