mirror of
https://github.com/armink/EasyLogger.git
synced 2025-02-01 05:52:52 +08:00
1、【更新】stm32f10x平台Demo使用的EasyFlash库至最新版本。
Signed-off-by: armink <armink.ztl@gmail.com>
This commit is contained in:
parent
9e9b90627a
commit
0e46904053
@ -51,7 +51,7 @@ extern "C" {
|
||||
#error "Please configure backup area start address (in ef_cfg.h)"
|
||||
#endif
|
||||
|
||||
#if !defined(EF_USING_ENV)
|
||||
#if !defined(EF_ERASE_MIN_SIZE)
|
||||
#error "Please configure minimum size of flash erasure (in ef_cfg.h)"
|
||||
#endif
|
||||
|
||||
@ -67,7 +67,7 @@ if (!(EXPR)) \
|
||||
while (1); \
|
||||
}
|
||||
/* EasyFlash software version number */
|
||||
#define EF_SW_VERSION "1.07.29"
|
||||
#define EF_SW_VERSION "1.09.12"
|
||||
|
||||
typedef struct _eflash_env{
|
||||
char *key;
|
||||
|
@ -31,8 +31,8 @@
|
||||
* This all Backup Area Flash storage index. All used flash area configure is under here.
|
||||
* |----------------------------| Storage Size
|
||||
* | Environment variables area | ENV area size @see ENV_AREA_SIZE
|
||||
* | 1.system section | ENV_SYSTEM_SIZE
|
||||
* | 2:data section | ENV_AREA_SIZE - ENV_SYSTEM_SIZE
|
||||
* | 1.system section | ENV system section size
|
||||
* | 2:data section | ENV_AREA_SIZE - ENV system section 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.
|
||||
* It's like a ring buffer which implement by flash.
|
||||
* 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
|
||||
* |############| | empty |
|
||||
|
@ -142,11 +142,16 @@ uint32_t ef_find_sec_using_end_addr(uint32_t addr, size_t sec_size) {
|
||||
}
|
||||
/* all sector counts finish */
|
||||
if (continue_ff == sec_size - start) {
|
||||
/* must be word alignment */
|
||||
if (start % 4 != 0) {
|
||||
start = (start / 4 + 1) * 4;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
/* calculate current flash sector using end address */
|
||||
if ((start == 0) && (continue_ff == sec_size)) {
|
||||
/* from 0 to sec_size all sector is 0xFF, so the sector is empty */
|
||||
return addr;
|
||||
|
Loading…
x
Reference in New Issue
Block a user