Skip to content

Commit

Permalink
Only swap A/B if TF SET is turned on
Browse files Browse the repository at this point in the history
  • Loading branch information
tonyc committed Nov 18, 2023
1 parent e5a435f commit 7c4e70e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/open890/radio_state.ex
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,11 @@ defmodule Open890.RadioState do
def dispatch(%__MODULE__{} = state, "TS" <> _ = msg) do
tf_set_enabled = Extract.boolean(msg)

state = swap_a_b(state)
state = if tf_set_enabled do
swap_a_b(state)
else
state
end

%{state | tf_set_enabled: tf_set_enabled}
end
Expand Down

0 comments on commit 7c4e70e

Please sign in to comment.