Skip to content

Commit

Permalink
tools/STM32 Modified Python script generates Peripheral Pins
Browse files Browse the repository at this point in the history
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 commit
is related to ARMmbed#14669.
fix:
* https://github.com/STM32-OSF/mbed-os/issues/3

Signed-off-by: Affrin Pinhero <[email protected]>
  • Loading branch information
affrinpinhero-2356 committed Jun 2, 2021
1 parent 045c48d commit 7cbc61b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py
Original file line number Diff line number Diff line change
Expand Up @@ -666,7 +666,6 @@ def print_adc():
# the GPIOx_ASCR register
if re.match("STM32L4[78]+", mcu_file):
s_pin_data += "_ADC_CONTROL"
s_pin_data += ", GPIO_NOPULL, 0, "

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

0 comments on commit 7cbc61b

Please sign in to comment.