summaryrefslogtreecommitdiffstats
path: root/firmware/common
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common')
-rw-r--r--firmware/common/file.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/firmware/common/file.c b/firmware/common/file.c
index a5d9443aeb..9d18c613bf 100644
--- a/firmware/common/file.c
+++ b/firmware/common/file.c
@@ -24,6 +24,15 @@
#include "dir.h"
#include "debug.h"
+/*
+ These functions provide a roughly POSIX-compatible file IO API.
+
+ Since the fat32 driver only manages sectors, we maintain a one-sector
+ cache for each open file. This way we can provide byte access without
+ having to re-read the sector each time.
+ The penalty is the RAM used for the cache and slightly more complex code.
+*/
+
#define MAX_OPEN_FILES 4
struct filedesc {