| 90 | } // namespace |
| 91 | |
| 92 | s32_t FileSystem::f_read(struct spiffs_t* spiffs, u32_t addr, u32_t size, u8_t* dst) |
| 93 | { |
| 94 | auto fs = static_cast<FileSystem*>(spiffs->user_data); |
| 95 | assert(fs != nullptr); |
| 96 | if(!fs->partition.read(addr, dst, size)) { |
| 97 | return SPIFFS_ERR_INTERNAL; |
| 98 | } |
| 99 | if(fs->profiler != nullptr) { |
| 100 | fs->profiler->write(addr, dst, size); |
| 101 | } |
| 102 | return SPIFFS_OK; |
| 103 | } |
| 104 | |
| 105 | s32_t FileSystem::f_write(struct spiffs_t* spiffs, u32_t addr, u32_t size, u8_t* src) |
| 106 | { |