File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -63,6 +63,7 @@ def run_test(
63
63
miso_pin = MISO_PIN_NAME ,
64
64
sck_pin = SCK_PIN_NAME ,
65
65
cs_pin = CS_PIN_NAME ,
66
+ filename : str = FILENAME
66
67
):
67
68
68
69
"""
@@ -83,7 +84,7 @@ def run_test(
83
84
# Tell user to connect SD card
84
85
print ("Insert SD card into holder and connect SPI lines to holder." )
85
86
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." )
87
88
print ("Press enter to continue." )
88
89
input ()
89
90
@@ -115,7 +116,7 @@ def run_test(
115
116
116
117
# Write test string to a text file on the card
117
118
try :
118
- with open ("/sd/" + FILENAME , "w" ) as file :
119
+ with open ("/sd/" + filename , "w" ) as file :
119
120
print ("Writing:\t " + test_str )
120
121
file .write (test_str )
121
122
except OSError :
@@ -125,7 +126,7 @@ def run_test(
125
126
# Read from test file on the card
126
127
read_str = ""
127
128
try :
128
- with open ("/sd/" + FILENAME , "r" ) as file :
129
+ with open ("/sd/" + filename , "r" ) as file :
129
130
lines = file .readlines ()
130
131
for line in lines :
131
132
read_str += line
You can’t perform that action at this time.
0 commit comments