From 3578ec21a85a2f1b98291e82ef602bed03c755e3 Mon Sep 17 00:00:00 2001 From: Michael Buesch Date: Mon, 3 Jan 2011 19:07:26 +0100 Subject: Sort layouts Signed-off-by: Michael Buesch --- libtoprammer/shiftreg_layout.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) (limited to 'libtoprammer/shiftreg_layout.py') 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): -- cgit v1.2.3