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:
@ -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();
|
||||
|
Reference in New Issue
Block a user