summaryrefslogtreecommitdiffstats
path: root/libtoprammer/shiftreg_layout.py
diff options
context:
space:
mode:
authorMichael Buesch <mb@bu3sch.de>2011-01-03 19:07:26 +0100
committerMichael Buesch <mb@bu3sch.de>2011-01-03 19:07:26 +0100
commit3578ec21a85a2f1b98291e82ef602bed03c755e3 (patch)
treeab92bf2e6c35714f528add91c103f94d260baf16 /libtoprammer/shiftreg_layout.py
parentdb5ada0fc91e7c26f9771d9bf1ab64172da810b3 (diff)
downloadtoprammer-3578ec21a85a2f1b98291e82ef602bed03c755e3.tar.xz
toprammer-3578ec21a85a2f1b98291e82ef602bed03c755e3.zip
Sort layouts
Signed-off-by: Michael Buesch <mb@bu3sch.de>
Diffstat (limited to 'libtoprammer/shiftreg_layout.py')
-rw-r--r--libtoprammer/shiftreg_layout.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/libtoprammer/shiftreg_layout.py b/libtoprammer/shiftreg_layout.py
index 04d3300..41a134a 100644
--- a/libtoprammer/shiftreg_layout.py
+++ b/libtoprammer/shiftreg_layout.py
@@ -26,7 +26,6 @@ from libtoprammer.generic_layout import *
class ShiftregLayout(GenericLayout):
def __init__(self, nrZifPins, nrShiftRegs):
GenericLayout.__init__(self, nrZifPins)
- assert(nrShiftRegs <= 4)
self.nrShiftRegs = nrShiftRegs
self.layouts = []
for id in range(0, len(self.shiftreg_masks)):
@@ -42,18 +41,8 @@ class ShiftregLayout(GenericLayout):
self.layouts.append( (id, zif_mask) )
def __bitnr2shregId(self, bitNr):
- if bitNr >= 24:
- register = 3
- pin = bitNr - 24
- elif bitNr >= 16:
- register = 2
- pin = bitNr - 16
- elif bitNr >= 8:
- register = 1
- pin = bitNr - 8
- else:
- register = 0
- pin = bitNr
+ register = bitNr // 8
+ pin = bitNr % 8
return "%d.%d" % (register, pin)
def supportedLayouts(self):
bues.ch cgit interface