Subversion Repositories svn.mios32

Compare Revisions

Ignore whitespace Rev 1969 → Rev 1970

/trunk/apps/tutorials/028_osc/presets.c
48,15 → 48,18
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[PRESETS] EEPROM initialisation failed with status %d!\n", status);
#endif
return status;
}
 
// check for magic number in EEPROM - if not available, initialize the structure
if( PRESETS_Read32(PRESETS_ADDR_MAGIC01) != EEPROM_MAGIC_NUMBER ) {
if( status < 0 ||
PRESETS_Read32(PRESETS_ADDR_MAGIC01) != EEPROM_MAGIC_NUMBER ) {
#if DEBUG_VERBOSE_LEVEL >= 1
DEBUG_MSG("[PRESETS] magic number not found - initialize EEPROM!\n");
#endif
 
// enforce EEPROM formatting
EEPROM_Init(1);
 
// clear EEPROM
int addr;
for(addr=0; addr<PRESETS_EEPROM_SIZE; ++addr)