Skip to content

Commit

Permalink
Tdh8 duplex adds off option
Browse files Browse the repository at this point in the history
Related to bug #10756
  • Loading branch information
Sandmann34 authored and kk7ds committed Oct 21, 2023
1 parent fc76242 commit f7ed0e1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion chirp/drivers/tdh8.py
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ def get_features(self):
"->Tone",
"DTCS->DTCS"]
rf.valid_power_levels = TX_POWER
rf.valid_duplexes = ["", "-", "+", "split"]
rf.valid_duplexes = ["", "-", "+", "split", "off"]
rf.valid_modes = ["FM", "NFM"]
rf.valid_tuning_steps = STEPS

Expand Down Expand Up @@ -851,6 +851,9 @@ def get_memory(self, number):
if int(_mem.rxfreq) == int(_mem.txfreq):
mem.duplex = ""
mem.offset = 0
elif int(_mem.txfreq) == 66666665 and int(_mem.rxfreq) != 66666665:
mem.offset = 0
mem.duplex = 'off'
else:
mem.duplex = int(_mem.rxfreq) > int(_mem.txfreq) and "-" or "+"
mem.offset = abs(int(_mem.rxfreq) - int(_mem.txfreq)) * 10
Expand Down Expand Up @@ -1018,6 +1021,8 @@ def set_memory(self, mem):
_mem.txfreq = (mem.freq + mem.offset) / 10
elif mem.duplex == "-":
_mem.txfreq = (mem.freq - mem.offset) / 10
elif mem.duplex == 'off':
_mem.txfreq = 166666665
else:
_mem.txfreq = mem.freq / 10

Expand Down

0 comments on commit f7ed0e1

Please sign in to comment.