Skip to content

Commit c640767

Browse files
committed
Add missing filename parameter to run_test()
1 parent 61ad39d commit c640767

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

adafruit_boardtest/boardtest_sd.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ def run_test(
6363
miso_pin=MISO_PIN_NAME,
6464
sck_pin=SCK_PIN_NAME,
6565
cs_pin=CS_PIN_NAME,
66+
filename: str = FILENAME
6667
):
6768

6869
"""
@@ -83,7 +84,7 @@ def run_test(
8384
# Tell user to connect SD card
8485
print("Insert SD card into holder and connect SPI lines to holder.")
8586
print("Connect " + cs_pin + " to the CS (DAT3) pin on the SD " + "card holder.")
86-
print("WARNING: " + FILENAME + " will be created or overwritten.")
87+
print("WARNING: " + filename + " will be created or overwritten.")
8788
print("Press enter to continue.")
8889
input()
8990

@@ -115,7 +116,7 @@ def run_test(
115116

116117
# Write test string to a text file on the card
117118
try:
118-
with open("/sd/" + FILENAME, "w") as file:
119+
with open("/sd/" + filename, "w") as file:
119120
print("Writing:\t" + test_str)
120121
file.write(test_str)
121122
except OSError:
@@ -125,7 +126,7 @@ def run_test(
125126
# Read from test file on the card
126127
read_str = ""
127128
try:
128-
with open("/sd/" + FILENAME, "r") as file:
129+
with open("/sd/" + filename, "r") as file:
129130
lines = file.readlines()
130131
for line in lines:
131132
read_str += line

0 commit comments

Comments
 (0)