Skip to content

Commit

Permalink
Unique generator now outputs C header file
Browse files Browse the repository at this point in the history
  • Loading branch information
szczys committed Dec 28, 2013
1 parent adcd0f7 commit 70ceca8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
unique-string-gen/uniqueSet.h
unique-string-gen/uniqueSet.pkl
10 changes: 9 additions & 1 deletion unique-string-gen/unique-string-gen.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,13 @@
print "Saved to uniqueSet.pkl"
print


print "Generating PROGMEM array as uniqueSet.h"
with open('uniqueSet.h', 'w') as f:
f.write("unsigned int uniqueSet[" + str(setSize) + "] PROGMEM = {\n")
for i in range(setSize/5):
if i == (setSize/5)-1:
f.write(str(uniqueSet[0+(i*5):]).replace('[','').replace(']','') + "\n")
else:
f.write(str(uniqueSet[0+(i*5):5+(i*5)]).replace('[','').replace(']','') + ",\n")
f.write("};\n")

0 comments on commit 70ceca8

Please sign in to comment.