Fix formatting to match WaveDrom

This commit is contained in:
akuker
2020-07-18 17:59:52 -05:00
parent 4b8877af56
commit 64b5c3d0f6

View File

@@ -5,6 +5,7 @@ import sys
outfile = open('data.json', 'w')
infile = open('timing_drawer.txt','r')
print("{signal: [", file=outfile)
firstline = infile.readline()
num_columns = len(firstline.split(";"))
@@ -29,7 +30,7 @@ while (field_num < num_columns):
elif (z == '00'):
out = '0'
else:
out = '1'
out = '2'
print(out, file=outfile, end='')
prev_val = z
print("', data: [", file=outfile, end='')
@@ -56,7 +57,7 @@ while (field_num < num_columns):
field_num = field_num + 1
print("]}", file=outfile)
outfile.close()