diff --git a/demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c b/demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c index f0e0007..0729666 100644 --- a/demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c +++ b/demo/env/stm32f10x/rtt/components/easyflash/port/ef_port.c @@ -237,10 +237,9 @@ void ef_print(const char *format, ...) { #if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) #include #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 [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.); diff --git a/demo/env/stm32f4xx/components/easyflash/port/ef_port.c b/demo/env/stm32f4xx/components/easyflash/port/ef_port.c index 7eed62a..eb67890 100644 --- a/demo/env/stm32f4xx/components/easyflash/port/ef_port.c +++ b/demo/env/stm32f4xx/components/easyflash/port/ef_port.c @@ -368,10 +368,9 @@ void ef_print(const char *format, ...) { #if defined(RT_USING_FINSH) && defined(FINSH_USING_MSH) #include #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 [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.); diff --git a/easyflash/inc/easyflash.h b/easyflash/inc/easyflash.h index 641875d..8bb3115 100644 --- a/easyflash/inc/easyflash.h +++ b/easyflash/inc/easyflash.h @@ -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;