-
-
Notifications
You must be signed in to change notification settings - Fork 97
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 the bug: if LITTLEFS_SDMMC_SUPPORT turns on, some features are pr… #172
Conversation
…oblematic when using flash.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@huming2207 can you take a look at this? There appears to be 3 real changes among the formatting/linting changes.
@@ -253,13 +253,12 @@ esp_err_t format_from_efs(esp_littlefs_t *efs) | |||
if (efs->sdcard) { | |||
res = lfs_format(efs->fs, &efs->cfg); | |||
} else | |||
#else | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
real change
@@ -1072,11 +1071,10 @@ static esp_err_t esp_littlefs_init(const esp_vfs_littlefs_conf_t* conf) | |||
if (conf->sdcard) { | |||
err = esp_littlefs_format_sdmmc(conf->sdcard); | |||
} else | |||
#else | |||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
real change
#ifndef CONFIG_LITTLEFS_SDMMC_SUPPORT | ||
res = lfs_fs_grow(efs->fs, efs->partition->size / efs->cfg.block_size); | ||
#else | ||
#ifdef CONFIG_LITTLEFS_SDMMC_SUPPORT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
real change
@@ -1093,15 +1091,14 @@ static esp_err_t esp_littlefs_init(const esp_vfs_littlefs_conf_t* conf) | |||
efs->cache = esp_littlefs_calloc(sizeof(*efs->cache), efs->cache_size); | |||
|
|||
if(conf->grow_on_mount){ | |||
#ifndef CONFIG_LITTLEFS_SDMMC_SUPPORT | |||
res = lfs_fs_grow(efs->fs, efs->partition->size / efs->cfg.block_size); | |||
#else |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need as well
if (efs->sdcard) { | ||
res = lfs_fs_grow(efs->fs, efs->sdcard->csd.capacity); | ||
} else { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need as well
res = lfs_fs_grow(efs->fs, efs->partition->size / efs->cfg.block_size); | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need as well
{ | ||
efs->cfg.block_count = efs->partition->size / efs->cfg.block_size; | ||
res = lfs_format(efs->fs, &efs->cfg); | ||
efs->cfg.block_count = 0; | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need as well
{ | ||
err = esp_littlefs_format_partition(efs->partition); | ||
} | ||
#endif |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
need as well
yes, some "endif" modifications are also required, others are formatting/linting changes. |
the code changes look good to me, I'll merge in a day or two (unless huming2207 provides back sooner). |
I've reviewed the code - frankly speaking I don't know what is this for. Instead, this PR will definitely break SD card support. I really don't think the |
Oh I'm really sorry, I misread the code on iPad 😅😅 I think it's fine. I will test it with our real devices and see if that actually cause any issues on Monday. On the other hand so far I didn't hear any report about breaking on |
Hi @BrianPugh we've tested it and we believe it's all good to go. |
…oblematic when using flash.
some macro for CONFIG_LITTLEFS_SDMMC_SUPPORT will drop the work for flash