param/cot_param_cfg.h

80 lines
2.9 KiB
C
Raw Normal View History

/**
**********************************************************************************************************************
* @file cot_param_cfg.h
* @brief
* @author const_zpc any question please send mail to const_zpc@163.com
**********************************************************************************************************************
*
**********************************************************************************************************************
*/
/* Define to prevent recursive inclusion -----------------------------------------------------------------------------*/
#ifndef _COT_PARAM_CFG_H_
#define _COT_PARAM_CFG_H_
/* Includes ----------------------------------------------------------------------------------------------------------*/
/** 参数保存时是否采用键值对方式保存
* 1,,
* 0,, , /, 使使,
* */
#define COT_PARAM_USE_KEY_VALUE 1
/**
* @brief 使
*
* @note
* 0,; 1,使
*/
#define COT_PARAM_USE_CUSTOM_CHECK 1
/**
* @brief 使
* 0,; 1,使
*/
#define COT_PARAM_USE_STRING_TYPE 1
/**
* @brief 使64
* 0,; 1,使
*/
#define COT_PARAM_USE_64_BIT_LENGTH 1
/** 参数名字最大定义长度(包括结束符'\0', 因此小于或等于1则禁用参数名字字符串相关功能 */
#define COT_PARAM_NAME_MAX_LENGTH 15
#if COT_PARAM_USE_STRING_TYPE
/** 字符串类型的参数取值最大定义长度(包括结束符) */
#define COT_PARAM_STRING_MAX_LENGTH 15
#endif
#if COT_PARAM_USE_KEY_VALUE
/** 最多支持多少个参数 */
#define COT_PARAM_SUPPORT_NUM COT_PARAM_SUPPORT_16
#define COT_PARAM_SUPPORT_16 1 // ID取值范围0-15
#define COT_PARAM_SUPPORT_256 2 // ID取值范围0-255
#define COT_PARAM_SUPPORT_4096 3 // ID取值范围0-4095
#endif
#if COT_PARAM_USE_KEY_VALUE
#if (PARAM_SUPPORT_NUM == COT_PARAM_SUPPORT_16)
#if COT_PARAM_STRING_MAX_LENGTH >= 16
#error "Param: The maximum length of a string can not over 15"
#endif
#elif (PARAM_SUPPORT_NUM == COT_PARAM_SUPPORT_256)
#if COT_PARAM_STRING_MAX_LENGTH >= 256
#error "Param: The maximum length of a string can not over 256"
#endif
#elif (PARAM_SUPPORT_NUM == COT_PARAM_SUPPORT_4096)
#if COT_PARAM_STRING_MAX_LENGTH >= 4096
#error "Param: The maximum length of a string can not over 4096"
#endif
#endif
#endif
#endif