Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d8330cc

Browse filesBrowse files
dstoikome-no-dev
authored andcommitted
Added file.close() in manipulation functions (#514)
1 parent 13bb22d commit d8330cc
Copy full SHA for d8330cc

File tree

Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+3
-0
lines changed

‎libraries/SD/examples/SD_Test/SD_Test.ino

Copy file name to clipboardExpand all lines: libraries/SD/examples/SD_Test/SD_Test.ino
+3Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ void readFile(fs::FS &fs, const char * path){
7878
while(file.available()){
7979
Serial.write(file.read());
8080
}
81+
file.close();
8182
}
8283

8384
void writeFile(fs::FS &fs, const char * path, const char * message){
@@ -93,6 +94,7 @@ void writeFile(fs::FS &fs, const char * path, const char * message){
9394
} else {
9495
Serial.println("Write failed");
9596
}
97+
file.close();
9698
}
9799

98100
void appendFile(fs::FS &fs, const char * path, const char * message){
@@ -108,6 +110,7 @@ void appendFile(fs::FS &fs, const char * path, const char * message){
108110
} else {
109111
Serial.println("Append failed");
110112
}
113+
file.close();
111114
}
112115

113116
void renameFile(fs::FS &fs, const char * path1, const char * path2){

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.