Skip to content
Permalink
Browse files

Allow emergency_lock while in boot and configuration states

  • Loading branch information...
ConnorRigby committed Jul 10, 2019
1 parent f4eabf1 commit 2b089b5a6570debcedf98d41fc3ba8aaa78c1933
Showing with 2 additions and 2 deletions.
  1. +2 −2 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.

0 comments on commit 2b089b5

Please sign in to comment.
You can’t perform that action at this time.