From 23067a14223a1d142db28edae9dead79626e056b Mon Sep 17 00:00:00 2001 From: Robert HH Date: Thu, 16 Jun 2016 18:17:59 +0200 Subject: esp8266: Use RTC to set date & time stamps for files. The time stamp is taken from the RTC for all newly generated or changed files. RTC must be maintained separately. The dummy time stamp of Jan 1, 2000 is set in vfs.stat() for the root directory, avoiding invalid time values. --- extmod/vfs_fat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'extmod') diff --git a/extmod/vfs_fat.c b/extmod/vfs_fat.c index a4a81370f..df5cbb0d6 100644 --- a/extmod/vfs_fat.c +++ b/extmod/vfs_fat.c @@ -186,7 +186,7 @@ STATIC mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) { if (path_equal(path, "/")) { // stat root directory fno.fsize = 0; - fno.fdate = 0; + fno.fdate = 0x2821; // Jan 1, 2000 fno.ftime = 0; fno.fattrib = AM_DIR; } else { @@ -196,7 +196,7 @@ STATIC mp_obj_t fat_vfs_stat(mp_obj_t vfs_in, mp_obj_t path_in) { if (vfs != NULL && path_equal(path, vfs->str)) { // stat mounted device directory fno.fsize = 0; - fno.fdate = 0; + fno.fdate = 0x2821; // Jan 1, 2000 fno.ftime = 0; fno.fattrib = AM_DIR; res = FR_OK; -- cgit v1.2.3