From 353241037551ba51ccefb7650cd6c47f679f1463 Mon Sep 17 00:00:00 2001 From: xixi Date: Wed, 4 Sep 2019 15:06:07 +0800 Subject: [PATCH] =?UTF-8?q?=E9=92=88=E5=AF=B9ENV=E6=B7=BB=E5=8A=A0?= =?UTF-8?q?=E5=A4=A7=E5=B0=8F=E7=AB=AFMCU=E7=9A=84=E9=80=82=E9=85=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- easyflash/inc/ef_cfg.h | 2 +- easyflash/src/ef_env.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/easyflash/inc/ef_cfg.h b/easyflash/inc/ef_cfg.h index 9c7630d..52d3e11 100644 --- a/easyflash/inc/ef_cfg.h +++ b/easyflash/inc/ef_cfg.h @@ -41,7 +41,7 @@ */ #define EF_ENV_VER_NUM /* @note you must define it for a value, such as 0 */ -#define LITTLE_ENDIAN 1 /* @note you must define it reference to MCU Order*/ +#define EF_LITTLE_ENDIAN 1 /* @note you must define it reference to MCU Order*/ #endif /* EF_USING_ENV */ diff --git a/easyflash/src/ef_env.c b/easyflash/src/ef_env.c index 5af90b2..6777244 100644 --- a/easyflash/src/ef_env.c +++ b/easyflash/src/ef_env.c @@ -495,7 +495,7 @@ static uint32_t find_next_env_addr(uint32_t start, uint32_t end) for (; start < end; start += (sizeof(buf) - sizeof(uint32_t))) { ef_port_read(start, (uint32_t *) buf, sizeof(buf)); for (i = 0; i < sizeof(buf) - sizeof(uint32_t) && start + i < end; i++) { -#if LITTLE_ENDIAN // Little Endian Order +#if EF_LITTLE_ENDIAN // Little Endian Order magic = buf[i] + (buf[i + 1] << 8) + (buf[i + 2] << 16) + (buf[i + 3] << 24); #else // Big Endian Order magic = buf[i + 3] + (buf[i + 2] << 8) + (buf[i + 1] << 16) + (buf[i] << 24);