[chirp_devel] [PATCH 1 of 1] Support masked memories (affect whole ft8x7 family)
Marco Filippi IZ3GME
Thu Apr 5 10:11:46 PDT 2012
# HG changeset patch
# User Marco Filippi <iz3gme.marco at gmail.com>
# Date 1333645315 -7200
# Node ID a4675e65023831ea5b050c4fc46b445deb78f4a3
# Parent 69c66e533b3ada0f8f9b7ca9336fb560fd899604
Support masked memories (affect whole ft8x7 family)
diff -r 69c66e533b3a -r a4675e650238 chirp/ft817.py
--- a/chirp/ft817.py mer apr 04 18:30:58 2012 -0700
+++ b/chirp/ft817.py gio apr 05 19:01:55 2012 +0200
@@ -366,24 +366,31 @@
def _get_normal(self, number):
_mem = self._memobj.memory[number-1]
used = (self._memobj.visible[(number-1)/8] >> (number-1)%8) & 0x01
+ valid = (self._memobj.filled[(number-1)/8] >> (number-1)%8) & 0x01
mem = chirp_common.Memory()
mem.number = number
if not used:
mem.empty = True
+ if not valid:
+ mem.empty = True
return mem
return self._get_memory(mem, _mem)
def _set_normal(self, mem):
_mem = self._memobj.memory[mem.number-1]
+ wasused = (self._memobj.visible[(mem.number-1)/8] >> (mem.number-1)%8) & 0x01
+ wasvalid = (self._memobj.filled[(mem.number-1)/8] >> (mem.number-1)%8) & 0x01
+
if mem.empty:
if mem.number == 1:
# as Dan says "yaesus are not good about that :("
# if you ulpoad an empty image you can brick your radio
raise Exception("Sorry, can't delete first memory")
+ if wasvalid and not wasused:
+ self._memobj.filled[(mem.number-1)/8] &= ~ (1 << (mem.number-1)%8)
self._memobj.visible[(mem.number-1)/8] &= ~ (1 << (mem.number-1)%8)
- self._memobj.filled[(mem.number-1)/8] = self._memobj.visible[(mem.number-1)/8]
return
self._memobj.visible[(mem.number-1)/8] |= 1 << (mem.number-1)%8
More information about the chirp_devel
mailing list