diff --git a/radio/src/CMakeLists.txt b/radio/src/CMakeLists.txt index dd2cbc30e..1553e22fe 100644 --- a/radio/src/CMakeLists.txt +++ b/radio/src/CMakeLists.txt @@ -59,6 +59,7 @@ else() option(USBJ_EX "Enable USB Joystick Extension" ON) endif() option(AUDIO "Enable audio" ON) +option(EXFAT "Enable exFAT filesystem support in FatFs" OFF) if(NATIVE_BUILD) option(ALL_LANGUAGES "Enable runtime language selection" ON) diff --git a/radio/src/hal/CMakeLists.txt b/radio/src/hal/CMakeLists.txt index b223aa5fb..589d1e8cd 100644 --- a/radio/src/hal/CMakeLists.txt +++ b/radio/src/hal/CMakeLists.txt @@ -27,6 +27,10 @@ endif() include_directories(${FATFS_DIR} ${FATFS_DIR}/option) +if(EXFAT) + add_definitions(-DFF_FS_EXFAT=1) +endif() + set(BOOTLOADER_SRC ${BOOTLOADER_SRC} ${CMAKE_CURRENT_SOURCE_DIR}/hal/key_driver.cpp ) diff --git a/radio/src/thirdparty/FatFs/ffconf.h b/radio/src/thirdparty/FatFs/ffconf.h index 69d72880f..014fce51f 100644 --- a/radio/src/thirdparty/FatFs/ffconf.h +++ b/radio/src/thirdparty/FatFs/ffconf.h @@ -238,7 +238,9 @@ / buffer in the filesystem object (FATFS) is used for the file data transfer. */ +#ifndef FF_FS_EXFAT #define FF_FS_EXFAT 0 +#endif /* This option switches support for exFAT filesystem. (0:Disable or 1:Enable) / To enable exFAT, also LFN needs to be enabled. (FF_USE_LFN >= 1) / Note that enabling exFAT discards ANSI C (C89) compatibility. */