File tree 1 file changed +13
-2
lines changed
1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -76,21 +76,28 @@ void F_Fat::end()
76
76
bool F_Fat::format (bool full_wipe, char * partitionLabel)
77
77
{
78
78
esp_err_t result;
79
+ bool res = true ;
79
80
if (_wl_handle){
80
81
log_w (" Already Mounted!" );
81
82
return false ;
82
83
}
83
84
wl_handle_t temp_handle;
84
85
// Attempt to mount to see if there is already data
85
86
const esp_partition_t *ffat_partition = check_ffat_partition (partitionLabel);
86
- if (!ffat_partition) return false ;
87
+ if (!ffat_partition){
88
+ log_w (" No partition!" );
89
+ return false ;
90
+ }
87
91
result = wl_mount (ffat_partition, &temp_handle);
88
92
89
93
if (result == ESP_OK) {
90
94
// Wipe disk- quick just wipes the FAT. Full zeroes the whole disk
91
95
uint32_t wipe_size = full_wipe ? wl_size (temp_handle) : 16384 ;
92
96
wl_erase_range (temp_handle, 0 , wipe_size);
93
97
wl_unmount (temp_handle);
98
+ } else {
99
+ res = false ;
100
+ log_w (" wl_mount failed!" );
94
101
}
95
102
// Now do a mount with format_if_fail (which it will)
96
103
esp_vfs_fat_mount_config_t conf = {
@@ -99,7 +106,11 @@ bool F_Fat::format(bool full_wipe, char* partitionLabel)
99
106
};
100
107
result = esp_vfs_fat_spiflash_mount (" /format_ffat" , partitionLabel, &conf, &temp_handle);
101
108
esp_vfs_fat_spiflash_unmount (" /format_ffat" , temp_handle);
102
- return result;
109
+ if (result != ESP_OK){
110
+ res = false ;
111
+ log_w (" esp_vfs_fat_spiflash_mount failed!" );
112
+ }
113
+ return res;
103
114
}
104
115
105
116
size_t F_Fat::totalBytes ()
You can’t perform that action at this time.
0 commit comments