SdFat - file.write() fix

Post Reply
User avatar
Pito
Posts: 1628
Joined: Sat Mar 26, 2016 3:26 pm
Location: Rapa Nui

SdFat - file.write() fix

Post by Pito » Sun Jun 25, 2017 11:18 am

It seems the file.write(buf,bufsize) for bufsizes >128kB crashes, BillG has offered to me the following fix which works here:
Try the following changes to src/FatLib/FatFile.cpp

At line 769 change
uint8_t nb = toRead >> 9;
to
size_t nb = toRead >> 9;

At line 1442 change
uint8_t nBlock = nToWrite >> 9;
to
size_t nBlock = nToWrite >> 9;
Pukao Hats Cleaning Services Ltd.

Post Reply