Skip to content
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

Fix for GetStorageFilesNative when using SPIFFS #1462

Merged
merged 1 commit into from
Oct 25, 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
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ extern bool sdCardFileSystemReady;
#if (HAL_USBH_USE_MSD == TRUE)
extern bool usbMsdFileSystemReady;
#endif
#if USE_SPIFFS_FOR_STORAGE
extern bool spiffsFileSystemReady;
extern spiffs fs;
#endif

void CombinePath(char * outpath, const char * path1, const char * path2)
{
Expand Down Expand Up @@ -665,7 +669,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::GetStorageFile
// ... that the path is the drive root (because SPIFFS doesn't support folders)
#if (USE_SPIFFS_FOR_STORAGE == TRUE)
if( (WORKING_DRIVE_IS_INTERNAL_DRIVE) &&
(hal_strlen_s(workingPath) == DRIVE_PATH_LENGTH))
(hal_strlen_s(workingPath) == DRIVE_PATH_LENGTH - 1))
{
// this is the SPIFFS drive
spiffs_DIR drive;
Expand Down Expand Up @@ -714,6 +718,7 @@ HRESULT Library_win_storage_native_Windows_Storage_StorageFolder::GetStorageFile
// and reset the file iterator vars too
itemIndex = 0;
fileCount = 0;
pe = &e;

while ((pe = SPIFFS_readdir(&drive, pe)))
{
Expand Down