From 32a8a3994384dd7df52f5f88a910e221995e179b Mon Sep 17 00:00:00 2001 From: David Lin Date: Sun, 16 Feb 2020 11:08:32 +0800 Subject: [PATCH] Minor optimisation to the step f_sync and f_close Moved the code 'f_sync(&file);' ahead of 'f_close(&file);'. --- examples/fatfs/fatfs_sample.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/fatfs/fatfs_sample.c b/examples/fatfs/fatfs_sample.c index 40092aee..e9c71b55 100644 --- a/examples/fatfs/fatfs_sample.c +++ b/examples/fatfs/fatfs_sample.c @@ -50,8 +50,9 @@ void application_entry(void *arg) } else { printf("read error: %d\n", res); } - f_close(&file); - + f_sync(&file); + + f_close(&file); }