Skip to content

Commit 13f2ae4

Browse files
committed
Attempt to avoid race conditions writing to eeprom.
1 parent 3422401 commit 13f2ae4

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

Marlin/GuiManager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,6 @@ void lcd_emergency_stop()
526526
if (eeprom::StorageManager::getEmergency() == eeprom::EMERGENCY_STOP_INACTIVE)
527527
{
528528
SERIAL_ECHOLN("KILLED: Requested Emergency Stop!");
529-
eeprom::StorageManager::setEmergency();
530529
stop_buffer = true;
531530
stop_buffer_code = 999;
532531

@@ -546,6 +545,7 @@ void lcd_emergency_stop()
546545

547546
cancel_heatup = true;
548547
action_cooldown();
548+
eeprom::StorageManager::setEmergency();
549549
}
550550
else
551551
{

Marlin/Marlin.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ void calculate_delta(float cartesian[3]);
221221
void calculate_SCARA_forward_Transform(float f_scara[3]);
222222
#endif
223223
extern void RESET(void);
224-
void reset(void) __attribute__((naked)) __attribute__((section(".init3")));
224+
void wdt_init(void) __attribute__((naked)) __attribute__((section(".init3")));
225225
void prepare_move();
226226
void kill();
227227
void Stop();

Marlin/Marlin_main.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4877,10 +4877,10 @@ void RESET()
48774877

48784878
SERIAL_ECHOLN("RESET: Wait for watchdog reset");
48794879
wdt_enable(WDTO_15MS);
4880-
while (1) {};
4880+
while (1);
48814881
}
48824882

4883-
void reset(void)
4883+
void wdt_init(void)
48844884
{
48854885
cli();
48864886
// Note that for newer devices (any AVR that has the option to also
@@ -4890,6 +4890,7 @@ void reset(void)
48904890
// to turn off the watchdog early during program startup.
48914891
MCUSR = 0; // clear reset flags
48924892
wdt_disable();
4893+
return;
48934894
}
48944895

48954896
void set_relative_mode(bool value){

0 commit comments

Comments
 (0)