sync
This commit is contained in:
@@ -79,16 +79,19 @@ int fs_pm_flash_resume(void)
|
||||
|
||||
int fs_pm_open(struct fs_file_t *file, const char *path, fs_mode_t mode)
|
||||
{
|
||||
LOG_DBG("PM Opening file '%s' with mode 0x%02x", path, mode);
|
||||
fs_pm_flash_resume();
|
||||
int rc = fs_open(file, path, mode);
|
||||
if (rc == 0)
|
||||
if (rc < 0)
|
||||
{
|
||||
fs_pm_flash_resume();
|
||||
fs_pm_flash_suspend();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int fs_pm_close(struct fs_file_t *file)
|
||||
{
|
||||
LOG_DBG("PM Closing file");
|
||||
int rc = fs_close(file);
|
||||
if (rc == 0)
|
||||
{
|
||||
@@ -99,20 +102,44 @@ int fs_pm_close(struct fs_file_t *file)
|
||||
|
||||
int fs_pm_opendir(struct fs_dir_t *dirp, const char *path)
|
||||
{
|
||||
LOG_DBG("PM Opening directory '%s'", path);
|
||||
fs_pm_flash_resume();
|
||||
int rc = fs_opendir(dirp, path);
|
||||
if (rc == 0)
|
||||
if (rc < 0)
|
||||
{
|
||||
fs_pm_flash_resume();
|
||||
fs_pm_flash_suspend();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int fs_pm_closedir(struct fs_dir_t *dirp)
|
||||
{
|
||||
LOG_DBG("PM Closing directory");
|
||||
int rc = fs_closedir(dirp);
|
||||
if (rc == 0)
|
||||
{
|
||||
fs_pm_flash_suspend();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int fs_pm_unlink(const char *path)
|
||||
{
|
||||
LOG_DBG("PM Unlinking file '%s'", path);
|
||||
fs_pm_flash_resume();
|
||||
int rc = fs_unlink(path);
|
||||
if (rc < 0)
|
||||
{
|
||||
fs_pm_flash_suspend();
|
||||
}
|
||||
return rc;
|
||||
}
|
||||
|
||||
int fs_pm_statvfs(const char *path, struct fs_statvfs *stat)
|
||||
{
|
||||
LOG_DBG("PM Getting filesystem stats for '%s'", path);
|
||||
fs_pm_flash_resume();
|
||||
int rc = fs_statvfs(path, stat);
|
||||
fs_pm_flash_suspend();
|
||||
return rc;
|
||||
}
|
||||
Reference in New Issue
Block a user