param/Param/inc/param_cfg.h

60 lines
2.3 KiB
C
Raw Normal View History

/**
**********************************************************************************************************************
* @file param_cfg.h
* @brief
* @author const_zpc any question please send mail to const_zpc@163.com
* @date 2023-03-11
**********************************************************************************************************************
*
**********************************************************************************************************************
*/
/* Define to prevent recursive inclusion -----------------------------------------------------------------------------*/
#ifndef _PARAM_CFG_H_
#define _PARAM_CFG_H_
/* Includes ----------------------------------------------------------------------------------------------------------*/
/** 参数保存时是否采用键值对方式保存
* 1,,
* 0,, , /, 使使,
* */
#define PARAM_USE_KEY_VALUE 1
/** 参数名字最大定义长度(包括结束符'\0', 因此小于或等于1则禁用参数名字字符串相关功能 */
#define PARAM_NAME_MAX_LENGTH 15
/** 字符串类型的参数取值最大定义长度(包括结束符) */
#define PARAM_STRING_MAX_LENGTH 15
#if PARAM_USE_KEY_VALUE
/** 最多支持多少个参数 */
#define PARAM_SUPPORT_NUM PARAM_SUPPORT_16
#define PARAM_SUPPORT_16 1
#define PARAM_SUPPORT_256 2
#define PARAM_SUPPORT_4096 3
#endif
#if PARAM_USE_KEY_VALUE
#if (PARAM_SUPPORT_NUM == PARAM_SUPPORT_16)
#if PARAM_STRING_MAX_LENGTH >= 16
#error "Param: The maximum length of a string can not over 15"
#endif
#elif (PARAM_SUPPORT_NUM == PARAM_SUPPORT_256)
#if PARAM_STRING_MAX_LENGTH >= 256
#error "Param: The maximum length of a string can not over 256"
#endif
#elif (PARAM_SUPPORT_NUM == PARAM_SUPPORT_4096)
#if PARAM_STRING_MAX_LENGTH >= 4096
#error "Param: The maximum length of a string can not over 4096"
#endif
#endif
#endif
#endif