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 {
68
68
#define BPB_RESERVED_SECTORS ( 1)
69
69
#define BPB_NUMBER_OF_FATS ( 2)
70
70
#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
72
72
#define BPB_MEDIA_DESCRIPTOR_BYTE (0xF8)
73
73
#define FAT_ENTRY_SIZE (2)
74
74
#define FAT_ENTRIES_PER_SECTOR (BPB_SECTOR_SIZE / FAT_ENTRY_SIZE)
@@ -78,6 +78,10 @@ struct TextFile {
78
78
#define DIRENTRIES_PER_SECTOR (BPB_SECTOR_SIZE/sizeof(DirEntry))
79
79
#define ROOT_DIR_SECTOR_COUNT (BPB_ROOT_DIR_ENTRIES/DIRENTRIES_PER_SECTOR)
80
80
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
+
81
85
STATIC_ASSERT (BPB_SECTOR_SIZE == 512 ); // GhostFAT does not support other sector sizes (currently)
82
86
STATIC_ASSERT (BPB_SECTORS_PER_CLUSTER == 1 ); // GhostFAT presumes one sector == one cluster (for simplicity)
83
87
STATIC_ASSERT (BPB_NUMBER_OF_FATS == 2 ); // FAT highest compatibility
You can’t perform that action at this time.
0 commit comments