We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent eb0badd commit 4ab0ba6Copy full SHA for 4ab0ba6
libraries/SD/src/SD.h
@@ -43,8 +43,9 @@ class SDClass {
43
44
void end(bool endSPI = true) {
45
SDFS.end();
46
- if (endSPI) {
+ if (endSPI && _spi) {
47
_spi->end();
48
+ _spi = nullptr;
49
}
50
51
@@ -205,7 +206,7 @@ class SDClass {
205
206
return time(nullptr);
207
208
- HardwareSPI *_spi;
209
+ HardwareSPI *_spi = nullptr;
210
};
211
212
0 commit comments