We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2982747 commit 73a4af9Copy full SHA for 73a4af9
src/adafruit_blinka/microcontroller/allwinner/h618/pin.py
@@ -3,6 +3,7 @@
3
# SPDX-License-Identifier: MIT
4
"""Allwinner H618 Pin Names"""
5
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
6
+import re
7
8
def find_gpiochip_number(target_label):
9
try:
@@ -15,12 +16,10 @@ def find_gpiochip_number(target_label):
15
16
gpiochip_number = None
17
for line in lines:
18
if target_label in line:
- parts = line.split()
19
- for part in parts:
20
- if part.startswith('gpiochip'):
21
- gpiochip_number = part[len('gpiochip'):]
22
- break
23
+ match = re.search(r'gpiochip(\d+)', line)
+ if match:
+ gpiochip_number = match.group(1)
+ break
24
25
return gpiochip_number
26
0 commit comments