Skip to content

Commit 3746b1b

Browse files
committed
fix pre-commit check fail
1 parent 64c2db0 commit 3746b1b

File tree

2 files changed

+8
-12
lines changed
  • src/adafruit_blinka/microcontroller

2 files changed

+8
-12
lines changed

src/adafruit_blinka/microcontroller/allwinner/h618/pin.py

+4-2
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@
55
import re
66
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
77

8+
89
def find_gpiochip_number(target_label):
910
"""Get correct gpiochip number, legacy kernel and mainline kernel are different"""
1011
try:
11-
with open('/sys/kernel/debug/gpio', 'r') as f:
12+
with open("/sys/kernel/debug/gpio", "r") as f:
1213
lines = f.readlines()
1314
except FileNotFoundError:
1415
print("The file /sys/kernel/debug/gpio does not exist.")
@@ -17,13 +18,14 @@ def find_gpiochip_number(target_label):
1718
gpiochip_number = None
1819
for line in lines:
1920
if target_label in line:
20-
match = re.search(r'gpiochip(\d+)', line)
21+
match = re.search(r"gpiochip(\d+)", line)
2122
if match:
2223
gpiochip_number = match.group(1)
2324
break
2425

2526
return gpiochip_number
2627

28+
2729
if find_gpiochip_number("300b000.pinctrl"):
2830
__chip_num = 1
2931
else:

src/adafruit_blinka/microcontroller/spacemit/k1/pin.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from adafruit_blinka.agnostic import detector
66
from adafruit_blinka.microcontroller.alias import get_pwm_chipid
77
from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
8-
8+
99
__chip_num = 0
1010

1111
GPIO_0 = Pin((__chip_num, 0))
@@ -141,9 +141,7 @@
141141
I2C4_SCL = GPIO_51
142142
I2C4_SDA = GPIO_52
143143

144-
i2cPorts = (
145-
(4, I2C4_SCL, I2C4_SDA),
146-
)
144+
i2cPorts = ((4, I2C4_SCL, I2C4_SDA),)
147145

148146
# SPI
149147
SPI3_MISO = GPIO_78
@@ -152,18 +150,14 @@
152150
SPI3_CS0 = GPIO_76
153151

154152
# ordered as spiId, sckId, mosiId, misoId
155-
spiPorts = (
156-
(3, SPI3_SCLK, SPI3_MOSI, SPI3_MISO),
157-
)
153+
spiPorts = ((3, SPI3_SCLK, SPI3_MOSI, SPI3_MISO),)
158154

159155
# UART
160156
UART0_TX = GPIO_47
161157
UART0_RX = GPIO_48
162158

163159
# ordered as uartId, txId, rxId
164-
uartPorts = (
165-
(0, UART0_TX, UART0_RX),
166-
)
160+
uartPorts = ((0, UART0_TX, UART0_RX),)
167161

168162
# SysFS pwm outputs, pwm channel and pin in first tuple
169163
pwmOuts = []

0 commit comments

Comments
 (0)