2025-10-10 16:07:00 +08:00

77 lines
1.9 KiB
C
Executable File

/*
* Copyright (c) 2020, Armink, <armink.ztl@gmail.com>
*
* SPDX-License-Identifier: Apache-2.0
*/
/**
* @file
* @brief configuration file
*/
#ifndef _FDB_CFG_H_
#define _FDB_CFG_H_
#include "os/os.h"
#if CONFIG_FLASHDB_USING_KVDB
/* using KVDB feature */
#define FDB_USING_KVDB
#else
#undef FDB_USING_KVDB
#endif
#ifdef FDB_USING_KVDB
/* Auto update KV to latest default when current KVDB version number is changed. @see fdb_kvdb.ver_num */
/* #define FDB_KV_AUTO_UPDATE */
#endif
#if CONFIG_FLASHDB_USING_TSDB
/* using TSDB (Time series database) feature */
#define FDB_USING_TSDB
#else
#undef FDB_USING_TSDB
#endif
/* Using FAL storage mode */
#define FDB_USING_FAL_MODE
#ifdef FDB_USING_FAL_MODE
/* the flash write granularity, unit: bit
* only support 1(nor flash)/ 8(stm32f2/f4)/ 32(stm32f1) */
#define FDB_WRITE_GRAN 8/* @note you must define it for a value */
#endif
/* Using file storage mode by LIBC file API, like fopen/fread/fwrte/fclose */
/* #define FDB_USING_FILE_LIBC_MODE */
/* Using file storage mode by POSIX file API, like open/read/write/close */
/* #define FDB_USING_FILE_POSIX_MODE */
/* MCU Endian Configuration, default is Little Endian Order. */
/* #define FDB_BIG_ENDIAN */
#define FAL_MALLOC os_malloc
//#define FAL_CALLOC os_calloc
#define FAL_REALLOC os_realloc
#define FAL_FREE os_free
#define FAL_PRINTF bk_printf
#define TAG "flashdb"
#define LOGI(...) BK_LOGI(TAG, ##__VA_ARGS__)
#define LOGW(...) BK_LOGW(TAG, ##__VA_ARGS__)
#define LOGE(...) BK_LOGE(TAG, ##__VA_ARGS__)
#define LOGD(...) BK_LOGD(TAG, ##__VA_ARGS__)
#define log_i LOGI
#define log_e LOGE
#define FDB_INFO LOGI
/* log print macro. default EF_PRINT macro is printf() */
//
/* print debug information */
//#define FDB_DEBUG_ENABLE
#endif /* _FDB_CFG_H_ */