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

Function mtd_nor_dev_read

components/fal/src/fal_rtt.c:221–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

219};
220
221static rt_ssize_t mtd_nor_dev_read(struct rt_mtd_nor_device* device, rt_off_t offset, rt_uint8_t* data, rt_size_t length)
222{
223 int ret = 0;
224 struct fal_mtd_nor_device *part = (struct fal_mtd_nor_device*) device;
225
226 RT_ASSERT(part != RT_NULL);
227
228 ret = fal_partition_read(part->fal_part, offset, data, length);
229
230 if (ret != (int)length)
231 {
232 ret = 0;
233 }
234 else
235 {
236 ret = length;
237 }
238
239 return ret;
240}
241
242static rt_ssize_t mtd_nor_dev_write(struct rt_mtd_nor_device* device, rt_off_t offset, const rt_uint8_t* data, rt_size_t length)
243{

Callers

nothing calls this directly

Calls 1

fal_partition_readFunction · 0.85

Tested by

no test coverage detected