mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-13 13:01:55 +03:00
Add SD.end() method, including arg to leave SPI up (#5402)
* Add SD.end() method with endSPI flag as arg * cleanup and fix a default arg * Fix typo
This commit is contained in:
@ -350,6 +350,17 @@ boolean SDClass::begin(uint8_t csPin, uint32_t speed) {
|
||||
root.openRoot(volume);
|
||||
}
|
||||
|
||||
//Warning: see comment in SD.h about possible card corruption.
|
||||
void SDClass::end(bool endSPI)
|
||||
{
|
||||
if(card.errorCode() == 0 && root.isOpen()) {
|
||||
root.close(); //Warning: this calls sync(), see above comment about corruption.
|
||||
}
|
||||
|
||||
card.end(endSPI);
|
||||
}
|
||||
|
||||
|
||||
// this little helper is used to traverse paths
|
||||
SdFile SDClass::getParentDir(const char *filepath, int *index) {
|
||||
// get parent directory
|
||||
|
Reference in New Issue
Block a user