File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ struct TextFile {
6868#define BPB_RESERVED_SECTORS ( 1)
6969#define BPB_NUMBER_OF_FATS ( 2)
7070#define BPB_ROOT_DIR_ENTRIES ( 64)
71- #define BPB_TOTAL_SECTORS CFG_UF2_NUM_BLOCKS // 0x101dd is absolute max at current code commit
71+ #define BPB_TOTAL_SECTORS (0x10109) // Use a fixed (near max) number of sectors for the FAT file system
7272#define BPB_MEDIA_DESCRIPTOR_BYTE (0xF8)
7373#define FAT_ENTRY_SIZE (2)
7474#define FAT_ENTRIES_PER_SECTOR (BPB_SECTOR_SIZE / FAT_ENTRY_SIZE)
@@ -78,6 +78,10 @@ struct TextFile {
7878#define DIRENTRIES_PER_SECTOR (BPB_SECTOR_SIZE/sizeof(DirEntry))
7979#define ROOT_DIR_SECTOR_COUNT (BPB_ROOT_DIR_ENTRIES/DIRENTRIES_PER_SECTOR)
8080
81+ #if defined(CFG_UF2_NUM_BLOCKS )
82+ STATIC_ASSERT (BPB_TOTAL_SECTORS >= CFG_UF2_NUM_BLOCKS ); // configuration used, and asked for a larger size GhostFAT?
83+ #endif
84+
8185STATIC_ASSERT (BPB_SECTOR_SIZE == 512 ); // GhostFAT does not support other sector sizes (currently)
8286STATIC_ASSERT (BPB_SECTORS_PER_CLUSTER == 1 ); // GhostFAT presumes one sector == one cluster (for simplicity)
8387STATIC_ASSERT (BPB_NUMBER_OF_FATS == 2 ); // FAT highest compatibility
You can’t perform that action at this time.
0 commit comments