-
Notifications
You must be signed in to change notification settings - Fork 774
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
没有做嵌入式用的文件系统适配吗 #180
Comments
这个需要自己包装一下。 |
这是我移植fatfs的代码,没成功,希望移植成功的帮我看一下,非常感谢! `#include "tkc/fs.h" #ifdef WITH_FS_RES ret_t fs_os_file_close(fs_file_t* file) { return RET_OK; ret_t fs_os_dir_rewind(fs_dir_t* dir) { f_rewinddir(d); return RET_OK; ret_t fs_os_dir_read(fs_dir_t* dir, fs_item_t* item) { memset(item, 0x00, sizeof(fs_item_t)); do {
} ret_t fs_os_dir_close(fs_dir_t* dir) { return RET_OK; static fs_file_t* fs_file_create(FIL* fp) { f = TKMEM_ZALLOC(fs_file_t); return f; fs_file_t* fs_os_open_file(fs_t* fs, const char* name, const char* mode) { if (strchr(mode, 'r')) { if (strchr(mode, 'w')) { } ret_t fs_os_remove_file(fs_t* fs, const char* name) {
f_unlink(fname); return RET_OK; bool_t fs_os_file_exist(fs_t* fs, const char* name) {
} bool_t fs_os_file_rename(fs_t* fs, const char* name, const char* new_name) { fs_dir_t* fs_dir_create(DIR* dir) { d = TKMEM_ZALLOC(fs_dir_t); return d; fs_dir_t* fs_os_open_dir(fs_t* fs, const char* name) { ret_t fs_os_remove_dir(fs_t* fs, const char* name) { bool_t fs_os_dir_exist(fs_t* fs, const char* name) { return TRUE; bool_t fs_os_dir_rename(fs_t* fs, const char* name, const char* new_name) { if(res == FR_OK) int32_t fs_os_get_file_size(fs_t* fs, const char* name) { return fno->fsize; ret_t fs_os_get_disk_info(fs_t* fs, const char* volume, int32_t* free_kb, int32_t* total_kb) { (void)fs; return RET_OK; ret_t fs_os_get_exe(fs_t* fs, char path[MAX_PATH + 1]) { #if defined(LINUX) return RET_OK; static ret_t fs_os_get_cwd(fs_t* fs, char path[MAX_PATH + 1]) { (void)fs; static const fs_t s_os_fs = {.open_file = fs_os_open_file,
fs_t* os_fs(void) { ` |
你可以创建一个awtk-fatfs的仓库,其他人也可能需要,大家一起来完善。 |
我打开raw文件夹里,fs_os.c这个文件里面几乎是空的,在zlgopen这个github上也没找到有关嵌入式文件系统的相关适配,李老师可以做一个吗,比如适配fatfs啥的
The text was updated successfully, but these errors were encountered: