2023-02-08 23:58:35 +08:00
|
|
|
|
2023-06-10 00:56:55 +08:00
|
|
|
#include "param_demo.h"
|
|
|
|
#include <string.h>
|
2023-02-08 23:58:35 +08:00
|
|
|
#include <stdio.h>
|
|
|
|
|
|
|
|
|
2023-03-12 23:23:22 +08:00
|
|
|
int main()
|
|
|
|
{
|
2023-06-10 00:56:55 +08:00
|
|
|
InitParam(true);
|
2023-02-08 23:58:35 +08:00
|
|
|
|
2023-06-10 00:56:55 +08:00
|
|
|
ShowAllParam();
|
2023-02-28 21:58:18 +08:00
|
|
|
|
2023-06-10 00:56:55 +08:00
|
|
|
g_test = 80;
|
2023-06-17 22:01:23 +08:00
|
|
|
g_test_3 = -20.5;
|
2023-02-08 23:58:35 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
SaveParam(false);
|
|
|
|
ReloadParam(false);
|
2023-02-08 23:58:35 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
int ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 50, PARAM_DEF);
|
|
|
|
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
|
2023-06-10 00:56:55 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 101, PARAM_DEF);
|
|
|
|
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
|
2023-06-10 00:56:55 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 101, PARAM_NONE);
|
|
|
|
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
|
2023-06-10 00:56:55 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 101, PARAM_MIN_MAX);
|
|
|
|
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
|
2023-06-10 00:56:55 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
ret = PARAM_DAT_SET_NEW_VALUE(g_test_6, 1, PARAM_MIN_MAX);
|
|
|
|
printf("ret = %d, g_test_6 = %d\n", ret, g_test_6);
|
2023-06-10 00:56:55 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
PARAM_STR_SET_NEW_VALUE(g_test_str, "123aa9", PARAM_NONE);
|
|
|
|
printf("ret = %d, g_test_str = %s\n", ret, g_test_str);
|
2023-06-10 00:56:55 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
PARAM_STR_SET_NEW_VALUE(g_test_str, "123aa1245249", PARAM_DEF);
|
|
|
|
printf("ret = %d, g_test_str = %s\n", ret, g_test_str);
|
2023-06-10 00:56:55 +08:00
|
|
|
|
2023-06-17 22:01:23 +08:00
|
|
|
PARAM_STR_SET_NEW_VALUE(g_test_str, "123aa945457", PARAM_MIN_MAX);
|
|
|
|
printf("ret = %d, g_test_str = %s\n", ret, g_test_str);
|
2023-06-10 00:56:55 +08:00
|
|
|
|
|
|
|
ShowAllParam();
|
|
|
|
|
2023-03-12 23:23:22 +08:00
|
|
|
return 0;
|
2023-02-08 23:58:35 +08:00
|
|
|
}
|