Prusa MINI Firmware overview
|
Go to the documentation of this file.
32 #error Wrong configuration file (ffconf.h).
44 extern PARTITION VolToPart[];
53 #error _LFN_UNICODE must be 0 at non-LFN cfg.
58 #define _TEXT(x) L ## x
74 #error LFN must be enabled when enable exFAT
94 #if _MAX_SS != _MIN_SS
277 #define f_eof(fp) ((int)((fp)->fptr == (fp)->obj.objsize))
278 #define f_error(fp) ((fp)->err)
279 #define f_tell(fp) ((fp)->fptr)
280 #define f_size(fp) ((fp)->obj.objsize)
281 #define f_rewind(fp) f_lseek((fp), 0)
282 #define f_rewinddir(dp) f_readdir((dp), 0)
283 #define f_rmdir(path) f_unlink(path)
296 #if !_FS_READONLY && !_FS_NORTC
305 void* ff_memalloc (
UINT msize);
306 void ff_memfree (
void* mblock);
313 int ff_req_grant (
_SYNC_t sobj);
314 void ff_rel_grant (
_SYNC_t sobj);
315 int ff_del_syncobj (
_SYNC_t sobj);
327 #define FA_WRITE 0x02
328 #define FA_OPEN_EXISTING 0x00
329 #define FA_CREATE_NEW 0x04
330 #define FA_CREATE_ALWAYS 0x08
331 #define FA_OPEN_ALWAYS 0x10
332 #define FA_OPEN_APPEND 0x30
335 #define CREATE_LINKMAP ((FSIZE_t)0 - 1)
339 #define FM_FAT32 0x02
340 #define FM_EXFAT 0x04
static FRESULT dir_read(DIR *dp, int vol)
Definition: ff.c:2131
FRESULT f_lseek(FIL *fp, FSIZE_t ofs)
Definition: ff.c:4060
WCHAR ff_wtoupper(WCHAR chr)
Definition: ccsbcs.c:303
#define STA_NOINIT
Definition: onboard_sd.h:55
#define FA_OPEN_ALWAYS
Definition: ff.h:331
#define GET_SECTOR_COUNT
Definition: onboard_sd.h:63
static BYTE check_fs(FATFS *fs, DWORD sect)
Definition: ff.c:2964
#define XDIR_FstClus
Definition: ff.c:427
#define BS_BootSig32
Definition: ff.c:367
#define BPB_ZeroedEx
Definition: ff.c:373
#define PTE_Boot
Definition: ff.c:442
char TCHAR
Definition: ff.h:62
#define BPB_FSVerEx
Definition: ff.c:382
FRESULT f_expand(FIL *fp, FSIZE_t szf, BYTE opt)
#define FSI_Free_Count
Definition: ff.c:437
#define XDIR_FileSize
Definition: ff.c:428
#define NS_LOSS
Definition: ff.c:314
static FRESULT dir_next(DIR *dp, int stretch)
Definition: ff.c:1519
FRESULT f_getlabel(const TCHAR *path, TCHAR *label, DWORD *vsn)
FRESULT f_chdir(const TCHAR *path)
#define XDIR_ValidFileSize
Definition: ff.c:426
FRESULT f_mkfs(const TCHAR *path, BYTE opt, DWORD au, void *work, UINT len)
FRESULT f_unlink(const TCHAR *path)
Definition: ff.c:4584
#define XDIR_NumLabel
Definition: ff.c:409
#define DIR_CrtTime
Definition: ff.c:397
FRESULT f_write(FIL *fp, const void *buff, UINT btw, UINT *bw)
Definition: ff.c:3599
DWORD last_clst
Definition: ff.h:107
DWORD fatbase
Definition: ff.h:121
#define AM_HID
Definition: ff.h:352
FRESULT f_stat(const TCHAR *path, FILINFO *fno)
Definition: ff.c:4412
static FRESULT dir_sdi(DIR *dp, DWORD ofs)
Definition: ff.c:1470
BYTE stat
Definition: ff.h:136
#define NS_EXT
Definition: ff.c:318
FRESULT f_rename(const TCHAR *path_old, const TCHAR *path_new)
Definition: ff.c:4776
#define LDIR_Attr
Definition: ff.c:404
#define LLEF
Definition: ff.c:433
#define MAX_DIR
Definition: ff.c:325
#define DIR_FstClusHI
Definition: ff.c:399
#define BPB_FSVer32
Definition: ff.c:361
#define BS_FilSysType32
Definition: ff.c:370
FRESULT f_chmod(const TCHAR *path, BYTE attr, BYTE mask)
#define FA_WRITE
Definition: ff.h:327
#define LDIR_FstClusLO
Definition: ff.c:407
static void st_dword(BYTE *ptr, DWORD val)
Definition: ff.c:661
#define DIR_FileSize
Definition: ff.c:402
#define XDIR_AccTime
Definition: ff.c:417
WORD csize
Definition: ff.h:93
#define DIR_NTres
Definition: ff.c:395
#define NS_LFN
Definition: ff.c:315
DSTATUS disk_initialize(BYTE pdrv)
Initializes a Drive.
Definition: diskio.c:91
BYTE fattrib
Definition: ff.h:201
#define LDIR_Chksum
Definition: ff.c:406
#define BPB_SecPerTrk
Definition: ff.c:346
FSIZE_t fptr
Definition: ff.h:159
DWORD winsect
Definition: ff.h:124
static FRESULT dir_find(DIR *dp)
Definition: ff.c:2210
#define CREATE_LINKMAP
Definition: ff.h:335
FRESULT f_chdrive(const TCHAR *path)
#define INIT_NAMBUF(fs)
Definition: ff.c:546
FRESULT f_close(FIL *fp)
Definition: ff.c:3801
#define FA_OPEN_APPEND
Definition: ff.h:332
#define pd
Definition: screen_filebrowser.cpp:39
#define LDIR_Ord
Definition: ff.c:403
#define BS_BootSig
Definition: ff.c:352
#define BPB_NumClusEx
Definition: ff.c:379
FRESULT f_open(FIL *fp, const TCHAR *path, BYTE mode)
Definition: ff.c:3296
DWORD clust
Definition: ff.h:160
#define LD2PD(vol)
Definition: ff.c:476
static FRESULT dir_remove(DIR *dp)
Definition: ff.c:2396
#define XDIR_SetSum
Definition: ff.c:413
static FRESULT validate(_FDID *obj, FATFS **fs)
Definition: ff.c:3215
#define BPB_FATSz16
Definition: ff.c:345
#define FA_CREATE_ALWAYS
Definition: ff.h:330
DWORD n_fatent
Definition: ff.h:118
#define MBR_Table
Definition: ff.c:440
unsigned short WORD
Definition: onboard_sd.h:14
WORD fdate
Definition: ff.h:199
#define BS_JmpBoot
Definition: ff.c:336
_FDID obj
Definition: ff.h:156
int f_puts(const TCHAR *str, FIL *cp)
DRESULT disk_read(BYTE pdrv, BYTE *buff, DWORD sector, UINT count)
Reads Sector(s)
Definition: diskio.c:113
#define BPB_SecPerClus
Definition: ff.c:339
#define XDIR_Label
Definition: ff.c:410
uint8_t i
Definition: screen_test_graph.c:72
static void get_fileinfo(DIR *dp, FILINFO *fno)
Definition: ff.c:2444
#define FS_EXFAT
Definition: ff.h:348
#define BS_55AA
Definition: ff.c:357
FRESULT f_getdirpath(DIR *pd, TCHAR *buff, UINT len)
DWORD sclust
Definition: ff.h:137
FRESULT f_closedir(DIR *dp)
Definition: ff.c:4291
DWORD clust
Definition: ff.h:181
DWORD FSIZE_t
Definition: ff.h:78
static DWORD ld_clust(FATFS *fs, const BYTE *dir)
Definition: ff.c:1632
#define BPB_RootClusEx
Definition: ff.c:380
#define NS_NONAME
Definition: ff.c:321
#define BS_DrvNum
Definition: ff.c:350
#define PTE_EdHead
Definition: ff.c:447
static DWORD clust2sect(FATFS *fs, DWORD clst)
Definition: ff.c:983
#define IsLower(c)
Definition: ff.c:275
FRESULT f_unlink(const TCHAR *path)
Definition: ff.c:4584
#define FSI_LeadSig
Definition: ff.c:435
static FRESULT remove_chain(_FDID *obj, DWORD clst, DWORD pclst)
Definition: ff.c:1271
#define BPB_NumFATsEx
Definition: ff.c:387
#define FS_FAT16
Definition: ff.h:346
static FRESULT put_fat(FATFS *fs, DWORD clst, DWORD val)
Definition: ff.c:1081
#define _VOLUMES
Definition: ffconf.h:194
FRESULT f_stat(const TCHAR *path, FILINFO *fno)
Definition: ff.c:4412
#define DIR_ModTime
Definition: ff.c:400
#define BS_BootCodeEx
Definition: ff.c:391
BYTE fn[12]
Definition: ff.h:184
static FRESULT dir_register(DIR *dp)
Definition: ff.c:2292
#define BPB_VolOfsEx
Definition: ff.c:374
FRESULT f_mount(FATFS *fs, const TCHAR *path, BYTE opt)
Definition: ff.c:3248
DWORD dptr
Definition: ff.h:180
BYTE flag
Definition: ff.h:157
static FRESULT sync_window(FATFS *fs)
Definition: ff.c:883
#define FSI_StrucSig
Definition: ff.c:436
#define STA_PROTECT
Definition: onboard_sd.h:57
#define NSFLAG
Definition: ff.c:313
#define DIR_Name
Definition: ff.c:393
#define DIR_FstClusLO
Definition: ff.c:401
static WORD ld_word(const BYTE *ptr)
Definition: ff.c:613
BYTE * dir
Definition: ff.h:183
#define BYTE
Definition: MarlinSerial.h:142
WORD n_rootdir
Definition: ff.h:92
#define BPB_BytsPerSec
Definition: ff.c:338
static void st_clust(FATFS *fs, BYTE *dir, DWORD cl)
Definition: ff.c:1650
#define FA_MODIFIED
Definition: ff.c:308
#define _FS_RPATH
Definition: ffconf.h:182
#define NS_NOLFN
Definition: ff.c:320
#define BPB_FATSz32
Definition: ff.c:359
static void mem_cpy(void *dst, const void *src, UINT cnt)
Definition: ff.c:693
#define BS_FilSysType
Definition: ff.c:355
#define XDIR_CrtTime
Definition: ff.c:415
static DWORD ld_dword(const BYTE *ptr)
Definition: ff.c:623
DWORD get_fattime(void)
Gets Time from RTC.
Definition: diskio.c:175
BYTE fsi_flag
Definition: ff.h:90
#define XDIR_NameHash
Definition: ff.c:425
BYTE n_fats
Definition: ff.h:88
#define MAX_FAT12
Definition: ff.c:327
FSIZE_t objsize
Definition: ff.h:138
#define _SYNC_t
Definition: ffconf.h:280
#define BPB_NumHeads
Definition: ff.c:347
#define XDIR_ModTime
Definition: ff.c:416
#define FA_READ
Definition: ff.h:326
#define FS_FAT32
Definition: ff.h:347
static FRESULT follow_path(DIR *dp, const TCHAR *path)
Definition: ff.c:2812
#define XDIR_Attr
Definition: ff.c:414
#define PTE_StCyl
Definition: ff.c:445
#define BPB_TotSecEx
Definition: ff.c:375
static void st_word(BYTE *ptr, WORD val)
Definition: ff.c:654
FRESULT f_setlabel(const TCHAR *label)
static FRESULT find_volume(const TCHAR **path, FATFS **rfs, BYTE mode)
Definition: ff.c:2992
#define GET_FATTIME()
Definition: ff.c:499
#define NS_BODY
Definition: ff.c:317
#define BPB_TotSec32
Definition: ff.c:349
static DWORD create_chain(_FDID *obj, DWORD clst)
Definition: ff.c:1351
#define SZ_PTE
Definition: ff.c:441
#define MAX_FAT16
Definition: ff.c:328
WORD ftime
Definition: ff.h:200
FRESULT f_opendir(DIR *dp, const TCHAR *path)
Definition: ff.c:4221
FRESULT f_mkdir(const TCHAR *path)
Definition: ff.c:4679
static void mem_set(void *dst, int val, UINT cnt)
Definition: ff.c:706
FRESULT f_readdir(DIR *dp, FILINFO *fno)
Definition: ff.c:4324
FRESULT f_read(FIL *fp, void *buff, UINT btr, UINT *br)
Definition: ff.c:3499
#define PTE_EdCyl
Definition: ff.c:449
#define AM_VOL
Definition: ff.c:301
BYTE * dir_ptr
Definition: ff.h:164
#define FA_SEEKEND
Definition: ff.c:307
FRESULT f_getfree(const TCHAR *path, DWORD *nclst, FATFS **fatfs)
Definition: ff.c:4447
WORD id
Definition: ff.h:134
#define NS_DOT
Definition: ff.c:319
#define BPB_BytsPerSecEx
Definition: ff.c:385
Definition: onboard_sd.h:23
FRESULT f_truncate(FIL *fp)
Definition: ff.c:4534
#define DIR_Attr
Definition: ff.c:394
#define BPB_DataOfsEx
Definition: ff.c:378
DSTATUS disk_status(BYTE pdrv)
Gets Disk Status.
Definition: diskio.c:76
#define BPB_FSInfo32
Definition: ff.c:363
DWORD sect
Definition: ff.h:182
FRESULT f_utime(const TCHAR *path, const FILINFO *fno)
static WORD Fsid
Definition: ff.c:534
static int mem_cmp(const void *dst, const void *src, UINT cnt)
Definition: ff.c:716
#define _MAX_LFN
Definition: ffconf.h:150
#define MAX_FAT32
Definition: ff.c:329
if(size<=((png_alloc_size_t) -1) - ob)
Definition: pngwrite.c:2176
FRESULT f_lseek(FIL *fp, FSIZE_t ofs)
Definition: ff.c:4060
BYTE DSTATUS
Definition: onboard_sd.h:19
list a
Definition: createSpeedLookupTable.py:29
#define BPB_RootClus32
Definition: ff.c:362
int f_printf(FIL *fp, const TCHAR *str,...)
WORD id
Definition: ff.h:91
#define FSI_Nxt_Free
Definition: ff.c:438
#define BPB_FatSzEx
Definition: ff.c:377
BYTE err
Definition: ff.h:158
#define _VOLUME_STRS
Definition: ffconf.h:199
BYTE fs_type
Definition: ff.h:86
#define _FS_LOCK
Definition: ffconf.h:267
DRESULT disk_write(BYTE pdrv, const BYTE *buff, DWORD sector, UINT count)
Writes Sector(s)
Definition: diskio.c:135
BYTE wflag
Definition: ff.h:89
BYTE win[_MAX_SS]
Definition: ff.h:125
TCHAR fname[13]
Definition: ff.h:206
TCHAR * f_gets(TCHAR *buff, int len, FIL *fp)
#define AM_SYS
Definition: ff.h:353
FRESULT f_forward(FIL *fp, UINT(*func)(const BYTE *, UINT), UINT btf, UINT *bf)
#define IsDBCS1(c)
Definition: ff.c:294
#define BPB_FatOfsEx
Definition: ff.c:376
#define BPB_Media
Definition: ff.c:344
DWORD dir_sect
Definition: ff.h:163
#define XDIR_GenFlags
Definition: ff.c:423
#define FM_ANY
Definition: ff.h:341
#define XDIR_NumName
Definition: ff.c:424
DRESULT disk_ioctl(BYTE pdrv, BYTE cmd, void *buff)
I/O control operation.
Definition: diskio.c:157
#define LEAVE_FF(fs, res)
Definition: ff.c:467
#define SS(fs)
Definition: ff.c:486
#define GET_SECTOR_SIZE
Definition: onboard_sd.h:64
DWORD free_clst
Definition: ff.h:108
unsigned long DWORD
Definition: onboard_sd.h:15
FRESULT f_write(FIL *fp, const void *buff, UINT btw, UINT *bw)
Definition: ff.c:3599
#define BPB_BkBootSec32
Definition: ff.c:364
static DWORD get_fat(_FDID *obj, DWORD clst)
Definition: ff.c:1001
#define BPB_DrvNumEx
Definition: ff.c:388
#define _USE_LFN
Definition: ffconf.h:148
FRESULT
Definition: ff.h:214
#define AM_DIR
Definition: ff.h:354
DWORD volbase
Definition: ff.h:120
FRESULT f_findnext(DIR *dp, FILINFO *fno)
#define _FS_READONLY
Definition: ffconf.h:69
FRESULT f_rename(const TCHAR *path_old, const TCHAR *path_new)
Definition: ff.c:4776
FRESULT f_sync(FIL *fp)
Definition: ff.c:3720
#define _MIN_SS
Definition: ffconf.h:214
uint8_t rbuff[10]
Definition: HardwareSerial.cpp:19
#define XDIR_NumSec
Definition: ff.c:412
#define _FS_EXFAT
Definition: ffconf.h:249
DWORD fsize
Definition: ff.h:119
#define IsUpper(c)
Definition: ff.c:274
BYTE buf[_MAX_SS]
Definition: ff.h:170
#define BS_VolLab32
Definition: ff.c:369
FRESULT f_getcwd(TCHAR *buff, UINT len)
#define FREE_NAMBUF()
Definition: ff.c:547
#define _USE_STRFUNC
Definition: ffconf.h:84
#define MAX_EXFAT
Definition: ff.c:330
#define IsDBCS2(c)
Definition: ff.c:295
#define PTE_StLba
Definition: ff.c:450
#define FS_FAT12
Definition: ff.h:345
FRESULT f_opendir(DIR *dp, const TCHAR *path)
Definition: ff.c:4221
#define IsDigit(c)
Definition: ff.c:276
#define ENTER_FF(fs)
Definition: ff.c:466
#define ABORT(fs, res)
Definition: ff.c:455
static int get_ldnumber(const TCHAR **path)
Definition: ff.c:2903
DWORD sect
Definition: ff.h:161
#define PTE_SizLba
Definition: ff.c:451
#define BPB_RsvdSecCnt
Definition: ff.c:340
#define AM_LFN
Definition: ff.c:302
FRESULT f_mount(FATFS *fs, const TCHAR *path, BYTE opt)
Definition: ff.c:3248
static FRESULT sync_fs(FATFS *fs)
Definition: ff.c:944
#define DDEM
Definition: ff.c:431
FRESULT f_open(FIL *fp, const TCHAR *path, BYTE mode)
Definition: ff.c:3296
#define XDIR_CrtTime10
Definition: ff.c:418
int pattern_matching(const TCHAR *pat, const TCHAR *nam, int skip, int inf)
#define GET_BLOCK_SIZE
Definition: onboard_sd.h:65
#define BS_DrvNum32
Definition: ff.c:365
#define BS_VolLab
Definition: ff.c:354
unsigned char BYTE
Definition: onboard_sd.h:13
FRESULT f_truncate(FIL *fp)
Definition: ff.c:4534
#define FM_EXFAT
Definition: ff.h:340
DWORD dirbase
Definition: ff.h:122
FATFS * fs
Definition: ff.h:133
#define BPB_HiddSec
Definition: ff.c:348
WCHAR ff_convert(WCHAR chr, UINT dir)
Definition: ccsbcs.c:275
BYTE drv
Definition: ff.h:87
int
Definition: createSpeedLookupTable.py:15
#define BPB_VolIDEx
Definition: ff.c:381
#define XDIR_ModTime10
Definition: ff.c:419
unsigned long long QWORD
Definition: integer.h:34
#define FM_FAT
Definition: ff.h:338
#define BPB_SecPerClusEx
Definition: ff.c:386
#define RDDEM
Definition: ff.c:432
#define MAX_DIR_EX
Definition: ff.c:326
#define DEF_NAMBUF
Definition: ff.c:545
static FRESULT dir_alloc(DIR *dp, UINT nent)
Definition: ff.c:1589
#define FA_DIRTY
Definition: ff.c:309
#define _MULTI_PARTITION
Definition: ffconf.h:207
FRESULT f_closedir(DIR *dp)
Definition: ff.c:4291
#define BS_VolID
Definition: ff.c:353
#define CTRL_TRIM
Definition: onboard_sd.h:66
#define BPB_PercInUseEx
Definition: ff.c:389
#define EOF
Definition: ff.h:286
#define BPB_VolFlagEx
Definition: ff.c:383
unsigned short WCHAR
Definition: integer.h:27
#define SZDIRE
Definition: ff.c:430
#define BPB_TotSec16
Definition: ff.c:343
static FRESULT create_name(DIR *dp, const TCHAR **path)
Definition: ff.c:2617
#define PTE_StSec
Definition: ff.c:444
#define LD2PT(vol)
Definition: ff.c:477
#define PTE_EdSec
Definition: ff.c:448
png_structrp int mode
Definition: png.h:1139
#define PTE_StHead
Definition: ff.c:443
int f_putc(TCHAR c, FIL *fp)
#define LDIR_Type
Definition: ff.c:405
FRESULT f_findfirst(DIR *dp, FILINFO *fno, const TCHAR *path, const TCHAR *pattern)
list b
Definition: createSpeedLookupTable.py:30
#define FM_FAT32
Definition: ff.h:339
#define AM_RDO
Definition: ff.h:351
unsigned int UINT
Definition: onboard_sd.h:16
#define AM_ARC
Definition: ff.h:355
#define PTE_System
Definition: ff.c:446
FRESULT f_mkdir(const TCHAR *path)
Definition: ff.c:4679
#define _USE_LABEL
Definition: ffconf.h:109
#define AM_MASK
Definition: ff.c:303
FRESULT f_readdir(DIR *dp, FILINFO *fno)
Definition: ff.c:4324
FRESULT f_fdisk(BYTE pdrv, const DWORD *szt, void *work)
FRESULT f_read(FIL *fp, void *buff, UINT btr, UINT *br)
Definition: ff.c:3499
FRESULT f_sync(FIL *fp)
Definition: ff.c:3720
FRESULT f_close(FIL *fp)
Definition: ff.c:3801
DWORD database
Definition: ff.h:123
#define BPB_NumFATs
Definition: ff.c:341
#define XDIR_Type
Definition: ff.c:408
_FDID obj
Definition: ff.h:179
FRESULT f_getfree(const TCHAR *path, DWORD *nclst, FATFS **fatfs)
Definition: ff.c:4447
static FRESULT move_window(FATFS *fs, DWORD sector)
Definition: ff.c:912
#define CTRL_SYNC
Definition: onboard_sd.h:62
#define FM_SFD
Definition: ff.h:342
#define FA_CREATE_NEW
Definition: ff.h:329
static int chk_chr(const char *str, int chr)
Definition: ff.c:729
static FATFS * FatFs[_VOLUMES]
Definition: ff.c:533
BYTE attr
Definition: ff.h:135
FSIZE_t fsize
Definition: ff.h:198
#define _MAX_SS
Definition: ffconf.h:215
#define NS_LAST
Definition: ff.c:316
#define DIR_LstAccDate
Definition: ff.c:398
#define BPB_RootEntCnt
Definition: ff.c:342
#define BS_VolID32
Definition: ff.c:368