Datasheet

size = Cf_Fat_Get_Swap_File(5000, "mikroE.txt", 0x20); // see help
on this function for details
if
(size) {
LongToStr((signed long)size, fat_txt);
I_Write_Str(fat_txt);
for(i=0; i<5000; i++) {
Cf_Write_Sector(size++, Buffer);
UART1_Write('.');
}
}
}
//-------------- Main. Uncomment the function(s) to test the desired
operation(s)
void main() {
// we will use PORTC to signal test end
DDRC = 0xFF;
PORTC = 0;
//--- set up USART for the file read
UART1_Init(19200);
Delay_ms(100);
// use fat16 quick format instead of init routine if a format-
ting is needed
if(!Cf_Fat_Init()) { // Init the FAT library
//--- Test start
UART1_Write('s');
M_Create_New_File();
M_Create_Multiple_Files();
M_Open_File_Rewrite();
M_Open_File_Append();
M_Open_File_Read();
M_Delete_File();
M_Test_File_Exist();
M_Create_Swap_File();
//--- Test termination
UART1_Write('e');
}
else {
I_Write_Str(fat_txt);
}
//--- Test termination
PORTC = 0x0F;
}
273
MIKROELEKTRONIKA - SOFTWARE AND HARDWARE SOLUTIONS FOR EMBEDDED WORLD
Libraries
mikroC PRO for AVR
CHAPTER 6