File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change @@ -56,7 +56,7 @@ def get_gpio_af_num(pintofind, iptofind):
56
56
j = 0
57
57
if n .nodeType == Node .ELEMENT_NODE :
58
58
for firstlevel in n .attributes .items ():
59
- # if 'PB7' in firstlevel:
59
+ # if 'PB7' in firstlevel:
60
60
if pintofind == firstlevel [1 ]:
61
61
# DBG print (i , firstlevel)
62
62
# n = pin node found
@@ -79,21 +79,25 @@ def get_gpio_af_num(pintofind, iptofind):
79
79
if myc .nodeType == Node .ELEMENT_NODE :
80
80
# myc = node of ALTERNATE
81
81
for mygpioaflist in myc .childNodes :
82
- mygpioaf += (
83
- " " + mygpioaflist .data
84
- )
82
+ if mygpioaf == "NOTFOUND" :
83
+ mygpioaf = ""
84
+ if mygpioaflist .data not in mygpioaf :
85
+ if mygpioaf != "" :
86
+ mygpioaf += " "
87
+ mygpioaf += mygpioaflist .data
85
88
# print (mygpioaf)
86
89
if mygpioaf == "NOTFOUND" :
87
90
print (
88
- "GPIO AF not found in "
91
+ "No GPIO AF found in "
89
92
+ gpiofile
90
93
+ " for "
91
94
+ pintofind
92
95
+ " and the IP "
93
96
+ iptofind
94
97
)
98
+ mygpioaf = "GPIO_AF_NONE"
95
99
# quit()
96
- return mygpioaf . replace ( "NOTFOUND " , "" )
100
+ return mygpioaf
97
101
98
102
99
103
def get_gpio_af_numF1 (pintofind , iptofind ):
You can’t perform that action at this time.
0 commit comments