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

Function mtd_nor_dev_write

components/fal/src/fal_rtt.c:242–262  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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{
244 int ret = 0;
245 struct fal_mtd_nor_device *part;
246
247 part = (struct fal_mtd_nor_device*) device;
248 RT_ASSERT(part != RT_NULL);
249
250 ret = fal_partition_write(part->fal_part, offset, data, length);
251
252 if (ret != (int) length)
253 {
254 ret = 0;
255 }
256 else
257 {
258 ret = length;
259 }
260
261 return ret;
262}
263
264static rt_err_t mtd_nor_dev_erase(struct rt_mtd_nor_device* device, rt_off_t offset, rt_size_t length)
265{

Callers

nothing calls this directly

Calls 1

fal_partition_writeFunction · 0.85

Tested by

no test coverage detected