From 1bd4b6ce83922953943c14d833259925ae404642 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Felix=20Ye=28=E5=8F=B6=E5=89=91=29?= Date: Mon, 13 Sep 2021 10:54:34 +0800 Subject: [PATCH] =?UTF-8?q?=E8=A7=A3=E5=86=B3yaffs=E6=96=87=E4=BB=B6?= =?UTF-8?q?=E6=93=8D=E4=BD=9Cflag=E4=B8=8E=E5=85=B6=E5=AE=83=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ports/quectel/core/source/machine_nandflash.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/ports/quectel/core/source/machine_nandflash.c b/ports/quectel/core/source/machine_nandflash.c index c54a359..2c282aa 100644 --- a/ports/quectel/core/source/machine_nandflash.c +++ b/ports/quectel/core/source/machine_nandflash.c @@ -38,8 +38,7 @@ #include "modmachine.h" #include "helios_flash.h" -#include "yaffsfs.h" -#include "vfs.h" +#include "fs_vfs.h" #include "helios_debug.h" #define NANDFLASH_LOG(msg, ...) custom_log("nand", msg, ##__VA_ARGS__) @@ -83,12 +82,12 @@ STATIC mp_obj_t machine_nandflash_make_new(const mp_obj_type_t *type, size_t n_a -#define FILE_OPEN_FLAGS_R (O_RDONLY) -#define FILE_OPEN_FLAGS_W (O_WRONLY | O_CREAT | O_TRUNC) -#define FILE_OPEN_FLAGS_A (O_WRONLY | O_CREAT | O_APPEND) -#define FILE_OPEN_FLAGS_RPluse (O_RDWR) -#define FILE_OPEN_FLAGS_WPluse (O_RDWR | O_CREAT | O_TRUNC) -#define FILE_OPEN_FLAGS_APluse (O_RDWR | O_CREAT | O_APPEND) +#define FILE_OPEN_FLAGS_R (YAFFS_RDONLY) +#define FILE_OPEN_FLAGS_W (YAFFS_WRONLY | YAFFS_CREAT | YAFFS_TRUNC) +#define FILE_OPEN_FLAGS_A (YAFFS_WRONLY | YAFFS_CREAT | YAFFS_APPEND) +#define FILE_OPEN_FLAGS_RPluse (YAFFS_RDWR) +#define FILE_OPEN_FLAGS_WPluse (YAFFS_RDWR | YAFFS_CREAT | YAFFS_TRUNC) +#define FILE_OPEN_FLAGS_APluse (YAFFS_RDWR | YAFFS_CREAT | YAFFS_APPEND) static int Helios_file_open_mode2flags(const char * mode) { @@ -454,7 +453,7 @@ static int Helios_vfs_ListDir(const char *dir_ptr, char* fileinfo_ptr) { char* file_dir_list = fileinfo_ptr; - int fd = vfs_open(dir_ptr ,O_RDONLY, 0); + int fd = vfs_open(dir_ptr ,YAFFS_RDONLY, 0); if(fd < 0) { NANDFLASH_LOG("open of dir failed\n"); -- Gitee