Skip to content

Commit f7a3ad9

Browse files
tools/STM32 Modified Python script generates Peripheral Pins
Modified print_adc function to update adc pin_map. This patch will update python script that generate 'peripheralPin.c'. Which will give functionality to gernerate ADC pin definition for BANK_B. This script update is related to #14669 Signed-off-by: Affrin Pinhero <[email protected]>
1 parent 045c48d commit f7a3ad9

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
@@ -666,7 +666,6 @@ def print_adc():
666666
# the GPIOx_ASCR register
667667
if re.match("STM32L4[78]+", mcu_file):
668668
s_pin_data += "_ADC_CONTROL"
669-
s_pin_data += ", GPIO_NOPULL, 0, "
670669

671670
prev_p = ''
672671
alt_index = 0
@@ -698,8 +697,9 @@ def print_adc():
698697
if len(inst) == 0:
699698
inst = '1' #single ADC for this product
700699
line_to_write += "%-7s" % ('ADC_' + inst + ',')
701-
chan = re.sub('IN[N|P]?', '', a[1])
702-
line_to_write += s_pin_data + chan
700+
chan = re.sub(r"^IN[N|P]?|\D*$", "", a[1])
701+
bank = "_ADC_CHANNEL_BANK_B" if a[1].endswith("b") else ""
702+
line_to_write += s_pin_data + bank + ", GPIO_NOPULL, 0, " + chan
703703
line_to_write += ', 0)}, // ' + parsed_pin[2]
704704
if parsed_pin[1] in PinLabel:
705705
line_to_write += ' // Connected to ' + PinLabel[parsed_pin[1]]

0 commit comments

Comments
 (0)