Compare commits

...

1 Commits

Author SHA1 Message Date
chinky c042078195 适配rtt 2024-07-18 20:59:48 +08:00
4 changed files with 138 additions and 2 deletions

21
.gitignore vendored Normal file
View File

@ -0,0 +1,21 @@
*.pyc
*.map
*.dblite
*.axf
*.exe
*.pdb
*.idb
*.ilk
*.old
build
Debug
*~
*.o
*.obj
*.out
*.bak
*.dep
*.lib
*.i
*.d
.DS_Stor*

98
Kconfig Normal file
View File

@ -0,0 +1,98 @@
# Kconfig file for package FlashDB
menuconfig LIB_USING_FLASHDB
bool "FlashDB: A lightweight database that supports key-value and time series data."
default y
if LIB_USING_FLASHDB
config FDB_USING_KVDB
bool "Using KVDB feature"
default y
if FDB_USING_KVDB
config FDB_KV_AUTO_UPDATE
bool
prompt "Auto update KV to latest default when current KVDB version number is changed."
default n
config FDB_KV_USING_CACHE
bool "Enable KVDB cache"
default n
config FDB_KV_CACHE_TABLE_SIZE
int "KVDB cache table size(1~65535)"
default 128
range 1 65535
depends on FDB_KV_USING_CACHE
endif
config FDB_USING_TSDB
bool
prompt "Using TSDB (Time series database) feature"
default y
choice
prompt "Storage mode"
default FDB_USING_FAL_MODE
config FDB_USING_FAL_MODE
bool
prompt "Using FAL storage mode"
select PKG_USING_FAL if RT_VER_NUM < 0x40100
select RT_USING_FAL if RT_VER_NUM >= 0x40100
config FDB_USING_FILE_MODE
bool "Using file mode"
endchoice
if FDB_USING_FAL_MODE
choice
prompt "Write minimum granularity"
default FDB_WRITE_GRAN_1BIT
config FDB_WRITE_GRAN_1BIT
bool "1bit such as Nor Flash"
config FDB_WRITE_GRAN_8BITS
bool "8bits such as STM32F2/F4"
config FDB_WRITE_GRAN_32BITS
bool "32bits such as STM32F1"
config FDB_WRITE_GRAN_64BITS
bool "64bits such as STM32L4"
config FDB_WRITE_GRAN_128BITS
bool "128bits"
endchoice
config FDB_WRITE_GRAN
int
default 1 if FDB_WRITE_GRAN_1BIT
default 8 if FDB_WRITE_GRAN_8BITS
default 32 if FDB_WRITE_GRAN_32BITS
default 64 if FDB_WRITE_GRAN_64BITS
default 128 if FDB_WRITE_GRAN_128BITS
endif
choice
prompt "File storage mode"
depends on FDB_USING_FILE_MODE
default FDB_USING_FILE_POSIX_MODE
config FDB_USING_FILE_LIBC_MODE
bool "Using LIBC file API"
config FDB_USING_FILE_POSIX_MODE
bool "Using POSIX file API"
endchoice
config FLASHDB_USING_SAMPLES
bool "Enable samples"
default n
config FDB_DEBUG_ENABLE
bool "Enable debug log output"
default y
endif

17
SConscript Normal file
View File

@ -0,0 +1,17 @@
from building import *
# get current directory
cwd = GetCurrentDir()
# The set of source files associated with this SConscript file.
src = Glob('src/*.c')
path = [cwd + '/inc']
if GetDepend(['FLASHDB_USING_SAMPLES']):
src += Glob('samples/*.c')
if GetDepend(['RT_USING_UTEST']):
src += Glob('tests/*.c')
group = DefineGroup('FlashDB', src, depend = ['LIB_USING_FLASHDB'], CPPPATH = path)
Return('group')

View File

@ -11,7 +11,7 @@
#ifndef _FDB_CFG_H_
#define _FDB_CFG_H_
#if 0
/* using KVDB feature */
#define FDB_USING_KVDB
@ -46,5 +46,5 @@
/* print debug information */
#define FDB_DEBUG_ENABLE
#endif
#endif /* _FDB_CFG_H_ */