Lines Matching refs:cache
95 file_p->cache = lv_mem_alloc(sizeof(lv_fs_file_cache_t)); in lv_fs_open()
96 LV_ASSERT_MALLOC(file_p->cache); in lv_fs_open()
97 lv_memset_00(file_p->cache, sizeof(lv_fs_file_cache_t)); in lv_fs_open()
98 file_p->cache->start = UINT32_MAX; /*Set an invalid range by default*/ in lv_fs_open()
99 file_p->cache->end = UINT32_MAX - 1; in lv_fs_open()
117 if(file_p->drv->cache_size && file_p->cache) { in lv_fs_close()
118 if(file_p->cache->buffer) { in lv_fs_close()
119 lv_mem_free(file_p->cache->buffer); in lv_fs_close()
122 lv_mem_free(file_p->cache); in lv_fs_close()
127 file_p->cache = NULL; in lv_fs_close()
135 uint32_t file_position = file_p->cache->file_position; in lv_fs_read_cached()
136 uint32_t start = file_p->cache->start; in lv_fs_read_cached()
137 uint32_t end = file_p->cache->end; in lv_fs_read_cached()
138 char * buffer = file_p->cache->buffer; in lv_fs_read_cached()
164 file_p->cache->start = file_p->cache->end; in lv_fs_read_cached()
165 file_p->cache->end = file_p->cache->start + bytes_read_to_buffer; in lv_fs_read_cached()
182 file_p->cache->buffer = lv_mem_alloc(buffer_size); in lv_fs_read_cached()
183 LV_ASSERT_MALLOC(file_p->cache->buffer); in lv_fs_read_cached()
184 buffer = file_p->cache->buffer; in lv_fs_read_cached()
189 file_p->cache->start = file_position; in lv_fs_read_cached()
190 file_p->cache->end = file_p->cache->start + bytes_read_to_buffer; in lv_fs_read_cached()
199 file_p->cache->file_position += *br; in lv_fs_read_cached()
259 file_p->cache->file_position = pos; in lv_fs_seek()
262 …if(file_p->cache->file_position < file_p->cache->start || file_p->cache->file_position > file_p->c… in lv_fs_seek()
263 …res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, file_p->cache->file_position, LV_FS_SEEK_S… in lv_fs_seek()
269 file_p->cache->file_position += pos; in lv_fs_seek()
272 …if(file_p->cache->file_position < file_p->cache->start || file_p->cache->file_position > file_p->c… in lv_fs_seek()
273 …res = file_p->drv->seek_cb(file_p->drv, file_p->file_d, file_p->cache->file_position, LV_FS_SEEK_S… in lv_fs_seek()
286 file_p->cache->file_position = tmp_position; in lv_fs_seek()
314 *pos = file_p->cache->file_position; in lv_fs_tell()