mirror of
https://github.com/micropython/micropython.git
synced 2026-01-06 12:10:13 +01:00
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.
This commit is contained in:
committed by
Paul Sokolovsky
parent
d0416ff915
commit
23067a1422
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user