1、【更新】stm32f10x平台Demo使用的EasyFlash库至最新版本。

Signed-off-by: armink <armink.ztl@gmail.com>
pull/3/head
armink 10 years ago
parent 9e9b90627a
commit 0e46904053

@ -51,7 +51,7 @@ extern "C" {
#error "Please configure backup area start address (in ef_cfg.h)" #error "Please configure backup area start address (in ef_cfg.h)"
#endif #endif
#if !defined(EF_USING_ENV) #if !defined(EF_ERASE_MIN_SIZE)
#error "Please configure minimum size of flash erasure (in ef_cfg.h)" #error "Please configure minimum size of flash erasure (in ef_cfg.h)"
#endif #endif
@ -67,7 +67,7 @@ if (!(EXPR)) \
while (1); \ while (1); \
} }
/* EasyFlash software version number */ /* EasyFlash software version number */
#define EF_SW_VERSION "1.07.29" #define EF_SW_VERSION "1.09.12"
typedef struct _eflash_env{ typedef struct _eflash_env{
char *key; char *key;

@ -31,8 +31,8 @@
* This all Backup Area Flash storage index. All used flash area configure is under here. * This all Backup Area Flash storage index. All used flash area configure is under here.
* |----------------------------| Storage Size * |----------------------------| Storage Size
* | Environment variables area | ENV area size @see ENV_AREA_SIZE * | Environment variables area | ENV area size @see ENV_AREA_SIZE
* | 1.system section | ENV_SYSTEM_SIZE * | 1.system section | ENV system section size
* | 2:data section | ENV_AREA_SIZE - ENV_SYSTEM_SIZE * | 2:data section | ENV_AREA_SIZE - ENV system section size
* |----------------------------| * |----------------------------|
* | Saved log area | Log area size @see LOG_AREA_SIZE * | Saved log area | Log area size @see LOG_AREA_SIZE
* |----------------------------| * |----------------------------|

@ -73,7 +73,7 @@ EfErrCode ef_log_init(void) {
* Find the log store start address and end address. * Find the log store start address and end address.
* It's like a ring buffer which implement by flash. * It's like a ring buffer which implement by flash.
* The flash log area has two state when find start address and end address. * The flash log area has two state when find start address and end address.
* state 1 state 2 * state 1 state 2
* |============| |============| * |============| |============|
* log area start--> |############| <-- start address |############| <-- end address * log area start--> |############| <-- start address |############| <-- end address
* |############| | empty | * |############| | empty |

@ -142,11 +142,16 @@ uint32_t ef_find_sec_using_end_addr(uint32_t addr, size_t sec_size) {
} }
/* all sector counts finish */ /* all sector counts finish */
if (continue_ff == sec_size - start) { if (continue_ff == sec_size - start) {
/* must be word alignment */
if (start % 4 != 0) {
start = (start / 4 + 1) * 4;
}
break; break;
} }
} }
} }
} }
/* calculate current flash sector using end address */
if ((start == 0) && (continue_ff == sec_size)) { if ((start == 0) && (continue_ff == sec_size)) {
/* from 0 to sec_size all sector is 0xFF, so the sector is empty */ /* from 0 to sec_size all sector is 0xFF, so the sector is empty */
return addr; return addr;

Loading…
Cancel
Save