Skip to content

Fix warnings in platformio for FFat libary #2960

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 9, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions libraries/FFat/src/FFat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void F_Fat::end()
log_e("Unmounting FFat partition failed! Error: %d", err);
return;
}
_wl_handle = NULL;
_wl_handle = 0;
_impl->mountpoint(NULL);
}
}
Expand Down Expand Up @@ -109,7 +109,9 @@ size_t F_Fat::totalBytes()

BYTE pdrv = ff_diskio_get_pdrv_wl(_wl_handle);
char drv[3] = {(char)(48+pdrv), ':', 0};
FRESULT res = f_getfree(drv, &free_clust, &fs);
if ( f_getfree(drv, &free_clust, &fs) != FR_OK){
return 0;
}
tot_sect = (fs->n_fatent - 2) * fs->csize;
sect_size = CONFIG_WL_SECTOR_SIZE;
return tot_sect * sect_size;
Expand All @@ -123,7 +125,9 @@ size_t F_Fat::freeBytes()

BYTE pdrv = ff_diskio_get_pdrv_wl(_wl_handle);
char drv[3] = {(char)(48+pdrv), ':', 0};
FRESULT res = f_getfree(drv, &free_clust, &fs);
if ( f_getfree(drv, &free_clust, &fs) != FR_OK){
return 0;
}
free_sect = free_clust * fs->csize;
sect_size = CONFIG_WL_SECTOR_SIZE;
return free_sect * sect_size;
Expand Down