# define TEST_FALSH_LEN 1000
uint8_t w_tbuf[TEST_FALSH_LEN];
uint8_t t1_tbuf[TEST_FALSH_LEN];
uint8_t t2_tbuf[TEST_FALSH_LEN];
lfs_file_t fd = {0};
int ret = 0;
int i = 0;
for(i= 0;i<TEST_FALSH_LEN;i++)
{
w_tbuf[i] = i&0xf;
}
ret = lfs_file_open(&lfs,&fd,"3.txt",LFS_O_CREAT|LFS_O_RDWR);
ret = lfs_file_write(&lfs,&fd,w_tbuf,sizeof(w_tbuf));
ret = lfs_file_close(&lfs,&fd);
for(i= 0;i<TEST_FALSH_LEN;i++)
{
w_tbuf[i] = (i+1)&0xf;
}
ret = lfs_file_open(&lfs,&fd,"3.bin",LFS_O_CREAT|LFS_O_RDWR);
ret = lfs_file_write(&lfs,&fd,w_tbuf,sizeof(w_tbuf));
ret = lfs_file_close(&lfs,&fd);
ret = lfs_file_open(&lfs,&fd,"3.txt",LFS_O_RDONLY);
ret = lfs_file_read(&lfs,&fd,t1_tbuf,sizeof(t1_tbuf));
ret = lfs_file_close(&lfs,&fd);
ret = lfs_file_open(&lfs,&fd,"3.bin",LFS_O_RDONLY);
ret = lfs_file_read(&lfs,&fd,t2_tbuf,sizeof(t2_tbuf));
ret = lfs_file_close(&lfs,&fd);