Skip to content

Commit

Permalink
Redundant environment: move flag definitions to header file
Browse files Browse the repository at this point in the history
Instead of defining the flags sevaral times in different source files
(which is error prone), move them to a central place in a header file.

Signed-off-by: Wolfgang Denk <[email protected]>
  • Loading branch information
wdenx committed Jul 4, 2010
1 parent d9c2725 commit b218ccb
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 8 deletions.
5 changes: 0 additions & 5 deletions common/env_eeprom.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@
#include <i2c.h>
#endif

#ifdef CONFIG_ENV_OFFSET_REDUND
#define ACTIVE_FLAG 1
#define OBSOLETE_FLAG 0
#endif

DECLARE_GLOBAL_DATA_PTR;

env_t *env_ptr = NULL;
Expand Down
3 changes: 0 additions & 3 deletions common/env_flash.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,6 @@ static env_t *flash_addr_new = (env_t *)CONFIG_ENV_ADDR_REDUND;
/* CONFIG_ENV_ADDR is supposed to be on sector boundary */
static ulong end_addr = CONFIG_ENV_ADDR + CONFIG_ENV_SECT_SIZE - 1;
static ulong end_addr_new = CONFIG_ENV_ADDR_REDUND + CONFIG_ENV_SECT_SIZE - 1;

#define ACTIVE_FLAG 1
#define OBSOLETE_FLAG 0
#endif /* CONFIG_ENV_ADDR_REDUND */

extern uchar default_environment[];
Expand Down
3 changes: 3 additions & 0 deletions include/environment.h
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,9 @@

#ifdef CONFIG_SYS_REDUNDAND_ENVIRONMENT
# define ENV_HEADER_SIZE (sizeof(uint32_t) + 1)

# define ACTIVE_FLAG 1
# define OBSOLETE_FLAG 0
#else
# define ENV_HEADER_SIZE (sizeof(uint32_t))
#endif
Expand Down

0 comments on commit b218ccb

Please sign in to comment.