mirror of
https://gitee.com/const-zpc/param.git
synced 2025-01-30 04:32:52 +08:00
📃 docs: 完善介绍信息
This commit is contained in:
parent
9b14c89157
commit
7c8fb79f9e
@ -27,6 +27,8 @@ int main ()
|
|||||||
ShowAllParam();
|
ShowAllParam();
|
||||||
|
|
||||||
printf("\nModify: \n");
|
printf("\nModify: \n");
|
||||||
|
|
||||||
|
// 通过接口修改(参数范围限制)
|
||||||
memcpy(databuf, &data, sizeof(data));
|
memcpy(databuf, &data, sizeof(data));
|
||||||
ModifyByName("test_2", databuf);
|
ModifyByName("test_2", databuf);
|
||||||
|
|
||||||
@ -35,6 +37,12 @@ int main ()
|
|||||||
|
|
||||||
ShowAllParam();
|
ShowAllParam();
|
||||||
|
|
||||||
|
// 在模块文件中定义的参数可以选择直接修改(没有参数范围限制)
|
||||||
|
test = 5;
|
||||||
|
test_3 = 8.26;
|
||||||
|
|
||||||
|
ShowAllParam();
|
||||||
|
|
||||||
printf("\nReset: \n");
|
printf("\nReset: \n");
|
||||||
ResetParam();
|
ResetParam();
|
||||||
ShowAllParam();
|
ShowAllParam();
|
||||||
|
@ -1,25 +1,28 @@
|
|||||||
/**
|
/**
|
||||||
|
**********************************************************************************************************************
|
||||||
* @file param.h
|
* @file param.h
|
||||||
* @author pczhou (pczhou@streamax.com)
|
* @brief 该文件提供参数管理框架所有函数原型
|
||||||
* @brief
|
* @author const_zpc any question please send mail to const_zpc@163.com
|
||||||
* @version 0.1
|
* @version V0.1
|
||||||
* @date 2023-02-07
|
* @date 2023-02-07
|
||||||
|
**********************************************************************************************************************
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023 锐明技术股份有限公司
|
**********************************************************************************************************************
|
||||||
*
|
|
||||||
* @par 修改日志:
|
|
||||||
* <table>
|
|
||||||
* <tr><th>Date <th>Version <th>Author <th>Description
|
|
||||||
* <tr><td>2023-02-07 <td>1.0 <td>pczhou <td>内容
|
|
||||||
* </table>
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Define to prevent recursive inclusion -----------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#ifndef _PARAM_H_
|
#ifndef _PARAM_H_
|
||||||
#define _PARAM_H_
|
#define _PARAM_H_
|
||||||
|
|
||||||
|
/* Includes ----------------------------------------------------------------------------------------------------------*/
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
extern "C" {
|
||||||
|
#endif
|
||||||
|
|
||||||
typedef int8_t PARAM_INT8_T;
|
typedef int8_t PARAM_INT8_T;
|
||||||
typedef int16_t PARAM_INT16_T;
|
typedef int16_t PARAM_INT16_T;
|
||||||
typedef int32_t PARAM_INT32_T;
|
typedef int32_t PARAM_INT32_T;
|
||||||
@ -137,4 +140,8 @@ extern int Param_ModifyByName(ParamTable_t *pParamTable, const char *pszName, co
|
|||||||
extern size_t Param_Serialize(ParamTable_t *pParamTable, uint8_t *pBuf);
|
extern size_t Param_Serialize(ParamTable_t *pParamTable, uint8_t *pBuf);
|
||||||
extern void Param_Parse(ParamTable_t *pParamTable, const uint8_t *pBuf);
|
extern void Param_Parse(ParamTable_t *pParamTable, const uint8_t *pBuf);
|
||||||
|
|
||||||
|
#ifdef __cplusplus
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif // !_PARAM_H_
|
#endif // !_PARAM_H_
|
||||||
|
@ -1,27 +1,27 @@
|
|||||||
/**
|
/**
|
||||||
|
**********************************************************************************************************************
|
||||||
* @file param.c
|
* @file param.c
|
||||||
* @author pczhou (pczhou@streamax.com)
|
* @brief 该文件提供参数管理框架功能
|
||||||
* @brief
|
* @author const_zpc any question please send mail to const_zpc@163.com
|
||||||
* @version 0.1
|
* @version V0.1
|
||||||
* @date 2023-02-07
|
* @date 2023-02-07
|
||||||
*
|
*
|
||||||
* @copyright Copyright (c) 2023 锐明技术股份有限公司
|
* @details 功能详细说明:
|
||||||
|
* + 参数修改和重置管理
|
||||||
|
* + 参数序列化和反序列化
|
||||||
*
|
*
|
||||||
* @par 修改日志:
|
**********************************************************************************************************************
|
||||||
* <table>
|
* 源码路径:https://gitee.com/const-zpc/param.git 具体问题及建议可在该网址填写 Issue
|
||||||
* <tr><th>Date <th>Version <th>Author <th>Description
|
*
|
||||||
* <tr><td>2023-02-07 <td>1.0 <td>pczhou <td>内容
|
*
|
||||||
* </table>
|
**********************************************************************************************************************
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
/* Includes ----------------------------------------------------------------------------------------------------------*/
|
||||||
#include "param.h"
|
#include "param.h"
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// const uint32_t sg_tParamTableNum = sizeof(sg_tParamTable) / sizeof(sg_tParamTable[0]);
|
|
||||||
|
|
||||||
#define CASE_CHANGE(type) \
|
#define CASE_CHANGE(type) \
|
||||||
case type:\
|
case type:\
|
||||||
{\
|
{\
|
||||||
|
36
README.en.md
36
README.en.md
@ -1,36 +0,0 @@
|
|||||||
# param
|
|
||||||
|
|
||||||
#### Description
|
|
||||||
参数管理框架
|
|
||||||
|
|
||||||
#### Software Architecture
|
|
||||||
Software architecture description
|
|
||||||
|
|
||||||
#### Installation
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### Instructions
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### Contribution
|
|
||||||
|
|
||||||
1. Fork the repository
|
|
||||||
2. Create Feat_xxx branch
|
|
||||||
3. Commit your code
|
|
||||||
4. Create Pull Request
|
|
||||||
|
|
||||||
|
|
||||||
#### Gitee Feature
|
|
||||||
|
|
||||||
1. You can use Readme\_XXX.md to support different languages, such as Readme\_en.md, Readme\_zh.md
|
|
||||||
2. Gitee blog [blog.gitee.com](https://blog.gitee.com)
|
|
||||||
3. Explore open source project [https://gitee.com/explore](https://gitee.com/explore)
|
|
||||||
4. The most valuable open source project [GVP](https://gitee.com/gvp)
|
|
||||||
5. The manual of Gitee [https://gitee.com/help](https://gitee.com/help)
|
|
||||||
6. The most popular members [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
|
47
README.md
47
README.md
@ -1,37 +1,32 @@
|
|||||||
# param
|
# 轻量级参数管理框架(C语言)
|
||||||
|
|
||||||
#### 介绍
|
#### 介绍
|
||||||
参数管理框架
|
1. 采用表驱动方式统一管理所有参数,包括缺省值、最小值和最大值等
|
||||||
|
|
||||||
|
2. 采用宏定义快速注册和添加参数进行管理
|
||||||
|
|
||||||
|
3. 支持基本类型参数和字符串参数
|
||||||
|
|
||||||
|
4. 支持序列化和反序列化,便于保存和读取校验
|
||||||
|
|
||||||
|
5. 可通过串口协议或其他协议调用接口修改参数
|
||||||
|
|
||||||
#### 软件架构
|
#### 软件架构
|
||||||
软件架构说明
|
软件架构说明
|
||||||
|
|
||||||
|
|
||||||
#### 安装教程
|
|
||||||
|
|
||||||
1. xxxx
|
|
||||||
2. xxxx
|
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 使用说明
|
#### 使用说明
|
||||||
|
1. 通过函数 Param_ModifyById、Param_ModifyByName 限制修改参数
|
||||||
|
2. 调用函数 Param_Serialize 对参数序列化, 保存至储存芯片中
|
||||||
|
3. 从储存芯片读取数据后,调用 Param_Parse 反序列化得到参数,同时进行参数范围校验
|
||||||
|
|
||||||
1. xxxx
|
#### demo样式
|
||||||
2. xxxx
|
博客:
|
||||||
3. xxxx
|
|
||||||
|
|
||||||
#### 参与贡献
|
[轻量级参数管理框架(C语言)](https://blog.csdn.net/qq_24130227/article/details/129233836?spm=1001.2014.3001.5501)
|
||||||
|
|
||||||
1. Fork 本仓库
|
#### 关于作者
|
||||||
2. 新建 Feat_xxx 分支
|
1. CSDN 博客 [大橙子疯](https://blog.csdn.net/qq_24130227?spm=1010.2135.3001.5343)
|
||||||
3. 提交代码
|
2. 联系邮箱 const_zpc@163.com
|
||||||
4. 新建 Pull Request
|
3. 了解更多可关注微信公众号
|
||||||
|
|
||||||
|
![大橙子疯嵌入式](微信公众号.jpg)
|
||||||
#### 特技
|
|
||||||
|
|
||||||
1. 使用 Readme\_XXX.md 来支持不同的语言,例如 Readme\_en.md, Readme\_zh.md
|
|
||||||
2. Gitee 官方博客 [blog.gitee.com](https://blog.gitee.com)
|
|
||||||
3. 你可以 [https://gitee.com/explore](https://gitee.com/explore) 这个地址来了解 Gitee 上的优秀开源项目
|
|
||||||
4. [GVP](https://gitee.com/gvp) 全称是 Gitee 最有价值开源项目,是综合评定出的优秀开源项目
|
|
||||||
5. Gitee 官方提供的使用手册 [https://gitee.com/help](https://gitee.com/help)
|
|
||||||
6. Gitee 封面人物是一档用来展示 Gitee 会员风采的栏目 [https://gitee.com/gitee-stars/](https://gitee.com/gitee-stars/)
|
|
Loading…
x
Reference in New Issue
Block a user