Skip to content

Commit 7c17693

Browse files
authored
Merge pull request #14729 from affrinpinhero-2356/adc_bank_script_update
tools/STM32 Modified Python script generates Peripheral Pins
2 parents 8b1b302 + f7a3ad9 commit 7c17693

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,6 @@ def print_adc():
676676
# the GPIOx_ASCR register
677677
if re.match("STM32L4[78]+", mcu_file):
678678
s_pin_data += "_ADC_CONTROL"
679-
s_pin_data += ", GPIO_NOPULL, 0, "
680679

681680
prev_p = ''
682681
alt_index = 0
@@ -708,8 +707,9 @@ def print_adc():
708707
if len(inst) == 0:
709708
inst = '1' #single ADC for this product
710709
line_to_write += "%-7s" % ('ADC_' + inst + ',')
711-
chan = re.sub('IN[N|P]?', '', a[1])
712-
line_to_write += s_pin_data + chan
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
713713
line_to_write += ', 0)}, // ' + parsed_pin[2]
714714
if parsed_pin[1] in PinLabel:
715715
line_to_write += ' // Connected to ' + PinLabel[parsed_pin[1]]

0 commit comments

Comments
 (0)