diff options
Diffstat (limited to 'libraries/SD/utility/SdFile.cpp')
-rw-r--r-- | libraries/SD/utility/SdFile.cpp | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/libraries/SD/utility/SdFile.cpp b/libraries/SD/utility/SdFile.cpp index 40444a7..e786f56 100644 --- a/libraries/SD/utility/SdFile.cpp +++ b/libraries/SD/utility/SdFile.cpp @@ -590,7 +590,7 @@ void SdFile::printDirName(const dir_t& dir, uint8_t width) { Serial.print('.');
w++;
}
- Serial.print(dir.name[i]);
+ Serial.write(dir.name[i]);
w++;
}
if (DIR_IS_SUBDIR(&dir)) {
@@ -1121,7 +1121,7 @@ uint8_t SdFile::truncate(uint32_t length) { * for a read-only file, device is full, a corrupt file system or an I/O error.
*
*/
-int16_t SdFile::write(const void* buf, uint16_t nbyte) {
+size_t SdFile::write(const void* buf, uint16_t nbyte) {
// convert void* to uint8_t* - must be before goto statements
const uint8_t* src = reinterpret_cast<const uint8_t*>(buf);
@@ -1210,8 +1210,9 @@ int16_t SdFile::write(const void* buf, uint16_t nbyte) { writeErrorReturn:
// return for write error
- writeError = true;
- return -1;
+ //writeError = true;
+ setWriteError();
+ return 0;
}
//------------------------------------------------------------------------------
/**
@@ -1219,8 +1220,8 @@ int16_t SdFile::write(const void* buf, uint16_t nbyte) { *
* Use SdFile::writeError to check for errors.
*/
-void SdFile::write(uint8_t b) {
- write(&b, 1);
+size_t SdFile::write(uint8_t b) {
+ return write(&b, 1);
}
//------------------------------------------------------------------------------
/**
@@ -1228,8 +1229,8 @@ void SdFile::write(uint8_t b) { *
* Use SdFile::writeError to check for errors.
*/
-void SdFile::write(const char* str) {
- write(str, strlen(str));
+size_t SdFile::write(const char* str) {
+ return write(str, strlen(str));
}
//------------------------------------------------------------------------------
/**
|