From 0f8a00024b5820fe8cb0b9d05b9ccb72899051a9 Mon Sep 17 00:00:00 2001 From: Sandman34 <304078134@qq.com> Date: Tue, 11 Jul 2023 10:42:13 +0800 Subject: [PATCH] tdh8 add only ch mode --- chirp/drivers/tdh8.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/chirp/drivers/tdh8.py b/chirp/drivers/tdh8.py index 319d31d58..486a6713b 100644 --- a/chirp/drivers/tdh8.py +++ b/chirp/drivers/tdh8.py @@ -106,7 +106,9 @@ u8 save; u8 ligcon; u8 voxdelay; - u8 alarm; + u8 onlychmode:1, + unused:6, + alarm:1; } settings; #seekto 0x0CB8; @@ -1155,8 +1157,8 @@ def _get_settings(self): SYNC_LIST, SYNC_LIST[_settings.sync])) basic.append(rs) - if _settings.lang == 1: - langs = 0 + if _settings.lang in (2, 3): + langs = 1 else: langs = 0 rs = RadioSetting("lang", "Language", @@ -1212,6 +1214,10 @@ def _get_settings(self): RadioSettingValueBoolean(_settings.rxled)) basic.append(rs) + rs = RadioSetting("onlychmode", "Only CH Mode", + RadioSettingValueBoolean(_settings.onlychmode)) + basic.append(rs) + rs = RadioSetting("stopkey1", "SHORT_KEY_TOP", RadioSettingValueList( SHORT_KEY_LIST, SHORT_KEY_LIST[0])) @@ -1995,6 +2001,9 @@ def fm_validate(value): list_val.append(0xFF) lenth_val += 1 self._memobj.group8.group8 = list_val + elif setting == 'lang': + self._memobj.settings.lang = ( + str(element.value) == 'English' and 2 or 1) elif element.value.get_mutable(): setattr(obj, setting, element.value) except Exception: