Perform reset AFTER flash, not before.

qa/reset_fixes
Rick Carlino 2020-04-12 16:07:13 -05:00
parent f463c698e0
commit 626fb4e5a4
3 changed files with 7 additions and 8 deletions

View File

@ -1 +1 @@
9.2.2-rc15
9.2.2-rc16

View File

@ -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

View File

@ -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