Home
last modified time | relevance | path

Searched refs:buffer (Results 1 – 25 of 29) sorted by relevance

12

/littlefs-3.7.0-3.6.0/tests/
Dtest_attrs.toml14 uint8_t buffer[1024];
15 memset(buffer, 0, sizeof(buffer));
19 lfs_getattr(&lfs, "hello", 'A', buffer, 4) => 4;
20 lfs_getattr(&lfs, "hello", 'B', buffer+4, 6) => 6;
21 lfs_getattr(&lfs, "hello", 'C', buffer+10, 5) => 5;
22 memcmp(buffer, "aaaa", 4) => 0;
23 memcmp(buffer+4, "bbbbbb", 6) => 0;
24 memcmp(buffer+10, "ccccc", 5) => 0;
27 lfs_getattr(&lfs, "hello", 'A', buffer, 4) => 4;
28 lfs_getattr(&lfs, "hello", 'B', buffer+4, 6) => 0;
[all …]
Dtest_seek.toml20 uint8_t buffer[1024];
21 memcpy(buffer, "kittycatcat", size);
23 lfs_file_write(&lfs, &file, buffer, size);
34 lfs_file_read(&lfs, &file, buffer, size) => size;
35 memcmp(buffer, "kittycatcat", size) => 0;
41 lfs_file_read(&lfs, &file, buffer, size) => size;
42 memcmp(buffer, "kittycatcat", size) => 0;
45 lfs_file_read(&lfs, &file, buffer, size) => size;
46 memcmp(buffer, "kittycatcat", size) => 0;
49 lfs_file_read(&lfs, &file, buffer, size) => size;
[all …]
Dtest_badblocks.toml27 uint8_t buffer[1024];
29 buffer[j] = '0'+i;
31 buffer[NAMEMULT] = '\0';
32 lfs_mkdir(&lfs, (char*)buffer) => 0;
34 buffer[NAMEMULT] = '/';
36 buffer[j+NAMEMULT+1] = '0'+i;
38 buffer[2*NAMEMULT+1] = '\0';
40 lfs_file_open(&lfs, &file, (char*)buffer,
45 lfs_file_write(&lfs, &file, buffer, size) => size;
54 uint8_t buffer[1024];
[all …]
Dtest_truncate.toml14 uint8_t buffer[1024];
15 strcpy((char*)buffer, "hair");
16 size_t size = strlen((char*)buffer);
18 lfs_file_write(&lfs, &file, buffer, lfs_min(size, LARGESIZE-j))
42 lfs_file_read(&lfs, &file, buffer, lfs_min(size, MEDIUMSIZE-j))
44 memcmp(buffer, "hair", lfs_min(size, MEDIUMSIZE-j)) => 0;
46 lfs_file_read(&lfs, &file, buffer, size) => 0;
65 uint8_t buffer[1024];
66 strcpy((char*)buffer, "hair");
67 size_t size = strlen((char*)buffer);
[all …]
Dtest_bd.toml11 uint8_t buffer[lfs_max(READ, PROG)];
17 buffer[j] = (i+j) % 251;
19 cfg->prog(cfg, 0, i, buffer, PROG) => 0;
24 cfg->read(cfg, 0, i, buffer, READ) => 0;
27 LFS_ASSERT(buffer[j] == (i+j) % 251);
36 uint8_t buffer[lfs_max(READ, PROG)];
44 buffer[j] = (block+i+j) % 251;
46 cfg->prog(cfg, block, i, buffer, PROG) => 0;
52 cfg->read(cfg, block, i, buffer, READ) => 0;
55 LFS_ASSERT(buffer[j] == (block+i+j) % 251);
[all …]
Dtest_alloc.toml49 uint8_t buffer[1024];
50 lfs_file_read(&lfs, &file, buffer, size) => size;
51 assert(memcmp(buffer, names[n], size) == 0);
80 uint8_t buffer[1024];
81 memcpy(buffer, names[n], size);
86 lfs_file_write(&lfs, &file, buffer, size) => size;
100 uint8_t buffer[1024];
101 lfs_file_read(&lfs, &file, buffer, size) => size;
102 assert(memcmp(buffer, names[n], size) == 0);
152 uint8_t buffer[1024];
[all …]
Dtest_files.toml11 uint8_t buffer[1024];
12 strcpy((char*)buffer, "Hello World!");
13 lfs_file_write(&lfs, &file, buffer, size) => size;
19 lfs_file_read(&lfs, &file, buffer, size) => size;
20 assert(strcmp((char*)buffer, "Hello World!") == 0);
38 uint8_t buffer[1024];
42 buffer[b] = TEST_PRNG(&prng) & 0xff;
44 lfs_file_write(&lfs, &file, buffer, chunk) => chunk;
56 lfs_file_read(&lfs, &file, buffer, chunk) => chunk;
58 assert(buffer[b] == (TEST_PRNG(&prng) & 0xff));
[all …]
Dtest_move.toml51 uint8_t buffer[1024];
52 lfs_file_read(&lfs, &file, buffer, 5) => 5;
53 memcmp(buffer, "hola\n", 5) => 0;
54 lfs_file_read(&lfs, &file, buffer, 8) => 8;
55 memcmp(buffer, "bonjour\n", 8) => 0;
56 lfs_file_read(&lfs, &file, buffer, 6) => 6;
57 memcmp(buffer, "ohayo\n", 6) => 0;
111 uint8_t buffer[BLOCK_SIZE];
112 cfg->read(cfg, block, 0, buffer, BLOCK_SIZE) => 0;
114 while (off >= 0 && buffer[off] == ERASE_VALUE) {
[all …]
Dtest_powerloss.toml16 char buffer[256];
17 strcpy(buffer, "hello");
20 lfs_file_write(&lfs, &file, buffer, size) => size;
29 assert(memcmp(rbuffer, buffer, size) == 0);
58 assert(memcmp(rbuffer, buffer, size) == 0);
65 strcpy(buffer, "goodbye");
68 lfs_file_write(&lfs, &file, buffer, size) => size;
74 strcpy(buffer, "hello");
78 assert(memcmp(rbuffer, buffer, size) == 0);
80 strcpy(buffer, "goodbye");
[all …]
Dtest_interspersed.toml56 uint8_t buffer[1024];
57 lfs_file_read(&lfs, &files[j], buffer, 1) => 1;
58 assert(buffer[0] == alphas[j]);
121 uint8_t buffer[1024];
122 lfs_file_read(&lfs, &file, buffer, 1) => 1;
123 assert(buffer[0] == '~');
182 uint8_t buffer[1024];
183 lfs_file_read(&lfs, &files[0], buffer, 1) => 1;
184 assert(buffer[0] == 'e');
185 lfs_file_read(&lfs, &files[1], buffer, 1) => 1;
[all …]
Dtest_evil.toml47 uint8_t buffer[1024];
50 LFS_MKTAG(LFS_TYPE_NAME, 1, strlen("dir_here")), buffer)
52 assert(memcmp((char*)buffer, "dir_here", strlen("dir_here")) == 0);
101 uint8_t buffer[1024];
104 LFS_MKTAG(LFS_TYPE_NAME, 1, strlen("file_here")), buffer)
106 assert(memcmp((char*)buffer, "file_here", strlen("file_here")) == 0);
123 lfs_file_read(&lfs, &file, buffer, SIZE) => LFS_ERR_CORRUPT;
156 uint8_t buffer[4*BLOCK_SIZE];
159 LFS_MKTAG(LFS_TYPE_NAME, 1, strlen("file_here")), buffer)
161 assert(memcmp((char*)buffer, "file_here", strlen("file_here")) == 0);
[all …]
Dtest_superblocks.toml258 uint8_t buffer[256];
259 lfs_file_read(&lfs, &file, buffer, sizeof(buffer)) => 6;
261 assert(memcmp(buffer, "hello!", 6) == 0);
313 uint8_t buffer[256];
314 lfs_file_read(&lfs, &file, buffer, sizeof(buffer)) => 6;
316 assert(memcmp(buffer, "hello!", 6) == 0);
461 uint8_t buffer[256];
462 lfs_file_read(&lfs, &file, buffer, sizeof(buffer)) => 6;
464 assert(memcmp(buffer, "hello!", 6) == 0);
Dtest_relocations.toml13 uint8_t buffer[512];
14 memset(buffer, 0, 512);
16 lfs_file_write(&lfs, &file, buffer, 512) => 512;
91 uint8_t buffer[512];
92 memset(buffer, 0, 512);
94 lfs_file_write(&lfs, &file, buffer, 512) => 512;
Dtest_orphans.toml23 uint8_t buffer[BLOCK_SIZE];
24 cfg->read(cfg, block, 0, buffer, BLOCK_SIZE) => 0;
26 while (off >= 0 && buffer[off] == ERASE_VALUE) {
29 memset(&buffer[off-3], BLOCK_SIZE, 3);
31 cfg->prog(cfg, block, 0, buffer, BLOCK_SIZE) => 0;
/littlefs-3.7.0-3.6.0/bd/
Dlfs_rambd.c22 bdcfg->erase_count, bdcfg->buffer); in lfs_rambd_create()
27 if (bd->cfg->buffer) { in lfs_rambd_create()
28 bd->buffer = bd->cfg->buffer; in lfs_rambd_create()
30 bd->buffer = lfs_malloc(bd->cfg->erase_size * bd->cfg->erase_count); in lfs_rambd_create()
31 if (!bd->buffer) { in lfs_rambd_create()
38 memset(bd->buffer, 0, bd->cfg->erase_size * bd->cfg->erase_count); in lfs_rambd_create()
48 if (!bd->cfg->buffer) { in lfs_rambd_destroy()
49 lfs_free(bd->buffer); in lfs_rambd_destroy()
56 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_rambd_read() argument
59 (void*)cfg, block, off, buffer, size); in lfs_rambd_read()
[all …]
Dlfs_filebd.c66 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_filebd_read() argument
69 (void*)cfg, block, off, buffer, size); in lfs_filebd_read()
79 memset(buffer, 0, size); in lfs_filebd_read()
90 ssize_t res2 = read(bd->fd, buffer, size); in lfs_filebd_read()
102 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_filebd_prog() argument
105 (void*)cfg, block, off, buffer, size); in lfs_filebd_prog()
123 ssize_t res2 = write(bd->fd, buffer, size); in lfs_filebd_prog()
Dlfs_rambd.h44 void *buffer; member
49 uint8_t *buffer; member
63 lfs_off_t off, void *buffer, lfs_size_t size);
69 lfs_off_t off, const void *buffer, lfs_size_t size);
Dlfs_emubd.c216 lfs_off_t off, void *buffer, lfs_size_t size) { in lfs_emubd_read() argument
219 (void*)cfg, block, off, buffer, size); in lfs_emubd_read()
239 memcpy(buffer, &b->data[off], size); in lfs_emubd_read()
242 memset(buffer, in lfs_emubd_read()
266 lfs_off_t off, const void *buffer, lfs_size_t size) { in lfs_emubd_prog() argument
269 (void*)cfg, block, off, buffer, size); in lfs_emubd_prog()
308 memcpy(&b->data[off], buffer, size); in lfs_emubd_prog()
321 ssize_t res2 = write(bd->disk->fd, buffer, size); in lfs_emubd_prog()
Dlfs_filebd.h60 lfs_off_t off, void *buffer, lfs_size_t size);
66 lfs_off_t off, const void *buffer, lfs_size_t size);
/littlefs-3.7.0-3.6.0/benches/
Dbench_dir.toml16 uint8_t buffer[CHUNK_SIZE];
26 buffer[k] = BENCH_PRNG(&file_prng);
28 lfs_file_write(&lfs, &file, buffer, CHUNK_SIZE) => CHUNK_SIZE;
48 lfs_file_read(&lfs, &file, buffer, CHUNK_SIZE) => CHUNK_SIZE;
50 assert(buffer[k] == BENCH_PRNG(&file_prng));
77 uint8_t buffer[CHUNK_SIZE];
91 buffer[k] = BENCH_PRNG(&file_prng);
93 lfs_file_write(&lfs, &file, buffer, CHUNK_SIZE) => CHUNK_SIZE;
118 uint8_t buffer[CHUNK_SIZE];
128 buffer[k] = BENCH_PRNG(&file_prng);
[all …]
Dbench_file.toml16 uint8_t buffer[CHUNK_SIZE];
22 buffer[j] = BENCH_PRNG(&chunk_prng);
25 lfs_file_write(&lfs, &file, buffer, CHUNK_SIZE) => CHUNK_SIZE;
27 lfs_file_write(&lfs, &file, buffer, CHUNK_SIZE) => CHUNK_SIZE;
42 lfs_file_read(&lfs, &file, buffer, CHUNK_SIZE) => CHUNK_SIZE;
46 assert(buffer[j] == BENCH_PRNG(&chunk_prng));
74 uint8_t buffer[CHUNK_SIZE];
83 buffer[j] = BENCH_PRNG(&chunk_prng);
88 lfs_file_write(&lfs, &file, buffer, CHUNK_SIZE) => CHUNK_SIZE;
Dbench_superblock.toml13 uint8_t buffer[CHUNK_SIZE];
22 buffer[k] = i+j+k;
24 lfs_file_write(&lfs, &file, buffer, CHUNK_SIZE) => CHUNK_SIZE;
/littlefs-3.7.0-3.6.0/
Dlfs.c43 memset(pcache->buffer, 0xff, lfs->cfg->cache_size); in lfs_cache_zero()
50 void *buffer, lfs_size_t size) { in lfs_bd_read() argument
51 uint8_t *data = buffer; in lfs_bd_read()
65 memcpy(data, &pcache->buffer[off-pcache->off], diff); in lfs_bd_read()
82 memcpy(data, &rcache->buffer[off-rcache->off], diff); in lfs_bd_read()
120 rcache->off, rcache->buffer, rcache->size); in lfs_bd_read()
133 const void *buffer, lfs_size_t size) { in lfs_bd_cmp() argument
134 const uint8_t *data = buffer; in lfs_bd_cmp()
185 pcache->off, pcache->buffer, diff); in lfs_bd_flush()
196 pcache->block, pcache->off, pcache->buffer, diff); in lfs_bd_flush()
[all …]
Dlfs.h166 lfs_off_t off, void *buffer, lfs_size_t size);
172 lfs_off_t off, const void *buffer, lfs_size_t size);
320 void *buffer; member
330 void *buffer; member
355 uint8_t *buffer; member
438 uint32_t *buffer; member
521 uint8_t type, void *buffer, lfs_size_t size);
532 uint8_t type, const void *buffer, lfs_size_t size);
594 void *buffer, lfs_size_t size);
604 const void *buffer, lfs_size_t size);
Dlfs_util.c15 uint32_t lfs_crc(uint32_t crc, const void *buffer, size_t size) { in lfs_crc() argument
23 const uint8_t *data = buffer; in lfs_crc()

12