porting mynewt-nffs

This commit is contained in:
hathach committed 2018-10-12 18:21:36 +07:00
1 parent f4f6108ed6
commit 49baa7eae4
4 files changed
+20 -8

No files matched your search

-3
View File
@@ -75,9 +75,6 @@ class File: public Stream
class FileSystemClass
{
public:
FileSystemClass ();
virtual ~FileSystemClass ();
virtual bool begin () = 0;
// Open the specified file/directory with the supplied mode (e.g. read or
+13
View File
@@ -39,6 +39,19 @@
MynewtNFFS InternalFS;
//--------------------------------------------------------------------+
// Mynewt NFFS port
//--------------------------------------------------------------------+
extern "C"
{
nffs_os_mempool_t nffs_file_pool;
nffs_os_mempool_t nffs_dir_pool;
nffs_os_mempool_t nffs_inode_entry_pool;
nffs_os_mempool_t nffs_block_entry_pool;
nffs_os_mempool_t nffs_cache_inode_pool;
nffs_os_mempool_t nffs_cache_block_pool;
}
MynewtNFFS::MynewtNFFS (void)
{
@@ -20,11 +20,13 @@
#ifndef H_CONFIG_
#define H_CONFIG_
#if 1 // Adafruit Bluefruit
#ifdef ARDUINO_NRF52_ADAFRUIT
typedef void* nffs_os_mempool_t;
#define NFFS_CONFIG_USE_HEAP 0
#define CONFIG_NFFS_FILESYSTEM_MAX_AREAS 7
#define NFFS_CONFIG_MAX_AREAS 7
#define NFFS_CONFIG_MAX_BLOCK_SIZE 2048
#elif __ZEPHYR__
@@ -328,7 +328,7 @@ extern void *nffs_dir_mem;
extern uint32_t nffs_hash_next_file_id;
extern uint32_t nffs_hash_next_dir_id;
extern uint32_t nffs_hash_next_block_id;
extern struct nffs_area nffs_areas[CONFIG_NFFS_FILESYSTEM_MAX_AREAS];
extern struct nffs_area nffs_areas[NFFS_CONFIG_MAX_AREAS];
extern uint8_t nffs_num_areas;
extern uint8_t nffs_scratch_area_idx;
extern uint16_t nffs_block_max_data_sz;
@@ -557,7 +557,7 @@ int nffs_write_to_file(struct nffs_file *file, const void *data, int len);
#define NFFS_FLASH_LOC_NONE nffs_flash_loc(NFFS_AREA_ID_NONE, 0)
#if __ZEPHYR__
#if __ZEPHYR__ || defined(ARDUINO_NRF52_ADAFRUIT)
#define NFFS_LOG(lvl, ...)
#define MYNEWT_VAL(val) 0