CODE
uint32_t capacity;
f_getfree("",&capacity,&filesystem);
while(capacity)
{
char filename[12];
uint32_t allocation;
uint_least8_t count=0;
FIL file;
/*
Create preallocated files
named stor1.dat ... stor100.dat
when begin to write
file will be renamed to video1.dat ... video100.dat
*/
scprint(filename,Preallocated_Video_File_Name,count++);
f_open(&file,filename,FA_CREATE_ALWAYS);
if(capacity < CARD_1GB)
{
allocation = capacity;
capacity = 0;//end of file creation
}
else
{
allocation = CARD_1GB;
capacity -= CARD_1GB;
}
allocation *= SECTOR_SIZE*SECTOR_SIZE_MULT;
f_lseek(&file,allocation);
f_close(&file);
}
}
general_control.card_ready=1;
break;
Т.е. такая штука работать не будет?