|
27 | 27 | from argparse import RawTextHelpFormatter
|
28 | 28 | import subprocess
|
29 | 29 |
|
30 |
| -GENPINMAP_VERSION = "1.20.1" |
| 30 | +GENPINMAP_VERSION = "1.20.2" |
31 | 31 |
|
32 | 32 | ADD_DEVICE_IF = 0
|
33 | 33 | ADD_GPIO_PINMAP = 0
|
@@ -267,7 +267,9 @@ def store_pin(pin, name, functionality):
|
267 | 267 |
|
268 | 268 | # function to store ADC list
|
269 | 269 | def store_adc(pin, name, signal):
|
270 |
| - adclist.append([pin, name, signal]) |
| 270 | + #INN channels not supported in mbed |
| 271 | + if("IN" in signal and "INN" not in signal): |
| 272 | + adclist.append([pin, name, signal]) |
271 | 273 |
|
272 | 274 |
|
273 | 275 | # function to store DAC list
|
@@ -680,41 +682,40 @@ def print_adc():
|
680 | 682 | prev_p = ''
|
681 | 683 | alt_index = 0
|
682 | 684 | for parsed_pin in adclist:
|
683 |
| - if "IN" in parsed_pin[2]: |
684 |
| - commented_line = " " |
685 |
| - if parsed_pin[1] in PinLabel: |
686 |
| - if "STDIO_UART" in PinLabel[parsed_pin[1]]: |
687 |
| - commented_line = "//" |
688 |
| - if "RCC_OSC" in PinLabel[parsed_pin[1]]: |
689 |
| - commented_line = "//" |
690 |
| - if commented_line != "//": |
691 |
| - if parsed_pin[0] == prev_p: |
692 |
| - if "STM32F1" in mcu_file: |
693 |
| - continue |
694 |
| - else: |
695 |
| - prev_p = parsed_pin[0] |
696 |
| - parsed_pin[0] += '_ALT%d' % alt_index |
697 |
| - store_pin(parsed_pin[0], parsed_pin[0], "") |
698 |
| - alt_index += 1 |
699 |
| - if alt_index > ALTERNATE_DEFINITION: |
700 |
| - ALTERNATE_DEFINITION += 1 |
| 685 | + commented_line = " " |
| 686 | + if parsed_pin[1] in PinLabel: |
| 687 | + if "STDIO_UART" in PinLabel[parsed_pin[1]]: |
| 688 | + commented_line = "//" |
| 689 | + if "RCC_OSC" in PinLabel[parsed_pin[1]]: |
| 690 | + commented_line = "//" |
| 691 | + if commented_line != "//": |
| 692 | + if parsed_pin[0] == prev_p: |
| 693 | + if "STM32F1" in mcu_file: |
| 694 | + continue |
701 | 695 | else:
|
702 | 696 | prev_p = parsed_pin[0]
|
703 |
| - alt_index = 0 |
704 |
| - line_to_write = "%-17s" % (commented_line + " {" + parsed_pin[0] + ',') |
705 |
| - a = parsed_pin[2].split('_') |
706 |
| - inst = a[0].replace("ADC", "") |
707 |
| - if len(inst) == 0: |
708 |
| - inst = '1' #single ADC for this product |
709 |
| - line_to_write += "%-7s" % ('ADC_' + inst + ',') |
710 |
| - chan = re.sub(r"^IN[N|P]?|\D*$", "", a[1]) |
711 |
| - bank = "_ADC_CHANNEL_BANK_B" if a[1].endswith("b") else "" |
712 |
| - line_to_write += s_pin_data + bank + ", GPIO_NOPULL, 0, " + chan |
713 |
| - line_to_write += ', 0)}, // ' + parsed_pin[2] |
714 |
| - if parsed_pin[1] in PinLabel: |
715 |
| - line_to_write += ' // Connected to ' + PinLabel[parsed_pin[1]] |
716 |
| - line_to_write += '\n' |
717 |
| - out_c_file.write(line_to_write) |
| 697 | + parsed_pin[0] += '_ALT%d' % alt_index |
| 698 | + store_pin(parsed_pin[0], parsed_pin[0], "") |
| 699 | + alt_index += 1 |
| 700 | + if alt_index > ALTERNATE_DEFINITION: |
| 701 | + ALTERNATE_DEFINITION += 1 |
| 702 | + else: |
| 703 | + prev_p = parsed_pin[0] |
| 704 | + alt_index = 0 |
| 705 | + line_to_write = "%-17s" % (commented_line + " {" + parsed_pin[0] + ',') |
| 706 | + a = parsed_pin[2].split('_') |
| 707 | + inst = a[0].replace("ADC", "") |
| 708 | + if len(inst) == 0: |
| 709 | + inst = '1' #single ADC for this product |
| 710 | + line_to_write += "%-7s" % ('ADC_' + inst + ',') |
| 711 | + chan = re.sub(r"^IN[N|P]?|\D*$", "", a[1]) |
| 712 | + bank = "_ADC_CHANNEL_BANK_B" if a[1].endswith("b") else "" |
| 713 | + line_to_write += s_pin_data + bank + ", GPIO_NOPULL, 0, " + chan |
| 714 | + line_to_write += ', 0)}, // ' + parsed_pin[2] |
| 715 | + if parsed_pin[1] in PinLabel: |
| 716 | + line_to_write += ' // Connected to ' + PinLabel[parsed_pin[1]] |
| 717 | + line_to_write += '\n' |
| 718 | + out_c_file.write(line_to_write) |
718 | 719 | out_c_file.write( """ {NC, NC, 0}
|
719 | 720 | };
|
720 | 721 |
|
|
0 commit comments