Skip to content

Commit

Permalink
EEPROM_CLEAR option for config.h
Browse files Browse the repository at this point in the history
enables EEPROM_clear without loading specific sketch
  • Loading branch information
ShikOfTheRa committed Aug 10, 2015
1 parent 9cef66f commit 4988080
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 5 deletions.
5 changes: 4 additions & 1 deletion MW_OSD/Config.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
/*-------------------------- configurable parameters ----------------------------------------------------*/
/*-------------------------- initialisation options ----------------------------------------------------*/
//#define EEPROM_CLEAR // Uncomment to force a wipe and reload of default settings at each OSD start. Same as EEPROM_CLEAR sketch. Recomment/upload once completed.


/*-------------------------- configurable parameters ----------------------------------------------------*/

/******************** OSD HARDWARE settings *********************/
//Choose ONLY ONE option:
Expand Down
10 changes: 9 additions & 1 deletion MW_OSD/MW_OSD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,9 @@ void setup()
#endif
pinMode(LEDPIN,OUTPUT);

// EEPROM.write(0,0); //;test
#if defined EEPROM_CLEAR
EEPROM_clear();
#endif
checkEEPROM();
readEEPROM();

Expand Down Expand Up @@ -983,3 +985,9 @@ ISR(PCINT1_vect) { //
}
#endif

void EEPROM_clear(){
for (int i = 0; i < 512; i++)
EEPROM.write(i, 0);
}


5 changes: 2 additions & 3 deletions MW_OSD/Serial.ino
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,8 @@ void serialMSPCheck()
}
}
if(cmd == OSD_DEFAULT) {
for (int i = 0; i < 512; i++)
EEPROM.write(i, 0);
checkEEPROM();
EEPROM_clear();
// checkEEPROM();
flags.reset=1;
}
if(cmd == OSD_RESET) {
Expand Down

0 comments on commit 4988080

Please sign in to comment.