Skip to content

Commit 4ee00c0

Browse files
authored
Enable exFAT feature (#2437)
* enabled exFAT in ffconf * added exFAT to sd card check * solved todo
1 parent 55525ed commit 4ee00c0

File tree

4 files changed

+9
-6
lines changed

4 files changed

+9
-6
lines changed

firmware/application/ui_navigation.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -798,7 +798,7 @@ void add_external_items(NavigationView& nav, app_location_t location, BtnGridVie
798798

799799
bool verify_sdcard_format() {
800800
FATFS* fs = &sd_card::fs;
801-
return (fs->fs_type == FS_FAT32) || !(sd_card::status() == sd_card::Status::Mounted);
801+
return (fs->fs_type == FS_FAT32 || fs->fs_type == FS_EXFAT) || !(sd_card::status() == sd_card::Status::Mounted);
802802
/* ^ to satisfy those users that not use an sd*/
803803
}
804804

@@ -875,7 +875,7 @@ SystemMenuView::SystemMenuView(NavigationView& nav)
875875
void SystemMenuView::on_populate() {
876876
if (!verify_sdcard_format()) {
877877
add_item({"SDCard Error", Theme::getInstance()->error_dark->foreground, nullptr, [this]() {
878-
nav_.display_modal("Error", "SD Card is not FAT32,\nformat to FAT32 on PC");
878+
nav_.display_modal("Error", "SD Card is not exFAT/FAT32,\nformat to exFAT or FAT32 on PC");
879879
}});
880880
}
881881
add_apps(nav_, *this, HOME);

firmware/application/ui_sd_card_debug.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -473,7 +473,7 @@ std::string SDCardDebugView::fetch_sdcard_format() {
473473
case FS_FAT32:
474474
resault = "FAT32";
475475
break;
476-
case FS_EXFAT: // TODO: a bug from filesystem can't detect exfat, issue not from here
476+
case FS_EXFAT:
477477
resault = "ExFAT";
478478
break;
479479
default:

firmware/baseband/CMakeLists.txt

+4-1
Original file line numberDiff line numberDiff line change
@@ -271,6 +271,7 @@ macro(DeclareTargets chunk_tag name)
271271
project("baseband_${name}")
272272

273273
include(${RULESPATH}/rules.cmake)
274+
set_source_files_properties(${MODE_CPPSRC} PROPERTIES COMPILE_FLAGS "${MODE_FLAGS}")
274275
add_executable(${PROJECT_NAME}.elf $<TARGET_OBJECTS:baseband_shared> ${MODE_CPPSRC} ${HALSRC} ${PLATFORMSRC})
275276
set_target_properties(${PROJECT_NAME}.elf PROPERTIES LINK_DEPENDS ${LDSCRIPT})
276277
add_definitions(${DEFS})
@@ -313,6 +314,7 @@ macro(DeclareTargets chunk_tag name)
313314
endmacro()
314315

315316
set(add_to_firmware TRUE)
317+
set(MODE_FLAGS "-O3")
316318

317319

318320
### ADS-B RX
@@ -498,6 +500,7 @@ set(MODE_CPPSRC
498500
)
499501
DeclareTargets(PWTH weather)
500502

503+
set(MODE_FLAGS "-Os")
501504

502505
### Flash Utility
503506

@@ -559,7 +562,7 @@ DeclareTargets(PUSB sd_over_usb)
559562

560563
### Place external app and disabled images below so they don't get added to the firmware
561564
set(add_to_firmware FALSE)
562-
565+
set(MODE_FLAGS "-O3")
563566

564567
### ACARS RX
565568

firmware/common/ffconf.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@
9090
/ 950 - Traditional Chinese (DBCS)
9191
*/
9292

93-
#define _USE_LFN 2
93+
#define _USE_LFN 3
9494
#define _MAX_LFN 255
9595
/* The _USE_LFN switches the support of long file name (LFN).
9696
/
@@ -189,7 +189,7 @@
189189
/ Instead of private sector buffer eliminated from the file object, common sector
190190
/ buffer in the file system object (FATFS) is used for the file data transfer. */
191191

192-
#define _FS_EXFAT 0
192+
#define _FS_EXFAT 1
193193
/* This option switches support of exFAT file system. (0:Disable or 1:Enable)
194194
/ When enable exFAT, also LFN needs to be enabled. (_USE_LFN >= 1)
195195
/ Note that enabling exFAT discards ANSI C (C89) compatibility. */

0 commit comments

Comments
 (0)