Skip to content
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

why t1_buf is sample of t2_buf at sometime? #961

Open
c377870675 opened this issue Apr 4, 2024 · 0 comments
Open

why t1_buf is sample of t2_buf at sometime? #961

c377870675 opened this issue Apr 4, 2024 · 0 comments
Labels
needs investigation no idea what is wrong

Comments

@c377870675
Copy link

c377870675 commented Apr 4, 2024

# 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);
@geky geky added the needs investigation no idea what is wrong label Apr 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs investigation no idea what is wrong
Projects
None yet
Development

No branches or pull requests

2 participants