1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-12 01:53:07 +03:00

add more NULL prt checks in strtok_r

Conflicts:
	libraries/SD/src/SD.cpp
	libraries/SD/src/SD.h
This commit is contained in:
Markus Sattler
2015-05-12 17:10:19 +02:00
7 changed files with 76 additions and 69 deletions

View File

@ -326,7 +326,13 @@ boolean callback_rmdir(SdFile& parentDir, char *filePathComponent,
return true;
}
boolean SDClass::begin(uint8_t csPin, uint32_t sckRateID) {
/* Implementation of class used to create `SDCard` object. */
boolean SDClass::begin(uint8_t csPin, uint32_t speed) {
/*
Performs the initialisation required by the sdfatlib library.
@ -334,7 +340,7 @@ boolean SDClass::begin(uint8_t csPin, uint32_t sckRateID) {
Return true if initialization succeeds, false otherwise.
*/
return card.init(sckRateID, csPin) &&
return card.init(speed, csPin) &&
volume.init(card) &&
root.openRoot(volume);
}

View File

@ -65,7 +65,7 @@ private:
public:
// This needs to be called to set up the connection to the SD card
// before other methods are used.
boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN, uint32_t sckRateID = SPI_FULL_SPEED);
boolean begin(uint8_t csPin = SD_CHIP_SELECT_PIN, uint32_t speed = SPI_HALF_SPEED);
// Open the specified file/directory with the supplied mode (e.g. read or
// write, etc). Returns a File object for interacting with the file.