From e25ec3bb4cccc651b99f7e68d452661087ac90ef Mon Sep 17 00:00:00 2001 From: armink Date: Mon, 20 Apr 2015 17:23:35 +0800 Subject: [PATCH] =?UTF-8?q?1=E3=80=81=E3=80=90=E4=BC=98=E5=8C=96=E3=80=91?= =?UTF-8?q?=E9=83=A8=E5=88=86=E4=BB=A3=E7=A0=81=E6=B3=A8=E9=87=8A=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: armink --- flash/src/flash_env.c | 38 +++++++++++++++++----------------- flash/src/flash_env_wl.c | 44 ++++++++++++++++++++-------------------- 2 files changed, 41 insertions(+), 41 deletions(-) diff --git a/flash/src/flash_env.c b/flash/src/flash_env.c index 97438a5..c119b97 100644 --- a/flash/src/flash_env.c +++ b/flash/src/flash_env.c @@ -27,7 +27,7 @@ #ifdef FLASH_ENV_USING_NORMAL_MODE /** - * Environment variables area has 2 sections + * ENV area has 2 sections * 1. System section * It storage ENV parameters. (Units: Word) * 2. Data section @@ -125,7 +125,7 @@ FlashErrCode flash_env_init(uint32_t start_addr, size_t user_size, size_t total_ } /** - * Environment variables set default. + * ENV set default. * * @return result */ @@ -222,10 +222,10 @@ uint32_t flash_get_env_write_bytes(void) { } /** - * Write an environment variable at the end of cache. + * Write an ENV at the end of cache. * - * @param key environment variable name - * @param value environment variable value + * @param key ENV name + * @param value ENV value * * @return result */ @@ -312,11 +312,11 @@ static uint32_t *find_env(const char *key) { } /** - * If the environment variable is not exist, create it. + * If the ENV is not exist, create it. * @see flash_write_env * - * @param key environment variable name - * @param value environment variable value + * @param key ENV name + * @param value ENV value * * @return result */ @@ -348,9 +348,9 @@ static FlashErrCode create_env(const char *key, const char *value) { } /** - * Delete an environment variable in cache. + * Delete an ENV in cache. * - * @param key environment variable name + * @param key ENV name * * @return result */ @@ -379,7 +379,7 @@ FlashErrCode flash_del_env(const char *key){ return FLASH_ENV_NAME_ERR; } del_env_length = strlen(del_env_str); - /* '\0' also must be as environment variable length */ + /* '\0' also must be as ENV length */ del_env_length ++; /* the address must multiple of 4 */ if (del_env_length % 4 != 0) { @@ -397,11 +397,11 @@ FlashErrCode flash_del_env(const char *key){ } /** - * Set an environment variable. If it value is empty, delete it. + * Set an ENV. If it value is empty, delete it. * If not find it in ENV table, then create it. * - * @param key environment variable name - * @param value environment variable value + * @param key ENV name + * @param value ENV value * * @return result */ @@ -414,7 +414,7 @@ FlashErrCode flash_set_env(const char *key, const char *value) { if (*value == NULL) { result = flash_del_env(key); } else { - /* if find this variables, then delete it and recreate it */ + /* if find this ENV, then delete it and recreate it */ if (find_env(key)) { result = flash_del_env(key); } @@ -426,9 +426,9 @@ FlashErrCode flash_set_env(const char *key, const char *value) { } /** - * Get an environment variable value by key name. + * Get an ENV value by key name. * - * @param key environment variable name + * @param key ENV name * * @return value */ @@ -473,7 +473,7 @@ void flash_print_env(void) { } } } - flash_print("\nEnvironment variables size: %ld/%ld bytes, mode: normal.\n", + flash_print("\nENV size: %ld/%ld bytes, mode: normal.\n", flash_get_env_write_bytes(), flash_get_env_total_size()); } @@ -505,7 +505,7 @@ void flash_load_env(void) { /* if ENV CRC32 check is fault, set default for it */ if (!env_crc_is_ok()) { - FLASH_INFO("Warning: Environment variables CRC check failed. Set it to default.\n"); + FLASH_INFO("Warning: ENV CRC check failed. Set it to default.\n"); flash_env_set_default(); } #endif diff --git a/flash/src/flash_env_wl.c b/flash/src/flash_env_wl.c index cd00a28..8d161dd 100644 --- a/flash/src/flash_env_wl.c +++ b/flash/src/flash_env_wl.c @@ -27,17 +27,17 @@ #ifdef FLASH_ENV_USING_WEAR_LEVELING_MODE /** - * Environment variables area has 2 sections + * ENV area has 2 sections * 1. System section - * Storage Environment variables current using data section address. + * Storage ENV current using data section address. * Units: Word. Total size: @see FLASH_ERASE_MIN_SIZE. * 2. Data section * The data section storage ENV's parameters and detail. * When an exception has occurred on flash erase or write. The current using data section * address will move to next available position. This position depends on FLASH_MIN_ERASE_SIZE. - * 2.1 Environment variables parameters part + * 2.1 ENV parameters part * It storage ENV's parameters. - * 2.2 Environment variables detail part + * 2.2 ENV detail part * It storage all ENV. Storage format is key=value\0. * All ENV must be 4 bytes alignment. The remaining part must fill '\0'. * @@ -143,7 +143,7 @@ FlashErrCode flash_env_init(uint32_t start_addr, size_t user_size, size_t total_ } /** - * Environment variables set default. + * ENV set default. * * @return result */ @@ -286,10 +286,10 @@ size_t flash_get_env_total_size(void) { } /** - * Write an environment variable at the end of cache. + * Write an ENV at the end of cache. * - * @param key environment variable name - * @param value environment variable value + * @param key ENV name + * @param value ENV value * * @return result */ @@ -376,11 +376,11 @@ static uint32_t *find_env(const char *key) { } /** - * If the environment variable is not exist, create it. + * If the ENV is not exist, create it. * @see flash_write_env * - * @param key environment variable name - * @param value environment variable value + * @param key ENV name + * @param value ENV value * * @return result */ @@ -412,9 +412,9 @@ static FlashErrCode create_env(const char *key, const char *value) { } /** - * Delete an environment variable in cache. + * Delete an ENV in cache. * - * @param key environment variable name + * @param key ENV name * * @return result */ @@ -443,7 +443,7 @@ FlashErrCode flash_del_env(const char *key){ return FLASH_ENV_NAME_ERR; } del_env_length = strlen(del_env_str); - /* '\0' also must be as environment variable length */ + /* '\0' also must be as ENV length */ del_env_length ++; /* the address must multiple of 4 */ if (del_env_length % 4 != 0) { @@ -461,11 +461,11 @@ FlashErrCode flash_del_env(const char *key){ } /** - * Set an environment variable. If it value is empty, delete it. + * Set an ENV. If it value is empty, delete it. * If not find it in ENV table, then create it. * - * @param key environment variable name - * @param value environment variable value + * @param key ENV name + * @param value ENV value * * @return result */ @@ -478,7 +478,7 @@ FlashErrCode flash_set_env(const char *key, const char *value) { if (*value == NULL) { result = flash_del_env(key); } else { - /* if find this variables, then delete it and recreate it */ + /* if find this ENV, then delete it and recreate it */ if (find_env(key)) { result = flash_del_env(key); } @@ -490,9 +490,9 @@ FlashErrCode flash_set_env(const char *key, const char *value) { } /** - * Get an environment variable value by key name. + * Get an ENV value by key name. * - * @param key environment variable name + * @param key ENV name * * @return value */ @@ -537,7 +537,7 @@ void flash_print_env(void) { } } } - flash_print("\nEnvironment variables size: %ld/%ld bytes, write bytes %ld/%ld, mode: wear leveling.\n", + flash_print("\nENV size: %ld/%ld bytes, write bytes %ld/%ld, mode: wear leveling.\n", get_env_user_used_size(), get_env_user_size(), flash_get_env_write_bytes(), flash_get_env_total_size()); } @@ -585,7 +585,7 @@ void flash_load_env(void) { /* if ENV CRC32 check is fault, set default for it */ if (!env_crc_is_ok()) { - FLASH_INFO("Warning: Environment variables CRC check failed. Set it to default.\n"); + FLASH_INFO("Warning: ENV CRC check failed. Set it to default.\n"); flash_env_set_default(); } }