提交 9a1e3208 编写于 作者: armink_ztl's avatar armink_ztl

【更新】版本号至 2.0.2;

【修复】demo 中 setenv 命令无法删除 env 的问题。
Signed-off-by: armink_ztl's avatararmink <armink.ztl@gmail.com>
上级 90184f9f
......@@ -237,10 +237,9 @@ void ef_print(const char *format, ...) {
#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH)
#include <finsh.h>
#if defined(EF_USING_ENV)
void setenv(uint8_t argc, char **argv) {
static void setenv(uint8_t argc, char **argv) {
uint8_t i;
char c_value = NULL;
char *value = &c_value;
if (argc > 3) {
/* environment variable value string together */
for (i = 0; i < argc - 2; i++) {
......@@ -248,26 +247,26 @@ void setenv(uint8_t argc, char **argv) {
}
}
if (argc == 1) {
ef_set_env(value, value);
rt_kprintf("Please input: setenv <key> [value]\n");
} else if (argc == 2) {
ef_set_env(argv[1], value);
ef_set_env(argv[1], NULL);
} else {
ef_set_env(argv[1], argv[2]);
}
}
MSH_CMD_EXPORT(setenv, Set an envrionment variable.);
void printenv(uint8_t argc, char **argv) {
static void printenv(uint8_t argc, char **argv) {
ef_print_env();
}
MSH_CMD_EXPORT(printenv, Print all envrionment variables.);
void saveenv(uint8_t argc, char **argv) {
static void saveenv(uint8_t argc, char **argv) {
ef_save_env();
}
MSH_CMD_EXPORT(saveenv, Save all envrionment variables to flash.);
void getvalue(uint8_t argc, char **argv) {
static void getvalue(uint8_t argc, char **argv) {
char *value = NULL;
value = ef_get_env(argv[1]);
if (value) {
......@@ -278,7 +277,7 @@ void getvalue(uint8_t argc, char **argv) {
}
MSH_CMD_EXPORT(getvalue, Get an envrionment variable by name.);
void resetenv(uint8_t argc, char **argv) {
static void resetenv(uint8_t argc, char **argv) {
ef_env_set_default();
}
MSH_CMD_EXPORT(resetenv, Reset all envrionment variable to default.);
......
......@@ -368,10 +368,9 @@ void ef_print(const char *format, ...) {
#if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH)
#include <finsh.h>
#if defined(EF_USING_ENV)
void setenv(uint8_t argc, char **argv) {
static void setenv(uint8_t argc, char **argv) {
uint8_t i;
char c_value = NULL;
char *value = &c_value;
if (argc > 3) {
/* environment variable value string together */
for (i = 0; i < argc - 2; i++) {
......@@ -379,26 +378,26 @@ void setenv(uint8_t argc, char **argv) {
}
}
if (argc == 1) {
ef_set_env(value, value);
rt_kprintf("Please input: setenv <key> [value]\n");
} else if (argc == 2) {
ef_set_env(argv[1], value);
ef_set_env(argv[1], NULL);
} else {
ef_set_env(argv[1], argv[2]);
}
}
MSH_CMD_EXPORT(setenv, Set an envrionment variable.);
void printenv(uint8_t argc, char **argv) {
static void printenv(uint8_t argc, char **argv) {
ef_print_env();
}
MSH_CMD_EXPORT(printenv, Print all envrionment variables.);
void saveenv(uint8_t argc, char **argv) {
static void saveenv(uint8_t argc, char **argv) {
ef_save_env();
}
MSH_CMD_EXPORT(saveenv, Save all envrionment variables to flash.);
void getvalue(uint8_t argc, char **argv) {
static void getvalue(uint8_t argc, char **argv) {
char *value = NULL;
value = ef_get_env(argv[1]);
if (value) {
......@@ -409,7 +408,7 @@ void getvalue(uint8_t argc, char **argv) {
}
MSH_CMD_EXPORT(getvalue, Get an envrionment variable by name.);
void resetenv(uint8_t argc, char **argv) {
static void resetenv(uint8_t argc, char **argv) {
ef_env_set_default();
}
MSH_CMD_EXPORT(resetenv, Reset all envrionment variable to default.);
......
......@@ -76,8 +76,8 @@ if (!(EXPR)) \
#endif
/* EasyFlash software version number */
#define EF_SW_VERSION "3.2.1"
#define EF_SW_VERSION_NUM 0x30201
#define EF_SW_VERSION "3.2.2"
#define EF_SW_VERSION_NUM 0x30202
typedef struct _ef_env {
char *key;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册