[chirp_devel] [PATCH 1 of 1] [vx6] Fix valid/used flag logic so new memories are valid and unmasked. #685

Tom Hayward
Wed Mar 13 09:02:18 PDT 2013


# HG changeset patch
# User Tom Hayward <tom at tomh.us>
# Date 1363190530 25200
# Node ID e98eab02522373bbb35cae6f7f56c73792c323af
# Parent  fa1ac806391ea053a903ca6dd64eb5508b3b88c0
[vx6] Fix valid/used flag logic so new memories are valid and unmasked. #685

diff -r fa1ac806391e -r e98eab025223 chirp/vx6.py
--- a/chirp/vx6.py	Wed Mar 13 11:20:02 2013 +1100
+++ b/chirp/vx6.py	Wed Mar 13 09:02:10 2013 -0700
@@ -141,7 +141,8 @@
         return rf
 
     def get_raw_memory(self, number):
-        return repr(self._memobj.memory[number-1])
+        return repr(self._memobj.memory[number-1]) + \
+            repr(self._memobj.flags[(number-1)/2])
 
     def get_memory(self, number):
         _mem = self._memobj.memory[number-1]
@@ -197,7 +198,8 @@
         valid = _flag["%s_valid" % nibble]
 
         # initialize new channel to safe defaults
-        if not mem.empty and not used:
+        if not mem.empty and not valid:
+            _flag["%s_valid" % nibble] = True
             _mem.unknown11 = 0
             _mem.step_changed = 0
             _mem.cpu_shifted = 0



More information about the chirp_devel mailing list