Datasheet

for (i = 1; i <= size; i++) {
Mmc_Fat_Read(&caracter);
UART1_Write(caracter); // Write data to USART
}
}
//M-M-M--------- Deletes a file. If file doesn't exist, it will first
be created
// and then deleted.
void M_Delete_File() {
filename[7] = 'F';
Mmc_Fat_Assign(filename, 0);
Mmc_Fat_Delete();
}
//M-M-M--------- Tests whether file exists, and if so sends its cre-
ation date
// and file size via USART
void M_Test_File_Exist() {
unsigned long fsize;
unsigned int year;
unsigned short month, day, hour, minute;
unsigned char outstr[12];
filename[7] = 'B'; //uncomment this line to search for file
that DOES exists
// filename[7] = 'F'; //uncomment this line to search for file
that DOES NOT exist
if (Mmc_Fat_Assign(filename, 0)) {
//--- file has been found - get its date
Mmc_Fat_Get_File_Date(&year, &month, &day, &hour, &minute);
WordToStr(year, outstr);
I_Write_Str(outstr);
ByteToStr(month, outstr);
I_Write_Str(outstr);
WordToStr(day, outstr);
I_Write_Str(outstr);
WordToStr(hour, outstr);
I_Write_Str(outstr);
WordToStr(minute, outstr);
I_Write_Str(outstr);
//--- get file size
fsize = Mmc_Fat_Get_File_Size();
LongToStr((signed long)fsize, outstr);
I_Write_Str(outstr);
}
343
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6