1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Replacing boolean parameters to SD.open() with SD_MODE constants.

This commit is contained in:
David A. Mellis
2010-11-28 12:43:13 -06:00
parent 00a9f99c9b
commit ff89afb606
4 changed files with 27 additions and 20 deletions

View File

@ -343,7 +343,7 @@ boolean SDClass::begin(uint8_t csPin) {
}
File SDClass::open(char *filepath, boolean write, boolean append) {
File SDClass::open(char *filepath, uint8_t mode) {
/*
Open the supplied file path for reading or writing.
@ -369,18 +369,7 @@ File SDClass::open(char *filepath, boolean write, boolean append) {
// TODO: Allow for read&write? (Possibly not, as it requires seek.)
uint8_t oflag = O_RDONLY;
if (write) {
oflag = O_CREAT | O_WRITE;
if (append) {
oflag |= O_APPEND;
} else {
oflag |= O_TRUNC;
}
}
fileOpenMode = oflag;
fileOpenMode = mode;
walkPath(filepath, root, callback_openPath, this);
return File();