Skip to content

Commit

Permalink
Merge branch 'bugfix/remove-fatfsgen-kconfig-option' into 'master'
Browse files Browse the repository at this point in the history
fatfsgen.py: removed unused options in Kconfig

Closes IDF-6038

See merge request espressif/esp-idf!20418
  • Loading branch information
dobairoland committed Oct 12, 2022
2 parents 0b6bc70 + 1206d05 commit ac315ad
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 91 deletions.
76 changes: 15 additions & 61 deletions components/fatfs/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,21 @@ menu "FAT Filesystem support"
help
Number of volumes (logical drives) to use.

choice FATFS_LONG_FILENAMES
prompt "Long filename support"
default FATFS_LFN_NONE
help
Support long filenames in FAT. Long filename data increases
memory usage. FATFS can be configured to store the buffer for
long filename data in stack or heap.

config FATFS_LFN_NONE
bool "No long filenames"
config FATFS_LFN_HEAP
bool "Long filename buffer in heap"
config FATFS_LFN_STACK
bool "Long filename buffer on stack"
endchoice
choice FATFS_SECTOR_SIZE
prompt "Sector size"
default FATFS_SECTOR_4096
Expand All @@ -15,38 +30,9 @@ menu "FAT Filesystem support"

config FATFS_SECTOR_512
bool "512"
config FATFS_SECTOR_1024
bool "1024"
config FATFS_SECTOR_2048
bool "2048"
config FATFS_SECTOR_4096
bool "4096"
endchoice

choice FATFS_SECTORS_PER_CLUSTER
prompt "Sectors per cluster"
default FATFS_SECTORS_PER_CLUSTER_1
help
This value specifies how many sectors there are in one cluster.

config FATFS_SECTORS_PER_CLUSTER_1
bool "1"
config FATFS_SECTORS_PER_CLUSTER_2
bool "2"
config FATFS_SECTORS_PER_CLUSTER_4
bool "4"
config FATFS_SECTORS_PER_CLUSTER_8
bool "8"
config FATFS_SECTORS_PER_CLUSTER_16
bool "16"
config FATFS_SECTORS_PER_CLUSTER_32
bool "32"
config FATFS_SECTORS_PER_CLUSTER_64
bool "64"
config FATFS_SECTORS_PER_CLUSTER_128
bool "128"
endchoice

choice FATFS_CHOOSE_CODEPAGE
prompt "OEM Code Page"
default FATFS_CODEPAGE_437
Expand Down Expand Up @@ -103,22 +89,6 @@ menu "FAT Filesystem support"
bool "Traditional Chinese (DBCS) (CP950)"

endchoice

choice FATFS_CHOOSE_TYPE
prompt "FAT type"
default FATFS_AUTO_TYPE
help
If user specifies automatic detection of the FAT type,
the FATFS generator will determine the type by the size.

config FATFS_AUTO_TYPE
bool "Select a suitable FATFS type automatically."
config FATFS_FAT12
bool "FAT12"
config FATFS_FAT16
bool "FAT16"
endchoice

config FATFS_CODEPAGE
int
default 0 if FATFS_CODEPAGE_DYNAMIC
Expand All @@ -145,22 +115,6 @@ menu "FAT Filesystem support"
default 950 if FATFS_CODEPAGE_950
default 437

choice FATFS_LONG_FILENAMES
prompt "Long filename support"
default FATFS_LFN_NONE
help
Support long filenames in FAT. Long filename data increases
memory usage. FATFS can be configured to store the buffer for
long filename data in stack or heap (Currently not supported by FATFS partition generator).

config FATFS_LFN_NONE
bool "No long filenames"
config FATFS_LFN_HEAP
bool "Long filename buffer in heap"
config FATFS_LFN_STACK
bool "Long filename buffer on stack"
endchoice

config FATFS_MAX_LFN
int "Max long filename length"
depends on !FATFS_LFN_NONE
Expand Down
30 changes: 0 additions & 30 deletions components/fatfs/project_include.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,6 @@ function(fatfs_create_partition_image partition base_dir)
set(default_datetime_option --use_default_datetime)
endif()

if("${CONFIG_FATFS_SECTORS_PER_CLUSTER_1}")
set(sectors_per_cluster 1)
elseif("${CONFIG_FATFS_SECTORS_PER_CLUSTER_2}")
set(sectors_per_cluster 2)
elseif("${CONFIG_FATFS_SECTORS_PER_CLUSTER_4}")
set(sectors_per_cluster 4)
elseif("${CONFIG_FATFS_SECTORS_PER_CLUSTER_8}")
set(sectors_per_cluster 8)
elseif("${CONFIG_FATFS_SECTORS_PER_CLUSTER_16}")
set(sectors_per_cluster 16)
elseif("${CONFIG_FATFS_SECTORS_PER_CLUSTER_32}")
set(sectors_per_cluster 32)
elseif("${CONFIG_FATFS_SECTORS_PER_CLUSTER_64}")
set(sectors_per_cluster 64)
elseif("${CONFIG_FATFS_SECTORS_PER_CLUSTER_128}")
set(sectors_per_cluster 128)
endif()

if("${CONFIG_FATFS_SECTOR_512}")
set(fatfs_sector_size 512)
elseif("${CONFIG_FATFS_SECTOR_1024}")
Expand All @@ -58,16 +40,6 @@ function(fatfs_create_partition_image partition base_dir)
set(fatfs_long_names_option --long_name_support)
endif()

if("${CONFIG_FATFS_AUTO_TYPE}")
set(fatfs_explicit_type 0)
elseif("${CONFIG_FATFS_FAT12}")
set(fatfs_explicit_type 12)
elseif("${CONFIG_FATFS_FAT16}")
set(fatfs_explicit_type 16)
endif()



get_filename_component(base_dir_full_path ${base_dir} ABSOLUTE)
partition_table_get_partition_info(size "--partition-name ${partition}" "size")
partition_table_get_partition_info(offset "--partition-name ${partition}" "offset")
Expand All @@ -83,8 +55,6 @@ function(fatfs_create_partition_image partition base_dir)
--partition_size ${size}
--output_file ${image_file}
--sector_size "${fatfs_sector_size}"
--sectors_per_cluster "${sectors_per_cluster}"
--fat_type "${fatfs_explicit_type}"
)
set_property(DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" APPEND PROPERTY
ADDITIONAL_MAKE_CLEAN_FILES
Expand Down

0 comments on commit ac315ad

Please sign in to comment.