mirror of
https://gitee.com/Armink/EasyFlash.git
synced 2024-11-29 18:57:41 +08:00
针对ENV添加大小端MCU的适配
This commit is contained in:
parent
d3182370d7
commit
3532410375
@ -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 */
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user