Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tdh8 duplex adds off option #789

Merged
merged 1 commit into from
Oct 21, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This value is larger than can be stored in the field, so it gets truncated. It also looks like an overflow value. What does the radio really want here? 0? 0xFFFF?

else:
_mem.txfreq = mem.freq / 10

Expand Down
Loading