git.ucc.asn.au
/
matches
/
MCTX3420.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
semi update lut stuff
[matches/MCTX3420.git]
/
notes
/
pin maps
/
parseit.py
diff --git
a/notes/pin maps/parseit.py
b/notes/pin maps/parseit.py
index
0aab5ba
..
3ebf5c0
100644
(file)
--- 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
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="")
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
low = high
high += rowsize
+ if low < len(lut):
+ print(",")
+ else:
+ print("")
print("}")
print("}")
UCC
git Repository :: git.ucc.asn.au