Skip to content

Commit 7278acc

Browse files
committed
AT32F435: Cache HFE and QD image data. There is plenty of RAM.
1 parent edb2686 commit 7278acc

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/image/hfe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,8 @@ static bool_t hfe_open(struct image *im)
109109
ASSERT(8*512 <= im->bufs.read_data.len);
110110
volume_cache_init(im->bufs.read_data.p + 8*512,
111111
im->bufs.read_data.p + im->bufs.read_data.len);
112-
volume_cache_metadata_only(&im->fp);
112+
if (im->bufs.read_data.len < (64*1024))
113+
volume_cache_metadata_only(&im->fp);
113114

114115
/* Get an initial value for ticks per revolution. */
115116
hfe_seek_track(im, 0);

src/image/qd.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ static bool_t qd_open(struct image *im)
4040
ASSERT(8*512 <= im->bufs.read_data.len);
4141
volume_cache_init(im->bufs.read_data.p + 8*512,
4242
im->bufs.read_data.p + im->bufs.read_data.len);
43-
volume_cache_metadata_only(&im->fp);
43+
if (im->bufs.read_data.len < (64*1024))
44+
volume_cache_metadata_only(&im->fp);
4445

4546
/* There is only one track: Seek to it. */
4647
qd_seek_track(im, 0);

0 commit comments

Comments
 (0)