Datasheet

i = 0;
while (ostr[i]) {
UART1_Write(ostr[i++]);
}
UART1_Write(0x0A);
}
//-------------- Creates new file and writes some data to it
void M_Create_New_File() {
filename[7] = 'A';
Cf_Fat_Assign(&filename, 0x80); // Will not find file and then
create file
Cf_Fat_Rewrite(); // To clear file and start
with new data
for(loop = 1; loop <= 99; loop++) { // We want 5 files on the
MMC card
file_contents[0] = loop / 10 + 48;
file_contents[1] = loop % 10 + 48;
Cf_Fat_Write(file_contents, 38); // write data to the assigned
file
UART1_Write('.');
}
}
//-------------- Creates many new files and writes data to them
void M_Create_Multiple_Files() {
for(loop2 = 'B'; loop2 <= 'Z'; loop2++) {
UART1_Write(loop2);
filename[7] = loop2; // set filename
Cf_Fat_Assign(&filename, 0xA0); // find existing file or cre-
ate a new one
Cf_Fat_Rewrite(); // To clear file and start
with new data
for(loop = 1; loop <= 44; loop++) {
file_contents[0] = loop / 10 + 48;
file_contents[1] = loop % 10 + 48;
Cf_Fat_Write(file_contents, 38); // write data to the assigned
file
}
}
}
//-------------- Opens an existing file and rewrites it
void M_Open_File_Rewrite() {
270
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6