X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=notes%2Fpin%20maps%2Fparseit.py;h=3ebf5c06d718975f36bb2d3c4c28e679a667b632;hb=38c8c8278b4dc1515ad1bf947142170874be5388;hp=0aab5ba1d55ed9a898ddf4964a88fa5fd9346229;hpb=334c0f768757075c94f4080f3275fc6cd006e6f7;p=matches%2FMCTX3420.git diff --git a/notes/pin maps/parseit.py b/notes/pin maps/parseit.py index 0aab5ba..3ebf5c0 100644 --- a/notes/pin maps/parseit.py +++ b/notes/pin maps/parseit.py @@ -34,14 +34,18 @@ def doit(x): def printlut(lut, name="g_gpio_lut"): '''print the lut for C''' rowsize = 14 - print("const char %s[%d] = {" % (name, len(lut))) + print("const unsigned char %s[%d] = {" % (name, len(lut))) low = 0 high = rowsize for i in range(0, len(lut), rowsize): print("\t", end="") - print(*("%3d" % g for g in lut[low:high]), sep=', ') + print(*("%3d" % g for g in lut[low:high]), sep=', ', end="") low = high high += rowsize + if low < len(lut): + print(",") + else: + print("") print("}")