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

Function char_dev_read

components/fal/src/fal_rtt.c:352–368  ·  view source on GitHub ↗

RT-Thread device interface */

Source from the content-addressed store, hash-verified

350
351/* RT-Thread device interface */
352static rt_ssize_t char_dev_read(rt_device_t dev, rt_off_t pos, void *buffer, rt_size_t size)
353{
354 int ret = 0;
355 struct fal_char_device *part = (struct fal_char_device *) dev;
356
357 RT_ASSERT(part != RT_NULL);
358
359 if (pos + size > part->fal_part->len)
360 size = part->fal_part->len - pos;
361
362 ret = fal_partition_read(part->fal_part, pos, buffer, size);
363
364 if (ret != (int)(size))
365 ret = 0;
366
367 return ret;
368}
369
370static rt_ssize_t char_dev_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size)
371{

Callers

nothing calls this directly

Calls 1

fal_partition_readFunction · 0.85

Tested by

no test coverage detected