1menu "Wear Levelling"
2
3    choice WL_SECTOR_SIZE
4        bool "Wear Levelling library sector size"
5        default WL_SECTOR_SIZE_4096
6        help
7            Sector size used by wear levelling library.
8            You can set default sector size or size that will
9            fit to the flash device sector size.
10
11            With sector size set to 4096 bytes, wear levelling library is more
12            efficient. However if FAT filesystem is used on top of wear levelling
13            library, it will need more temporary storage: 4096 bytes for each
14            mounted filesystem and 4096 bytes for each opened file.
15
16            With sector size set to 512 bytes, wear levelling library will perform
17            more operations with flash memory, but less RAM will be used by FAT
18            filesystem library (512 bytes for the filesystem and 512 bytes for each
19            file opened).
20
21        config WL_SECTOR_SIZE_512
22            bool "512"
23        config WL_SECTOR_SIZE_4096
24            bool "4096"
25    endchoice
26
27    config WL_SECTOR_SIZE
28        int
29        default 512 if WL_SECTOR_SIZE_512
30        default 4096 if WL_SECTOR_SIZE_4096
31
32    choice WL_SECTOR_MODE
33        bool "Sector store mode"
34        depends on WL_SECTOR_SIZE_512
35        default WL_SECTOR_MODE_SAFE
36        help
37            Specify the mode to store data into flash:
38
39            - In Performance mode a data will be stored to the RAM and then
40              stored back to the flash. Compared to the Safety mode, this operation is
41              faster, but if power will be lost when erase sector operation is in
42              progress, then the data from complete flash device sector will be lost.
43
44            - In Safety mode data from complete flash device sector will be read from
45              flash, modified, and then stored back to flash.
46              Compared to the Performance mode, this operation is slower, but if
47              power is lost during erase sector operation, then the data from full
48              flash device sector will not be lost.
49
50        config WL_SECTOR_MODE_PERF
51            bool "Perfomance"
52
53        config WL_SECTOR_MODE_SAFE
54            bool "Safety"
55    endchoice
56
57    config WL_SECTOR_MODE
58        int
59        default 0 if WL_SECTOR_MODE_PERF
60        default 1 if WL_SECTOR_MODE_SAFE
61
62endmenu
63