From 21b5aa1ac83b418e6c1e9626ff9167d88aa36f16 Mon Sep 17 00:00:00 2001 From: Connor Rigby Date: Wed, 10 Jul 2019 12:25:28 -0700 Subject: [PATCH] Allow emergency_lock while in boot and configuration states --- farmbot_firmware/lib/farmbot_firmware.ex | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/farmbot_firmware/lib/farmbot_firmware.ex b/farmbot_firmware/lib/farmbot_firmware.ex index c62152bf..83069939 100644 --- a/farmbot_firmware/lib/farmbot_firmware.ex +++ b/farmbot_firmware/lib/farmbot_firmware.ex @@ -389,12 +389,12 @@ defmodule FarmbotFirmware do # EmergencyLock should be ran immediately def handle_command({tag, {:command_emergency_lock, []}} = code, {pid, _ref}, state) do - {:reply, {:ok, tag}, %{state | command_queue: [{pid, code} | state.command_queue]}, 0} + {:reply, {:ok, tag}, %{state | command_queue: [{pid, code}], configuration_queue: []}, 0} end # EmergencyUnLock should be ran immediately def handle_command({tag, {:command_emergency_unlock, []}} = code, {pid, _ref}, state) do - {:reply, {:ok, tag}, %{state | command_queue: [{pid, code} | state.command_queue]}, 0} + {:reply, {:ok, tag}, %{state | command_queue: [{pid, code}], configuration_queue: []}, 0} end # If not in an acceptable state, return an error immediately.