MCPcopy Create free account
hub / github.com/RT-Thread/rt-thread / char_dev_fread

Function char_dev_fread

components/fal/src/fal_rtt.c:438–456  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

436}
437
438static int char_dev_fread(struct dfs_file *fd, void *buf, rt_size_t count)
439{
440 int ret = 0;
441 struct fal_char_device *part = (struct fal_char_device *) fd->vnode->data;
442
443 RT_ASSERT(part != RT_NULL);
444
445 if (DFS_FILE_POS(fd) + count > part->fal_part->len)
446 count = part->fal_part->len - DFS_FILE_POS(fd);
447
448 ret = fal_partition_read(part->fal_part, DFS_FILE_POS(fd), buf, count);
449
450 if (ret != (int)(count))
451 return 0;
452
453 DFS_FILE_POS(fd) += ret;
454
455 return ret;
456}
457
458static int char_dev_fwrite(struct dfs_file *fd, const void *buf, rt_size_t count)
459{

Callers

nothing calls this directly

Calls 1

fal_partition_readFunction · 0.85

Tested by

no test coverage detected