From f7a3ad90086cb8f6bec3973ba1b800bfc03e1810 Mon Sep 17 00:00:00 2001 From: Affrin Pinhero Date: Wed, 26 May 2021 19:16:17 +0530 Subject: [PATCH] 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 https://github.com/ARMmbed/mbed-os/pull/14669 Signed-off-by: Affrin Pinhero --- targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py b/targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py index ece2ef2d08..c1ec8d7e6b 100644 --- a/targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py +++ b/targets/TARGET_STM/tools/STM32_gen_PeripheralPins.py @@ -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 @@ -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]]