diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/addfunc_parse.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/addfunc_parse.py index 4f5ebc5a46..609814fe0e 100755 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/addfunc_parse.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/addfunc_parse.py @@ -28,7 +28,7 @@ def is_pin(str): return False def parse_adc_table(fname, table): - csvt = csv.reader(open(fname,'rb')) + csvt = csv.reader(open(fname,'r')) i = 0 for row in csvt: for col in row: diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/af_parse.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/af_parse.py index b5940b9861..dd3b1774ea 100755 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/af_parse.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/af_parse.py @@ -86,10 +86,10 @@ if len(sys.argv) != 2: parse_af_table(sys.argv[1], table) -sys.stdout.write("AltFunction_map = {\n"); +sys.stdout.write("AltFunction_map = {\n") sys.stdout.write('\t# format is PIN:FUNCTION : AFNUM\n') sys.stdout.write('\t# extracted from %s\n' % os.path.basename(sys.argv[1])) for k in sorted(table.keys(), key=cmp_to_key(pin_compare)): s = '"' + k + '"' sys.stdout.write('\t%-20s\t:\t%s,\n' % (s, table[k])) -sys.stdout.write("}\n"); +sys.stdout.write("}\n") diff --git a/libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_parse.py b/libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_parse.py index d0edd0f57f..f4dbab8fd5 100755 --- a/libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_parse.py +++ b/libraries/AP_HAL_ChibiOS/hwdef/scripts/dma_parse.py @@ -11,7 +11,7 @@ import sys, csv, os def parse_dma_table(fname, table): dma_num = 1 - csvt = csv.reader(open(fname,'rb')) + csvt = csv.reader(open(fname,'r')) i = 0 last_channel = -1 for row in csvt: @@ -78,7 +78,7 @@ sys.stdout.write("DMA_Map = {\n"); sys.stdout.write('\t# format is (DMA_TABLE, StreamNum, Channel)\n') sys.stdout.write('\t# extracted from %s\n' % os.path.basename(sys.argv[1])) -for k in sorted(table.iterkeys()): +for k in sorted(table.keys()): s = '"%s"' % k sys.stdout.write('\t%-10s\t:\t[' % s) for i in range(len(table[k])):