RT-Thread device interface */
| 350 | |
| 351 | /* RT-Thread device interface */ |
| 352 | static 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 | |
| 370 | static rt_ssize_t char_dev_write(rt_device_t dev, rt_off_t pos, const void *buffer, rt_size_t size) |
| 371 | { |
nothing calls this directly
no test coverage detected