1. Initialize : Mmc_Fat_Init();
2. Open for writing: Mmc_Fat_Rewrite();
3. Write: Mmc_Fat_Write(file_contents, 42);
Shouldn't there be a procedure to close the file when you're done, or is the file ok after the last call to Mmc_Fat_Write?
I have some code that writes a few lines to a file, and when I tried to open it in notepad, it gave me an error:
Code: Select all
Mmc_Fat_Assign('RTC_____.TXT',0x00);
Mmc_Fat_Rewrite(); // rewind the file, open for writing
LongWordToStr(RTC1, RTCS); // make string
writebuf := RTCS;
Mmc_Fat_Write(writebuf, 30);
LongWordToStr(RTC2, RTCS); // make string
writebuf := RTCS;
Mmc_Fat_Write(writebuf, 30);
LongWordToStr(RTC3, RTCS); // make string
writebuf := RTCS;
Mmc_Fat_Write(writebuf, 30);