move things around and add efm8 and efm32 builds
This commit is contained in:
34
tools/convert_log_to_c.py
Normal file
34
tools/convert_log_to_c.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import sys
|
||||
from sys import argv
|
||||
|
||||
if len(argv) != 2:
|
||||
print("usage: %s <input-log>" % argv[0]);
|
||||
sys.exit(1)
|
||||
|
||||
log = open(argv[1]).readlines()
|
||||
|
||||
nums = []
|
||||
|
||||
for x in log:
|
||||
parse = []
|
||||
for i in x.split(' '):
|
||||
try:
|
||||
n = int(i,16)
|
||||
parse.append(n)
|
||||
except:
|
||||
pass
|
||||
if len(parse) == 0:
|
||||
continue
|
||||
assert(len(parse) == 64)
|
||||
nums.append(parse)
|
||||
|
||||
hexlines = []
|
||||
|
||||
for l in nums:
|
||||
s = ''
|
||||
for x in l:
|
||||
s += '\\x%02x' % x
|
||||
hexlines.append(s)
|
||||
|
||||
for x in hexlines:
|
||||
print('"'+x+'"')
|
Reference in New Issue
Block a user