Merge pull request #14729 from affrinpinhero-2356/adc_bank_script_update

tools/STM32 Modified Python script generates Peripheral Pins
pull/14753/head
Martin Kojtal 2021-06-08 12:21:32 +02:00 committed by GitHub
commit 7c17693c06
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -676,7 +676,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
@ -708,8 +707,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]]