Skip to content

Commit 2fa77a8

Browse files
committed
Set the GPIO Mode to STM_MODE_INPUT instead of STM_MODE_AF_PP for F1
For Uart_RX and CAN_RD Signed-off-by: Frederic Pillon <[email protected]>
1 parent c7435b6 commit 2fa77a8

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/genpinmap/genpinmap_arduino.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,10 @@ def print_uart(xml, l):
394394
#2nd element is the UART_XX signal
395395
b=p[2].split('_')[0]
396396
s1 += "%-9s" % (b[:len(b)-1] + b[len(b)-1:] + ',')
397-
s1 += 'STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, '
397+
if 'STM32F10' in sys.argv[2] and l == uartrx_list:
398+
s1 += 'STM_PIN_DATA(STM_MODE_INPUT, GPIO_PULLUP, '
399+
else:
400+
s1 += 'STM_PIN_DATA(STM_MODE_AF_PP, GPIO_PULLUP, '
398401
r = result.split(' ')
399402
for af in r:
400403
s2 = s1 + af + ')},\n'
@@ -441,7 +444,10 @@ def print_can(xml, l):
441444
instance = p[2].split('_')[0].replace("CAN", "")
442445
#if len(instance) == 0:
443446
# instance = '1'
444-
s1 += 'CAN' + instance + ', STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, '
447+
if 'STM32F10' in sys.argv[2] and l == canrd_list:
448+
s1 += 'CAN' + instance + 'STM_PIN_DATA(STM_MODE_INPUT, GPIO_NOPULL, '
449+
else:
450+
s1 += 'CAN' + instance + ', STM_PIN_DATA(STM_MODE_AF_PP, GPIO_NOPULL, '
445451
r = result.split(' ')
446452
for af in r:
447453
s2 = s1 + af + ')},\n'

0 commit comments

Comments
 (0)