~ubuntu-branches/debian/experimental/arduino/experimental

« back to all changes in this revision

Viewing changes to libraries/SD/utility/SdFile.cpp

  • Committer: Package Import Robot
  • Author(s): Scott Howard
  • Date: 2012-03-11 18:19:42 UTC
  • mfrom: (1.1.5) (5.1.14 sid)
  • Revision ID: package-import@ubuntu.com-20120311181942-be2clnbz1gcehixb
Tags: 1:1.0.1~rc1+dfsg-1
New upstream release, experimental.

Show diffs side-by-side

added added

removed removed

Lines of Context:
590
590
      Serial.print('.');
591
591
      w++;
592
592
    }
593
 
    Serial.print(dir.name[i]);
 
593
    Serial.write(dir.name[i]);
594
594
    w++;
595
595
  }
596
596
  if (DIR_IS_SUBDIR(&dir)) {
1121
1121
 * for a read-only file, device is full, a corrupt file system or an I/O error.
1122
1122
 *
1123
1123
 */
1124
 
int16_t SdFile::write(const void* buf, uint16_t nbyte) {
 
1124
size_t SdFile::write(const void* buf, uint16_t nbyte) {
1125
1125
  // convert void* to uint8_t*  -  must be before goto statements
1126
1126
  const uint8_t* src = reinterpret_cast<const uint8_t*>(buf);
1127
1127
 
1210
1210
 
1211
1211
 writeErrorReturn:
1212
1212
  // return for write error
1213
 
  writeError = true;
1214
 
  return -1;
 
1213
  //writeError = true;
 
1214
  setWriteError();
 
1215
  return 0;
1215
1216
}
1216
1217
//------------------------------------------------------------------------------
1217
1218
/**
1219
1220
 *
1220
1221
 * Use SdFile::writeError to check for errors.
1221
1222
 */
1222
 
void SdFile::write(uint8_t b) {
1223
 
  write(&b, 1);
 
1223
size_t SdFile::write(uint8_t b) {
 
1224
  return write(&b, 1);
1224
1225
}
1225
1226
//------------------------------------------------------------------------------
1226
1227
/**
1228
1229
 *
1229
1230
 * Use SdFile::writeError to check for errors.
1230
1231
 */
1231
 
void SdFile::write(const char* str) {
1232
 
  write(str, strlen(str));
 
1232
size_t SdFile::write(const char* str) {
 
1233
  return write(str, strlen(str));
1233
1234
}
1234
1235
//------------------------------------------------------------------------------
1235
1236
/**