Skip to content

Commit

Permalink
update to python3 syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
Florin-Popescu committed Feb 8, 2023
1 parent 9f27cec commit 4e862fc
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions scripts/io_gen.py
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
try:
in_file_name = sys.argv[1]
except:
print 'Usage: %s <io_header>' % (os.path.basename (sys.argv[0]))
print('Usage: %s <io_header>' % (os.path.basename (sys.argv[0])))
sys.exit (1)

f = open (in_file_name).read ()
Expand All @@ -70,12 +70,11 @@

# Print the field initializer to stdout.

addrs = register.keys ()
addrs.sort ()
print 'gdb_io_reg_def_type [PUT DEVICE NAME HERE]_io_registers[] ='
print '{'
addrs = sorted(register)
print('gdb_io_reg_def_type [PUT DEVICE NAME HERE]_io_registers[] =')
print('{')
for addr in addrs:
print ' { %-12s, 0x%X, 0x00 },' % ('"%s"' %(register[addr]), addr)
print ' /* May need to add SREG, SPL, SPH, and eeprom registers. */'
print ' { 0, 0, 0}'
print '}'
print(' { %-12s, 0x%X, 0x00 },' % ('"%s"' %(register[addr]), addr))
print(' /* May need to add SREG, SPL, SPH, and eeprom registers. */')
print(' { 0, 0, 0}')
print('}')

0 comments on commit 4e862fc

Please sign in to comment.