Skip to content

Commit

Permalink
Fix reset at start and no EEPROM settings loaded
Browse files Browse the repository at this point in the history
Fix reset at start due to watchdog and no EEPROM settings loaded due to
Virtual EEPROM loaded too early
  • Loading branch information
Luc committed Nov 26, 2014
1 parent 65bcdd8 commit fac4a5e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions src/ArduinoDUE/Repetier/HAL.h
Expand Up @@ -287,6 +287,9 @@ class HAL
TC_Configure(DELAY_TIMER, DELAY_TIMER_CHANNEL, TC_CMR_WAVSEL_UP |
TC_CMR_WAVE | DELAY_TIMER_CLOCK);
TC_Start(DELAY_TIMER, DELAY_TIMER_CHANNEL);
}
static inline void loadVirtualEEPROM(void)
{
#if EEPROM_AVAILABLE && EEPROM_MODE != 0
// Copy eeprom to ram for faster access
int i,n = EEPROM_BYTES;
Expand Down
7 changes: 4 additions & 3 deletions src/ArduinoDUE/Repetier/Printer.cpp
Expand Up @@ -923,6 +923,7 @@ SET_INPUT(FIL_SENSOR2_PIN);
#endif
sd.initsd();
#endif
HAL::loadVirtualEEPROM();
// sets autoleveling in eeprom init
EEPROM::init(); // Read settings from eeprom if wanted
for(uint8_t i=0; i<E_AXIS_ARRAY; i++) {
Expand All @@ -948,13 +949,13 @@ SET_INPUT(FIL_SENSOR2_PIN);
#if SDSUPPORT
sd.autoPrint();
#endif
#if FEATURE_WATCHDOG
HAL::startWatchdog();
#endif // FEATURE_WATCHDOG
playsound(880,100);
playsound(1479,150);
playsound(1174,100);
playsound(2349,150);
#if FEATURE_WATCHDOG
HAL::startWatchdog();
#endif // FEATURE_WATCHDOG
}

void Printer::defaultLoopActions()
Expand Down

0 comments on commit fac4a5e

Please sign in to comment.