Kaynağa Gözat

Fix writes >= 64KB

main
Frank Bösing 7 yıl önce
ebeveyn
işleme
8db1e3ed1c
2 değiştirilmiş dosya ile 3 ekleme ve 3 silme
  1. +1
    -1
      utility/SdFat.h
  2. +2
    -2
      utility/SdFile.cpp

+ 1
- 1
utility/SdFat.h Dosyayı Görüntüle

@@ -284,7 +284,7 @@ class SdFile : public Print {
/** \return SdVolume that contains this file. */
SdVolume* volume(void) const {return vol_;}
size_t write(uint8_t b);
size_t write(const void* buf, uint16_t nbyte);
size_t write(const void* buf, size_t nbyte);
size_t write(const char* str);
void write_P(PGM_P str);
void writeln_P(PGM_P str);

+ 2
- 2
utility/SdFile.cpp Dosyayı Görüntüle

@@ -1120,12 +1120,12 @@ uint8_t SdFile::truncate(uint32_t length) {
* for a read-only file, device is full, a corrupt file system or an I/O error.
*
*/
size_t SdFile::write(const void* buf, uint16_t nbyte) {
size_t SdFile::write(const void* buf, size_t nbyte) {
// convert void* to uint8_t* - must be before goto statements
const uint8_t* src = reinterpret_cast<const uint8_t*>(buf);
// number of bytes left to write - must be before goto statements
uint16_t nToWrite = nbyte;
size_t nToWrite = nbyte;
// error if not a normal file or is read-only
if (!isFile() || !(flags_ & O_WRITE)) goto writeErrorReturn;

Yükleniyor…
İptal
Kaydet