Skip to content

Commit 1c25d24

Browse files
squelchedfacchinm
authored andcommitted
SD: allow multiple SD instances
The SDClass class makes a reference to "SD.card" instead of just "card". SD is a global instance of SDClass. This prevents any other instance of SDClass from functioning correctly. The fix also allows SDClass to be used with an SD card which is removed and replaced, whereas previously, using the global instance SD did not allow this due to the limitation of begin() which cannot be called more than once.
1 parent b104175 commit 1c25d24

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

libraries/SD/src/SD.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ File SDClass::open(const char *filepath, uint8_t mode) {
450450

451451
// there is a special case for the Root directory since its a static dir
452452
if (parentdir.isRoot()) {
453-
if ( ! file.open(SD.root, filepath, mode)) {
453+
if ( ! file.open(root, filepath, mode)) {
454454
// failed to open the file :(
455455
return File();
456456
}

0 commit comments

Comments
 (0)