]> Repositories - Adafruit_Blinka-hackapet.git/commitdiff
fix pre-commit check fail
authorAugust <2819763+Dangku@users.noreply.github.com>
Wed, 4 Sep 2024 03:09:51 +0000 (11:09 +0800)
committerAugust <2819763+Dangku@users.noreply.github.com>
Wed, 4 Sep 2024 03:09:51 +0000 (11:09 +0800)
src/adafruit_blinka/microcontroller/allwinner/h618/pin.py
src/adafruit_blinka/microcontroller/spacemit/k1/pin.py

index 8f6c3888d794d4b64647249ab7f54937bd2da55f..1019b598df0baba0a52d88e198e2654c35075b43 100644 (file)
@@ -5,10 +5,11 @@
 import re
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
 import re
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 
+
 def find_gpiochip_number(target_label):
     """Get correct gpiochip number, legacy kernel and mainline kernel are different"""
     try:
 def find_gpiochip_number(target_label):
     """Get correct gpiochip number, legacy kernel and mainline kernel are different"""
     try:
-        with open('/sys/kernel/debug/gpio', 'r') as f:
+        with open("/sys/kernel/debug/gpio", "r") as f:
             lines = f.readlines()
     except FileNotFoundError:
         print("The file /sys/kernel/debug/gpio does not exist.")
             lines = f.readlines()
     except FileNotFoundError:
         print("The file /sys/kernel/debug/gpio does not exist.")
@@ -17,13 +18,14 @@ def find_gpiochip_number(target_label):
     gpiochip_number = None
     for line in lines:
         if target_label in line:
     gpiochip_number = None
     for line in lines:
         if target_label in line:
-            match = re.search(r'gpiochip(\d+)', line)
+            match = re.search(r"gpiochip(\d+)", line)
             if match:
                 gpiochip_number = match.group(1)
                 break
 
     return gpiochip_number
 
             if match:
                 gpiochip_number = match.group(1)
                 break
 
     return gpiochip_number
 
+
 if find_gpiochip_number("300b000.pinctrl"):
     __chip_num = 1
 else:
 if find_gpiochip_number("300b000.pinctrl"):
     __chip_num = 1
 else:
index ad70499e6c7bda65abf78a1d6ec9f0bd29058fb1..997db4a93966041f6aeda0209a259bbbc7576c5d 100644 (file)
@@ -5,7 +5,7 @@
 from adafruit_blinka.agnostic import detector
 from adafruit_blinka.microcontroller.alias import get_pwm_chipid
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
 from adafruit_blinka.agnostic import detector
 from adafruit_blinka.microcontroller.alias import get_pwm_chipid
 from adafruit_blinka.microcontroller.generic_linux.libgpiod_pin import Pin
-    
+
 __chip_num = 0
 
 GPIO_0 = Pin((__chip_num, 0))
 __chip_num = 0
 
 GPIO_0 = Pin((__chip_num, 0))
@@ -141,9 +141,7 @@ GPIO_127 = Pin((__chip_num, 127))
 I2C4_SCL = GPIO_51
 I2C4_SDA = GPIO_52
 
 I2C4_SCL = GPIO_51
 I2C4_SDA = GPIO_52
 
-i2cPorts = (
-    (4, I2C4_SCL, I2C4_SDA),
-)
+i2cPorts = ((4, I2C4_SCL, I2C4_SDA),)
 
 # SPI
 SPI3_MISO = GPIO_78
 
 # SPI
 SPI3_MISO = GPIO_78
@@ -152,18 +150,14 @@ SPI3_SCLK = GPIO_75
 SPI3_CS0 = GPIO_76
 
 # ordered as spiId, sckId, mosiId, misoId
 SPI3_CS0 = GPIO_76
 
 # ordered as spiId, sckId, mosiId, misoId
-spiPorts = (
-    (3, SPI3_SCLK, SPI3_MOSI, SPI3_MISO),
-)
+spiPorts = ((3, SPI3_SCLK, SPI3_MOSI, SPI3_MISO),)
 
 # UART
 UART0_TX = GPIO_47
 UART0_RX = GPIO_48
 
 # ordered as uartId, txId, rxId
 
 # UART
 UART0_TX = GPIO_47
 UART0_RX = GPIO_48
 
 # ordered as uartId, txId, rxId
-uartPorts = (
-    (0, UART0_TX, UART0_RX),
-)
+uartPorts = ((0, UART0_TX, UART0_RX),)
 
 # SysFS pwm outputs, pwm channel and pin in first tuple
 pwmOuts = []
 
 # SysFS pwm outputs, pwm channel and pin in first tuple
 pwmOuts = []