Commit graph

16 commits

Author SHA1 Message Date
Ivan Grokhotkov 4839da4d98 Merge branch 'bugfix/fatfs_stat' into 'master'
Fix stat behavior for FATFS mount point

See merge request !1652
2017-12-13 11:10:27 +08:00
Ivan Grokhotkov dfee6e825a vfs/fatfs: use structures with bit fields for FAT date/time
Replace explicit masks and shifts with bit fields when working with FATFS date and time representations. Also zero-initialize remaining members of struct tm.

Fixes https://github.com/espressif/esp-idf/issues/1369.
2017-12-11 11:11:48 +08:00
Ivan Grokhotkov a63ace15bd vfs/fatfs: fix stat call failing when called for mount point
FATFS does not support f_stat call for drive root. When handling stat
for drive root, don't call f_stat and just return struct st with S_IFDIR
flag set.

Closes #984
2017-12-08 20:04:27 +08:00
luc lebosse 58f046715e Unify the time file creation for SPIFFS and SD 2017-11-21 22:51:36 +08:00
Ivan Grokhotkov 8e180f6155 fatfs: update to R0.13a
- Remove ASCII-only configuration, CP437 is used instead
- Add dynamic code page configuration

See components/fatfs/src/00history.txt for FATFS changelog.
2017-11-14 12:57:55 +08:00
Ivan Grokhotkov 502c3d0243 vfs,fat: add fsync to VFS interface, implement it for fatfs 2017-10-17 15:14:53 +08:00
Deomid Ryabkov b8782bdd90 Change esp_vfs_t.write return value to ssize_t
write() should return ssize_t, not size_t.
2017-06-09 21:24:00 +01:00
Ivan Grokhotkov d18157e108 vfs_fat: allocate FIL structures on the heap in vfs_fat_link
vfs_fat_link opened two files to perform copy operation. File structures
were allocated on the stack. When _MAX_SS setting was increased in
ffconf.h due to wear levelling feature, the size of these structures
increased to ~4k each (~8k total). This exceeds stack size allocated for
tasks in most typical cases.

This change makes file structures dynamically allocated.
2017-05-05 15:21:37 +08:00
Ivan Grokhotkov 1a73b41b10 vfs_fat: fix prepend_drive_to_path
Originally, prepend_drive_to_path was designed to be a macro, and it
modified local path variables to point to a temporary buffers.
When it was converted into a function, modification to path variables
were no longer visible outside of this function.

In addition to that, prepend_drive_to_path allocated 2k bytes on the
stack for temporary path buffers. This is replaced with path buffers
allocated as part of vfs_fat context object. Locking is added around
parts of code which use these temporary buffers.

Additionally, _lock member of vfs_fat_ctx_t was placed after the
variable-sized files array, which caused the first entry in the
array to be never used. This change fixes the order of members
and adds comments.
2017-05-05 15:21:37 +08:00
Ivan Grokhotkov 4ecd26ce77 Merge branch 'feature/fatfs_dynamic_pdrv' into 'master'
FATFS enable support for multiple drives

Current implementation has drive numbers and paths hardcoded to support
only one FATFS drive. Arduino has it's own SPI driver to allow
compatibility and flexibility. With the MR it is possible to have up to
```_VOLUMES``` drives connected (SPI, SDMMC and others) at the same
time and accessed through VFS

See merge request !478
2017-03-03 11:40:37 +08:00
nineisk 57af0d70d3 Fix fopen() in “a” (append) mode
fopen() does not work when file is opened in “a” (append) mode
2017-02-14 16:15:08 +11:00
me-no-dev 0eeda99a8c pick better name for unregister function and update docs 2017-02-02 12:24:38 +02:00
me-no-dev 972c6f0cae implement review recomendations 2017-02-01 17:55:25 +02:00
me-no-dev a57b6326e3 Fix ``if`` breaking the path 2017-01-31 17:43:22 +02:00
me-no-dev 84590ec0a4 FATFS enable support for multiple drives
Current implementation has drive numbers and paths hardcoded to support
only one FATFS drive. Arduino has it's own SPI driver to allow
compatibility and flexibility. With the MR it is possible to have up to
```_VOLUMES``` drives connected (SPI, SDMMC and others) at the same
time and accessed through VFS
2017-01-31 17:23:25 +02:00
Ivan Grokhotkov 44ce833d76 fatfs: add vfs support 2017-01-09 05:54:04 +08:00