add a check to the spec generator, list pins not found
authorLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 28 Jun 2018 12:10:43 +0000 (13:10 +0100)
committerLuke Kenneth Casson Leighton <lkcl@lkcl.net>
Thu, 28 Jun 2018 12:10:43 +0000 (13:10 +0100)
src/spec/ifaceprint.py

index 3dc60f7bb9163813d2337ac2311feb3587d42559..f8b95d2593ec15544ca8f7a8b8500b2412e6546c 100644 (file)
@@ -100,6 +100,10 @@ def check_functions(of, title, bankspec, fns, pins, required, eint, pwm,
     pins = deepcopy(pins)
     if descriptions is None:
         descriptions = {}
+    fnidx = fns.keys()
+
+    #print dir(fns)
+    #print dir(pins)
 
     of.write("# Pinmap for %s\n\n" % title)
 
@@ -123,13 +127,21 @@ def check_functions(of, title, bankspec, fns, pins, required, eint, pwm,
         else:
             count = 100000
         name = name[0]
+        #print name
         found = set()
-        fnidx = fns.keys()
-        # fnidx.sort(fnsort)
         pinfound = {}
+        located = set()
         for fname in fnidx:
             if not fname.startswith(name):
                 continue
+            for k in pins.fnspec.keys():
+                if fname.startswith(k):
+                    fk = pins.fnspec[k].keys()
+                    fn = pins.fnspec[k]
+                    fn = fn[list(fn.keys())[0]]
+                    #print fname, fn, dir(fn)
+                    if count == 100000:
+                        count = len(fn.pingroup)
             for pin, mux, bank in fns[fname]:
                 if findbank is not None:
                     if findbank != bank:
@@ -142,6 +154,7 @@ def check_functions(of, title, bankspec, fns, pins, required, eint, pwm,
 
         pinidx = sorted(pinfound.keys())
 
+        removedcount = 0
         for pin_ in pinidx:
             fname, pin_, bank, pin, mux = pinfound[pin_]
             if fname in found:
@@ -150,8 +163,15 @@ def check_functions(of, title, bankspec, fns, pins, required, eint, pwm,
             if len(found) > count:
                 continue
             del pins[pin_]
+            removedcount += 1
             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 ("pins found", pinfound)
+
+        # fnidx.sort(fnsort)
         of.write('\n')
 
     # gpios