[chirp_devel] [PATCH] [FT857] Fix PMS memories used/filled bits indexing

Marco Filippi IZ3GME
Wed Apr 25 12:49:08 PDT 2012


# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1335383115 -7200
# Node ID 1ef8b05d8bb797229553e6c8059b1682d7c87d23
# Parent  ac2c9fd655ba64fbebe389c79fed6f655c8ca041
[FT857] Fix PMS memories used/filled bits indexing
Fixes second part of #131

diff -r ac2c9fd655ba -r 1ef8b05d8bb7 chirp/ft857.py
--- a/chirp/ft857.py	mer apr 25 11:22:48 2012 -0700
+++ b/chirp/ft857.py	mer apr 25 21:45:15 2012 +0200
@@ -66,11 +66,11 @@
 
 #seekto 0x4a9;
 u8 visible[25];
-u16 pmsvisible;
+ul16 pmsvisible;
 
 #seekto 0x4c4;
 u8 filled[25];
-u16 pmsfilled;
+ul16 pmsfilled;
 
 #seekto 0x4df;
 struct mem_struct memory[200];
@@ -224,7 +224,7 @@
         mem.number = self.SPECIAL_PMS[number]
         mem.extd_number = number
 
-	bitindex = -38 - mem.number
+	bitindex = 47 + mem.number
         used = (self._memobj.pmsvisible >> bitindex) & 0x01
         valid = (self._memobj.pmsfilled >> bitindex) & 0x01
         if os.getenv("CHIRP_DEBUG"):
@@ -249,7 +249,7 @@
     def _set_special_pms(self, mem):
         cur_mem = self._get_special_pms(self.SPECIAL_MEMORIES_REV[mem.number])
 
-	bitindex = -38 - mem.number
+	bitindex = 47 + mem.number
         wasused = (self._memobj.pmsvisible >> bitindex) & 0x01
         wasvalid = (self._memobj.pmsfilled >> bitindex) & 0x01
 



More information about the chirp_devel mailing list