pass in muxwidth as argument
[pinmux.git] / src / spec / ifaceprint.py
index d0e9e24fb95fd220e039a7280eb0954e38a26c7e..51088f52bdbbe56c728d9217eb5b2b452c394ee4 100644 (file)
@@ -3,7 +3,7 @@
 from copy import deepcopy
 
 
-def display(of, pins, banksel=None):
+def display(of, pins, banksel=None, muxwidth=4):
     of.write("""\
 | Pin | Mux0        | Mux1        | Mux2        | Mux3        |
 | --- | ----------- | ----------- | ----------- | ----------- |
@@ -13,7 +13,7 @@ def display(of, pins, banksel=None):
         pdata = pins.get(pin)
         if banksel:
             skip = False
-            for mux in range(4):
+            for mux in range(muxwidth):
                 if mux not in pdata:
                     continue
                 name, bank = pdata[mux]
@@ -22,7 +22,7 @@ def display(of, pins, banksel=None):
             if skip:
                 continue
         res = '| %3d |' % pin
-        for mux in range(4):
+        for mux in range(muxwidth):
             if mux not in pdata:
                 res += "             |"
                 continue
@@ -167,8 +167,8 @@ def check_functions(of, title, bankspec, fns, pins, required, eint, pwm,
             of.write("* %s %d %s%d/%d\n" % (fname, pin_, bank, pin, mux))
 
         if removedcount != count:
-            print ("not all found", name, removedcount, count, title, found, \
-                    fns[fname])
+            print ("not all found", name, removedcount, count, title, found,
+                   fns[fname])
             print ("pins found", pinfound)
 
         # fnidx.sort(fnsort)