system/drivers/fatfs/format.c
/*
 * Fill the first two entries with ?????????
 * Media descriptor???????
 *
 * Third entry for FAT32 is the root dir EOC
 */


Third entry for FAT32 is the root dir EOC
Third entry for FAT32 is the root dir EOC
int FatInitFATs (void)
{
	uint32 media_byte_value;
	if (fsb.fat_type == TYPE_FAT12)
		media_byte_value = fsb.bpb.media_type | 0x00000f00;
	else if (fsb.fat_type == TYPE_FAT16)
		media_byte_value = fsb.bpb.media_type | 0x0000ff00;
	else
		media_byte_value = fsb.bpb.media_type | 0xffffff00;
	WriteFATEntry (0, media_byte_value);
	WriteFATEntry (1, CLUSTER_EOC);
	if (fsb.fat_type == TYPE_FAT32)
		WriteFATEntry (2, CLUSTER_EOC);
	return 0;
}
int FatInitFATs ( void ) { uint32 media_byte_value ; if ( fsb . fat_type == TYPE_FAT12 ) media_byte_value = fsb . bpb . media_type | 0x00000f00 ; else if ( fsb . fat_type == TYPE_FAT16 ) media_byte_value = fsb . bpb . media_type | 0x0000ff00 ; else media_byte_value = fsb . bpb . media_type | 0xffffff00 ; WriteFATEntry ( 0 , media_byte_value ) ; WriteFATEntry ( 1 , CLUSTER_EOC ) ; if ( fsb . fat_type == TYPE_FAT32 ) WriteFATEntry ( 2 , CLUSTER_EOC ) ; return 0 ; }
Fill the first two entries with ?
Fill the first two entries with ?