LoginSignup
0
0

More than 5 years have passed since last update.

FatFS > R0.13 > fs->winをセットしている処理の整理

Posted at

http://elm-chan.org/fsw/ff/00index_e.html
http://elm-chan.org/fsw/ff/archives.html

ChaNさんによるFatFSに関して見ている(ソースのバージョンはR0.13)。
(R0.13のR0.12cバグ修正と関連して)。

Fixed exFAT FAT entry can be collapsed when write or lseek operation to the existing file is done. (appeared at R0.12c)

ff.hにおいてFATFS構造体が定義されている。その中で気になっているメンバは以下。

ff.h
    ...
    BYTE    win[FF_MAX_SS]; /* Disk access window for Directory, FAT (and file data at tiny cfg) */
} FATFS;

win[]の値はどこでセットされているのか?

sync_fs()において以下のような実装で値がセットされている。
st_word()というのはstoreする関数のようだ。他にst_dword()とst_qword()がある。

st_word(fs->win + BS_55AA, 0xAA55);

put_fat()においても以下のような実装で値がセットされている。

st_dword(fs->win + clst * 4 % SS(fs), val);

これらの値がdisk_write()においてData to be writtenとして使用されているようだ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0