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

Function char_dev_fwrite

components/fal/src/fal_rtt.c:458–476  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

456}
457
458static int char_dev_fwrite(struct dfs_file *fd, const void *buf, rt_size_t count)
459{
460 int ret = 0;
461 struct fal_char_device *part = (struct fal_char_device *) fd->vnode->data;
462
463 RT_ASSERT(part != RT_NULL);
464
465 if (DFS_FILE_POS(fd) + count > part->fal_part->len)
466 count = part->fal_part->len - DFS_FILE_POS(fd);
467
468 ret = fal_partition_write(part->fal_part, DFS_FILE_POS(fd), buf, count);
469
470 if (ret != (int) count)
471 return 0;
472
473 DFS_FILE_POS(fd) += ret;
474
475 return ret;
476}
477
478static const struct dfs_file_ops char_dev_fops =
479{

Callers

nothing calls this directly

Calls 1

fal_partition_writeFunction · 0.85

Tested by

no test coverage detected