mirror of
https://github.com/eledio-devices/thirdparty-littlefs.git
synced 2025-11-01 00:38:29 +01:00
Renamed all prefixes to include the major version
This is needed to allow compilation of multiple versions in the same binary. Also note that the FUSE testing was removed because of related name issues. ./scripts/prefix.py lfs1
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/// AUTOGENERATED TEST ///
|
||||
#include "lfs.h"
|
||||
#include "emubd/lfs_emubd.h"
|
||||
#include "lfs1.h"
|
||||
#include "emubd/lfs1_emubd.h"
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
@@ -37,7 +37,7 @@ static void test_assert(const char *file, unsigned line,
|
||||
|
||||
|
||||
// utility functions for traversals
|
||||
static int __attribute__((used)) test_count(void *p, lfs_block_t b) {{
|
||||
static int __attribute__((used)) test_count(void *p, lfs1_block_t b) {{
|
||||
(void)b;
|
||||
unsigned *u = (unsigned*)p;
|
||||
*u += 1;
|
||||
@@ -45,62 +45,62 @@ static int __attribute__((used)) test_count(void *p, lfs_block_t b) {{
|
||||
}}
|
||||
|
||||
|
||||
// lfs declarations
|
||||
lfs_t lfs;
|
||||
lfs_emubd_t bd;
|
||||
lfs_file_t file[4];
|
||||
lfs_dir_t dir[4];
|
||||
struct lfs_info info;
|
||||
// lfs1 declarations
|
||||
lfs1_t lfs1;
|
||||
lfs1_emubd_t bd;
|
||||
lfs1_file_t file[4];
|
||||
lfs1_dir_t dir[4];
|
||||
struct lfs1_info info;
|
||||
|
||||
uint8_t buffer[1024];
|
||||
uint8_t wbuffer[1024];
|
||||
uint8_t rbuffer[1024];
|
||||
lfs_size_t size;
|
||||
lfs_size_t wsize;
|
||||
lfs_size_t rsize;
|
||||
lfs1_size_t size;
|
||||
lfs1_size_t wsize;
|
||||
lfs1_size_t rsize;
|
||||
|
||||
uintmax_t test;
|
||||
|
||||
#ifndef LFS_READ_SIZE
|
||||
#define LFS_READ_SIZE 16
|
||||
#ifndef LFS1_READ_SIZE
|
||||
#define LFS1_READ_SIZE 16
|
||||
#endif
|
||||
|
||||
#ifndef LFS_PROG_SIZE
|
||||
#define LFS_PROG_SIZE 16
|
||||
#ifndef LFS1_PROG_SIZE
|
||||
#define LFS1_PROG_SIZE 16
|
||||
#endif
|
||||
|
||||
#ifndef LFS_BLOCK_SIZE
|
||||
#define LFS_BLOCK_SIZE 512
|
||||
#ifndef LFS1_BLOCK_SIZE
|
||||
#define LFS1_BLOCK_SIZE 512
|
||||
#endif
|
||||
|
||||
#ifndef LFS_BLOCK_COUNT
|
||||
#define LFS_BLOCK_COUNT 1024
|
||||
#ifndef LFS1_BLOCK_COUNT
|
||||
#define LFS1_BLOCK_COUNT 1024
|
||||
#endif
|
||||
|
||||
#ifndef LFS_LOOKAHEAD
|
||||
#define LFS_LOOKAHEAD 128
|
||||
#ifndef LFS1_LOOKAHEAD
|
||||
#define LFS1_LOOKAHEAD 128
|
||||
#endif
|
||||
|
||||
const struct lfs_config cfg = {{
|
||||
const struct lfs1_config cfg = {{
|
||||
.context = &bd,
|
||||
.read = &lfs_emubd_read,
|
||||
.prog = &lfs_emubd_prog,
|
||||
.erase = &lfs_emubd_erase,
|
||||
.sync = &lfs_emubd_sync,
|
||||
.read = &lfs1_emubd_read,
|
||||
.prog = &lfs1_emubd_prog,
|
||||
.erase = &lfs1_emubd_erase,
|
||||
.sync = &lfs1_emubd_sync,
|
||||
|
||||
.read_size = LFS_READ_SIZE,
|
||||
.prog_size = LFS_PROG_SIZE,
|
||||
.block_size = LFS_BLOCK_SIZE,
|
||||
.block_count = LFS_BLOCK_COUNT,
|
||||
.lookahead = LFS_LOOKAHEAD,
|
||||
.read_size = LFS1_READ_SIZE,
|
||||
.prog_size = LFS1_PROG_SIZE,
|
||||
.block_size = LFS1_BLOCK_SIZE,
|
||||
.block_count = LFS1_BLOCK_COUNT,
|
||||
.lookahead = LFS1_LOOKAHEAD,
|
||||
}};
|
||||
|
||||
|
||||
// Entry point
|
||||
int main(void) {{
|
||||
lfs_emubd_create(&cfg, "blocks");
|
||||
lfs1_emubd_create(&cfg, "blocks");
|
||||
|
||||
{tests}
|
||||
|
||||
lfs_emubd_destroy(&cfg);
|
||||
lfs1_emubd_destroy(&cfg);
|
||||
}}
|
||||
|
||||
Reference in New Issue
Block a user