SdFat-Particle icon indicating copy to clipboard operation
SdFat-Particle copied to clipboard

close() stops code from continuing

Open medida opened this issue 6 years ago • 0 comments

I'm using your code on a particle elctron and i can write to a file using your exmaple code. But as soon as i use myFile.close() - the code stop executing any further.

` if (!myFile.open("test.txt", O_RDWR | O_CREAT | O_AT_END)) { // removed.... sd.errorHalt("opening test.txt for write failed"); } // if the file opened okay, write to it: Serial.print("Writing to test.txt..."); myFile.println("testing 1, 2, 3."); myFile.printf("fileSize: %d\n", myFile.fileSize());

Particle.publish("SD","Written data",360,PRIVATE);

// close the file: myFile.close();`

Code does not go past this point.

Any ideas on why the close() would cause the process to stop.

The data is written to the file fine .

Thanks John

medida avatar Mar 19 '18 12:03 medida