# HG changeset patch # User Jim Unroe # Date 1382296133 14400 # Node ID 2ca24da3034f0edc27954d5c7f0961fe1c1ad9df # Parent f326c0deb8f31d855f0d933bbbf4b50fd3a03352 [uv-b5] fix for proper display of STEP setting value update memory structure to define 'step' add Step setting to allow user to edit the STEP value fix for Bug #1179 diff -r f326c0deb8f3 -r 2ca24da3034f chirp/uvb5.py --- a/chirp/uvb5.py Fri Oct 18 14:36:59 2013 -0500 +++ b/chirp/uvb5.py Sun Oct 20 15:08:53 2013 -0400 @@ -38,7 +38,8 @@ highpower:1, revfreq:1, duplex:2; - u8 unknown[4]; + u8 step; + u8 unknown[3]; }; #seekto 0x0000; @@ -214,6 +215,7 @@ do_status(radio, "to", i) DUPLEX = ["", "-", "+", 'off', "split"] +STEPS = [5.00, 6.25, 10.0, 12.5, 20.0, 25.0] CHARSET = "0123456789- ABCDEFGHIJKLMNOPQRSTUVWXYZ/_+*" SPECIALS = { "VFO1": -2, @@ -251,7 +253,8 @@ rf.valid_power_levels = POWER_LEVELS rf.has_ctone = True rf.has_bank = False - rf.has_tuning_step = False + rf.has_tuning_step = True + rf.valid_tuning_steps = STEPS rf.memory_bounds = (1, 99) return rf @@ -337,6 +340,7 @@ self._decode_tone(_mem.txtone, _mem.txpol), self._decode_tone(_mem.rxtone, _mem.rxpol)) + mem.tuning_step = STEPS[_mem.step] or STEPS[0] mem.duplex = DUPLEX[_mem.duplex] mem.mode = _mem.isnarrow and "NFM" or "FM" mem.skip = "" if _mem.scanadd else "S" @@ -392,7 +396,7 @@ _mem.duplex = DUPLEX.index("-") _mem.offset = _mem.freq elif mem.duplex == "split": - diff = mem.offset - mem.freq + diff = mem.offset - mem.freq _mem.duplex = DUPLEX.index("-") if diff < 0 else DUPLEX.index("+") _mem.offset = abs(diff) / 10 else: @@ -403,6 +407,7 @@ self._encode_tone(_mem, 'tx', *tx) self._encode_tone(_mem, 'rx', *rx) + _mem.step = STEPS.index(mem.step) _mem.isnarrow = mem.mode == "NFM" _mem.scanadd = mem.skip == "" _mem.highpower = mem.power == POWER_LEVELS[1]