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

Function blk_dev_read

components/fal/src/fal_rtt.c:84–103  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

82}
83
84static rt_ssize_t blk_dev_read(rt_device_t dev, rt_off_t pos, void* buffer, rt_size_t size)
85{
86 int ret = 0;
87 struct fal_blk_device *part = (struct fal_blk_device*) dev;
88
89 RT_ASSERT(part != RT_NULL);
90
91 ret = fal_partition_read(part->fal_part, pos * part->geometry.block_size, buffer, size * part->geometry.block_size);
92
93 if (ret != (int)(size * part->geometry.block_size))
94 {
95 ret = 0;
96 }
97 else
98 {
99 ret = size;
100 }
101
102 return ret;
103}
104
105static rt_ssize_t blk_dev_write(rt_device_t dev, rt_off_t pos, const void* buffer, rt_size_t size)
106{

Callers

nothing calls this directly

Calls 1

fal_partition_readFunction · 0.85

Tested by

no test coverage detected