Skip to content

Commit 2692461

Browse files
committed
Reformatted per pre-commit
1 parent 607c162 commit 2692461

File tree

5 files changed

+35
-10
lines changed

5 files changed

+35
-10
lines changed

adafruit_boardtest/boardtest_i2c.py

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@
5656
NA = "N/A"
5757

5858
# Open comms to I2C EEPROM by trying a write to memory address
59-
def _eeprom_i2c_wait(i2c: busio.I2C, i2c_addr: int, mem_addr: int, timeout: float = 1.0) -> bool:
59+
def _eeprom_i2c_wait(
60+
i2c: busio.I2C, i2c_addr: int, mem_addr: int, timeout: float = 1.0
61+
) -> bool:
6062

6163
# Try to access the I2C EEPROM (it becomes unresonsive during a write)
6264
timestamp = time.monotonic()
@@ -71,7 +73,9 @@ def _eeprom_i2c_wait(i2c: busio.I2C, i2c_addr: int, mem_addr: int, timeout: floa
7173

7274

7375
# Write to address. Returns status (True for successful write, False otherwise)
74-
def _eeprom_i2c_write_byte(i2c: busio.I2C, i2c_addr: int, mem_addr: int, mem_data: int) -> bool:
76+
def _eeprom_i2c_write_byte(
77+
i2c: busio.I2C, i2c_addr: int, mem_addr: int, mem_data: int
78+
) -> bool:
7579

7680
# Make sure address is only one byte:
7781
if mem_addr > 255:
@@ -91,7 +95,9 @@ def _eeprom_i2c_write_byte(i2c: busio.I2C, i2c_addr: int, mem_addr: int, mem_dat
9195

9296

9397
# Read from address. Returns tuple [status, result]
94-
def _eeprom_i2c_read_byte(i2c: busio.I2C, i2c_addr: int, mem_addr: int, timeout: float = 1.0) -> Tuple[bool, bytearray]:
98+
def _eeprom_i2c_read_byte(
99+
i2c: busio.I2C, i2c_addr: int, mem_addr: int, timeout: float = 1.0
100+
) -> Tuple[bool, bytearray]:
95101

96102
# Make sure address is only one byte:
97103
if mem_addr > 255:
@@ -108,7 +114,9 @@ def _eeprom_i2c_read_byte(i2c: busio.I2C, i2c_addr: int, mem_addr: int, timeout:
108114
return True, buf
109115

110116

111-
def run_test(pins: Sequence[str], sda_pin: str = SDA_PIN_NAME, scl_pin: str = SCL_PIN_NAME) -> Tuple[str, List[str]]:
117+
def run_test(
118+
pins: Sequence[str], sda_pin: str = SDA_PIN_NAME, scl_pin: str = SCL_PIN_NAME
119+
) -> Tuple[str, List[str]]:
112120

113121
"""
114122
Performs random writes and reads to I2C EEPROM.

adafruit_boardtest/boardtest_sd.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def run_test(
6868
miso_pin: str = MISO_PIN_NAME,
6969
sck_pin: str = SCK_PIN_NAME,
7070
cs_pin: str = CS_PIN_NAME,
71-
filename: str = FILENAME
71+
filename: str = FILENAME,
7272
) -> Tuple[str, List[str]]:
7373

7474
"""

adafruit_boardtest/boardtest_sd_cd.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@
4646
NA = "N/A"
4747

4848

49-
def run_test(pins: Sequence[str], cd_pin: str = SD_CD_PIN_NAME) -> Tuple[str, List[str]]:
49+
def run_test(
50+
pins: Sequence[str], cd_pin: str = SD_CD_PIN_NAME
51+
) -> Tuple[str, List[str]]:
5052

5153
"""
5254
Checks status of CD pin as user inserts and removes SD card.

adafruit_boardtest/boardtest_spi.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,9 @@
6969
NA = "N/A"
7070

7171
# Wait for WIP bit to go low
72-
def _eeprom_spi_wait(spi: busio.SPI, csel: digitalio.DigitalInOut, timeout: float = 1.0) -> bool:
72+
def _eeprom_spi_wait(
73+
spi: busio.SPI, csel: digitalio.DigitalInOut, timeout: float = 1.0
74+
) -> bool:
7375

7476
# Continually read from STATUS register
7577
timestamp = time.monotonic()
@@ -90,7 +92,13 @@ def _eeprom_spi_wait(spi: busio.SPI, csel: digitalio.DigitalInOut, timeout: floa
9092

9193

9294
# Write to address. Returns status (True for successful write, False otherwise)
93-
def _eeprom_spi_write_byte(spi: busio.SPI, csel: digitalio.DigitalInOut, address: int, data: int, timeout: float = 1.0) -> bool:
95+
def _eeprom_spi_write_byte(
96+
spi: busio.SPI,
97+
csel: digitalio.DigitalInOut,
98+
address: int,
99+
data: int,
100+
timeout: float = 1.0,
101+
) -> bool:
94102

95103
# Make sure address is only one byte:
96104
if address > 255:
@@ -118,7 +126,9 @@ def _eeprom_spi_write_byte(spi: busio.SPI, csel: digitalio.DigitalInOut, address
118126

119127

120128
# Read from address. Returns tuple [status, result]
121-
def _eeprom_spi_read_byte(spi: busio.SPI, csel: digitalio.DigitalInOut, address: int, timeout: float = 1.0) -> Tuple[bool, bytearray]:
129+
def _eeprom_spi_read_byte(
130+
spi: busio.SPI, csel: digitalio.DigitalInOut, address: int, timeout: float = 1.0
131+
) -> Tuple[bool, bytearray]:
122132

123133
# Make sure address is only one byte:
124134
if address > 255:

adafruit_boardtest/boardtest_uart.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@
5151
NA = "N/A"
5252

5353

54-
def run_test(pins: Sequence[str], tx_pin: str = TX_PIN_NAME, rx_pin: str = RX_PIN_NAME, baud_rate: int = BAUD_RATE) -> Tuple[str, List[str]]:
54+
def run_test(
55+
pins: Sequence[str],
56+
tx_pin: str = TX_PIN_NAME,
57+
rx_pin: str = RX_PIN_NAME,
58+
baud_rate: int = BAUD_RATE,
59+
) -> Tuple[str, List[str]]:
5560

5661
"""
5762
Performs random writes out of TX pin and reads on RX.

0 commit comments

Comments
 (0)