1、【增加】C99的stdbool.h,保证项目全部采用C99的bool的类型。

Signed-off-by: armink <armink.ztl@gmail.com>
pull/1/head
armink 11 years ago
parent 965a16c0f7
commit 209929e786

@ -19,7 +19,7 @@
## 2、文件说明
`components\flash\port\flash_port.c` 移植参考文件
`components\easyflash\port\flash_port.c` 移植参考文件
`RVMDK` 下为Keil工程文件

@ -24,7 +24,13 @@
#ifndef FLASH_H_
#define FLASH_H_
#include "types.h"
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#ifndef NULL
#define NULL 0
#endif
/* using ENV function */
#define FLASH_USING_ENV
@ -36,7 +42,7 @@
#define FLASH_USER_SETTING_ENV_SIZE (2 * 1024) /* default 2K */
/* using wear leveling mode or normal mode */
/* #define FLASH_ENV_USING_WEAR_LEVELING_MODE */
#define FLASH_ENV_USING_NORMAL_MODE
#define FLASH_ENV_USING_NORMAL_MODE */
/* Flash debug print function. Must be implement by user. */
#define FLASH_DEBUG(...) flash_log_debug(__FILE__, __LINE__, __VA_ARGS__)
@ -50,7 +56,7 @@ if (!(EXPR)) \
while (1); \
}
/* EasyFlash software version number */
#define FLASH_SW_VERSION "1.04.23"
#define FLASH_SW_VERSION "1.05.16"
typedef struct _flash_env{
char *key;

@ -75,7 +75,7 @@ static FlashErrCode create_env(const char *key, const char *value);
#ifdef FLASH_ENV_USING_CRC_CHECK
static uint32_t calc_env_crc(void);
static bool_t env_crc_is_ok(void);
static bool env_crc_is_ok(void);
#endif
/**
@ -561,12 +561,12 @@ static uint32_t calc_env_crc(void) {
*
* @return true is ok
*/
static bool_t env_crc_is_ok(void) {
static bool env_crc_is_ok(void) {
if (calc_env_crc() == env_cache[ENV_PARAM_INDEX_DATA_CRC]) {
FLASH_DEBUG("Verify Env CRC32 result is OK.\n");
return TRUE;
return true;
} else {
return FALSE;
return false;
}
}
#endif

@ -92,7 +92,7 @@ static FlashErrCode save_cur_using_data_addr(uint32_t cur_data_addr);
#ifdef FLASH_ENV_USING_CRC_CHECK
static uint32_t calc_env_crc(void);
static bool_t env_crc_is_ok(void);
static bool env_crc_is_ok(void);
#endif
/**
@ -668,12 +668,12 @@ static uint32_t calc_env_crc(void) {
*
* @return true is ok
*/
static bool_t env_crc_is_ok(void) {
static bool env_crc_is_ok(void) {
if (calc_env_crc() == env_cache[ENV_PARAM_PART_INDEX_DATA_CRC]) {
FLASH_DEBUG("Verify Env CRC32 result is OK.\n");
return TRUE;
return true;
} else {
return FALSE;
return false;
}
}
#endif

Loading…
Cancel
Save