diff --git a/chirp/drivers/retevis_rt21.py b/chirp/drivers/retevis_rt21.py index b060eea0..abc346e9 100644 --- a/chirp/drivers/retevis_rt21.py +++ b/chirp/drivers/retevis_rt21.py @@ -839,8 +839,16 @@ def get_raw_memory(self, number): return repr(self._memobj.memory[number - 1]) def _get_tone(self, _mem, mem): + # 0xA662 = 662R = 1010 0... + # 0xA9DC = 734R = 1010 1... + # 0x29D3 = 723N - 0010 1... + def _get_dcs(val): - code = int("%03o" % (val & 0x07FF)) + if val & 0x0800: + code = int("%03o" % (val & 0x07FF)) + else: + # 0x0800 means code is stored in hex instead of ocal (?!) + code = int("%03x" % (val & 0x07FF)) pol = (val & 0x8000) and "R" or "N" return code, pol