littlefsv2: solve astyle issues

Adds littlefs-directory under littlefsv2 to .astyleignore as it's an
external component brought to Mbed OS. Issues with the adaption layer
fixed.
pull/12783/head
Veijo Pesonen 2020-04-14 11:56:41 +03:00
parent 3dfbe139f2
commit 62e04f71c3
3 changed files with 15 additions and 14 deletions

View File

@ -20,6 +20,7 @@
^features/netsocket/ppp/source ^features/netsocket/ppp/source
^features/storage/filesystem/fat/ChaN ^features/storage/filesystem/fat/ChaN
^features/storage/filesystem/littlefs/littlefs/ ^features/storage/filesystem/littlefs/littlefs/
^features/storage/filesystem/littlefsv2/littlefs/
^features/unsupported/ ^features/unsupported/
^hal/storage_abstraction ^hal/storage_abstraction
^platform/cxxsupport ^platform/cxxsupport

View File

@ -114,14 +114,14 @@ static int lfs2_totype(int type)
////// Block device operations ////// ////// Block device operations //////
static int lfs2_bd_read(const struct lfs2_config *c, lfs2_block_t block, static int lfs2_bd_read(const struct lfs2_config *c, lfs2_block_t block,
lfs2_off_t off, void *buffer, lfs2_size_t size) lfs2_off_t off, void *buffer, lfs2_size_t size)
{ {
BlockDevice *bd = (BlockDevice *)c->context; BlockDevice *bd = (BlockDevice *)c->context;
return bd->read(buffer, (bd_addr_t)block * c->block_size + off, size); return bd->read(buffer, (bd_addr_t)block * c->block_size + off, size);
} }
static int lfs2_bd_prog(const struct lfs2_config *c, lfs2_block_t block, static int lfs2_bd_prog(const struct lfs2_config *c, lfs2_block_t block,
lfs2_off_t off, const void *buffer, lfs2_size_t size) lfs2_off_t off, const void *buffer, lfs2_size_t size)
{ {
BlockDevice *bd = (BlockDevice *)c->context; BlockDevice *bd = (BlockDevice *)c->context;
return bd->program(buffer, (bd_addr_t)block * c->block_size + off, size); return bd->program(buffer, (bd_addr_t)block * c->block_size + off, size);
@ -144,8 +144,8 @@ static int lfs2_bd_sync(const struct lfs2_config *c)
// Filesystem implementation (See LittleFileSystem2.h) // Filesystem implementation (See LittleFileSystem2.h)
LittleFileSystem2::LittleFileSystem2(const char *name, BlockDevice *bd, LittleFileSystem2::LittleFileSystem2(const char *name, BlockDevice *bd,
lfs2_size_t block_size, uint32_t block_cycles, lfs2_size_t block_size, uint32_t block_cycles,
lfs2_size_t cache_size, lfs2_size_t lookahead_size) lfs2_size_t cache_size, lfs2_size_t lookahead_size)
: FileSystem(name) : FileSystem(name)
{ {
memset(&_config, 0, sizeof(_config)); memset(&_config, 0, sizeof(_config));
@ -222,8 +222,8 @@ int LittleFileSystem2::unmount()
} }
int LittleFileSystem2::format(BlockDevice *bd, int LittleFileSystem2::format(BlockDevice *bd,
lfs2_size_t block_size, uint32_t block_cycles, lfs2_size_t block_size, uint32_t block_cycles,
lfs2_size_t cache_size, lfs2_size_t lookahead_size) lfs2_size_t cache_size, lfs2_size_t lookahead_size)
{ {
int err = bd->init(); int err = bd->init();
if (err) { if (err) {
@ -281,10 +281,10 @@ int LittleFileSystem2::reformat(BlockDevice *bd)
} }
int err = LittleFileSystem2::format(bd, int err = LittleFileSystem2::format(bd,
_config.block_size, _config.block_size,
_config.block_cycles, _config.block_cycles,
_config.cache_size, _config.cache_size,
_config.lookahead_size); _config.lookahead_size);
if (err) { if (err) {
_mutex.unlock(); _mutex.unlock();
return err; return err;

View File

@ -58,10 +58,10 @@ public:
* more RAM. * more RAM.
*/ */
LittleFileSystem2(const char *name = NULL, mbed::BlockDevice *bd = NULL, LittleFileSystem2(const char *name = NULL, mbed::BlockDevice *bd = NULL,
lfs2_size_t block_size = MBED_LFS2_BLOCK_SIZE, lfs2_size_t block_size = MBED_LFS2_BLOCK_SIZE,
uint32_t block_cycles = MBED_LFS2_BLOCK_CYCLES, uint32_t block_cycles = MBED_LFS2_BLOCK_CYCLES,
lfs2_size_t cache_size = MBED_LFS2_CACHE_SIZE, lfs2_size_t cache_size = MBED_LFS2_CACHE_SIZE,
lfs2_size_t lookahead = MBED_LFS2_LOOKAHEAD_SIZE); lfs2_size_t lookahead = MBED_LFS2_LOOKAHEAD_SIZE);
virtual ~LittleFileSystem2(); virtual ~LittleFileSystem2();