@@ -294,7 +294,7 @@ uint8_t newFanSpeed = 0;
294
294
bool powersupply = true ;
295
295
#endif
296
296
297
- bool cancel_heatup = false ;
297
+ bool cancel_heatup = false ;
298
298
299
299
int8_t busy_state = NOT_BUSY;
300
300
static long prev_busy_signal_ms = -1 ;
@@ -1011,7 +1011,8 @@ static void fw_crash_init()
1011
1011
eeprom_read_byte ((uint8_t *)EEPROM_FW_CRASH_FLAG) != 0xFF )
1012
1012
{
1013
1013
lcd_show_fullscreen_message_and_wait_P (
1014
- _i (" FIRMWARE CRASH!\n "
1014
+ _i (" FW crash detected! "
1015
+ " You can continue printing. "
1015
1016
" Debug data available for analysis. "
1016
1017
" Contact support to submit details." ));
1017
1018
}
@@ -6751,7 +6752,7 @@ SERIAL_PROTOCOLPGM("\n\n");
6751
6752
target_direction = isHeatingBed (); // true if heating, false if cooling
6752
6753
6753
6754
KEEPALIVE_STATE (NOT_BUSY);
6754
- while ( (target_direction)&&(!cancel_heatup) ? (isHeatingBed ()) : (isCoolingBed ()&&(CooldownNoWait==false )) )
6755
+ while ( (!cancel_heatup) && (target_direction ? (isHeatingBed ()) : (isCoolingBed ()&&(CooldownNoWait==false ) )) )
6755
6756
{
6756
6757
if (( _millis () - codenum) > 1000 ) // Print Temp Reading every 1 second while heating up.
6757
6758
{
@@ -8625,7 +8626,7 @@ SERIAL_PROTOCOLPGM("\n\n");
8625
8626
*/
8626
8627
case 910 :
8627
8628
{
8628
- tmc2130_init ();
8629
+ tmc2130_init (TMCInitParams ( false , FarmOrUserECool ()) );
8629
8630
}
8630
8631
break ;
8631
8632
@@ -8692,7 +8693,7 @@ SERIAL_PROTOCOLPGM("\n\n");
8692
8693
{
8693
8694
tmc2130_mode = TMC2130_MODE_NORMAL;
8694
8695
update_mode_profile ();
8695
- tmc2130_init ();
8696
+ tmc2130_init (TMCInitParams ( false , FarmOrUserECool ()) );
8696
8697
}
8697
8698
break ;
8698
8699
@@ -8704,7 +8705,7 @@ SERIAL_PROTOCOLPGM("\n\n");
8704
8705
{
8705
8706
tmc2130_mode = TMC2130_MODE_SILENT;
8706
8707
update_mode_profile ();
8707
- tmc2130_init ();
8708
+ tmc2130_init (TMCInitParams ( false , FarmOrUserECool ()) );
8708
8709
}
8709
8710
break ;
8710
8711
@@ -9329,7 +9330,7 @@ SERIAL_PROTOCOLPGM("\n\n");
9329
9330
9330
9331
#ifdef XFLASH_DUMP
9331
9332
/* !
9332
- ### D20 - Generate an offline crash dump
9333
+ ### D20 - Generate an offline crash dump <a href="https://reprap.org/wiki/G-code#D20:_Generate_an_offline_crash_dump">D20: Generate an offline crash dump</a>
9333
9334
Generate a crash dump for later retrival.
9334
9335
#### Usage
9335
9336
@@ -9348,7 +9349,7 @@ SERIAL_PROTOCOLPGM("\n\n");
9348
9349
};
9349
9350
9350
9351
/* !
9351
- ### D21 - Print crash dump to serial
9352
+ ### D21 - Print crash dump to serial <a href="https://reprap.org/wiki/G-code#D21:_Print_crash_dump_to_serial">D21: Print crash dump to serial</a>
9352
9353
Output the complete crash dump (if present) to the serial.
9353
9354
#### Usage
9354
9355
@@ -9363,7 +9364,7 @@ SERIAL_PROTOCOLPGM("\n\n");
9363
9364
};
9364
9365
9365
9366
/* !
9366
- ### D22 - Clear crash dump state
9367
+ ### D22 - Clear crash dump state <a href="https://reprap.org/wiki/G-code#D22:_Clear_crash_dump_state">D22: Clear crash dump state</a>
9367
9368
Clear an existing internal crash dump.
9368
9369
#### Usage
9369
9370
@@ -9377,7 +9378,7 @@ SERIAL_PROTOCOLPGM("\n\n");
9377
9378
9378
9379
#ifdef EMERGENCY_SERIAL_DUMP
9379
9380
/* !
9380
- ### D23 - Request emergency dump on serial
9381
+ ### D23 - Request emergency dump on serial <a href="https://reprap.org/wiki/G-code#D23:_Request_emergency_dump_on_serial">D23: Request emergency dump on serial</a>
9381
9382
On boards without offline dump support, request online dumps to the serial port on firmware faults.
9382
9383
When online dumps are enabled, the FW will dump memory on the serial before resetting.
9383
9384
#### Usage
@@ -10157,6 +10158,32 @@ void kill(const char *full_screen_message, unsigned char id)
10157
10158
} // Wait for reset
10158
10159
}
10159
10160
10161
+ void UnconditionalStop ()
10162
+ {
10163
+ CRITICAL_SECTION_START;
10164
+
10165
+ // Disable all heaters and unroll the temperature wait loop stack
10166
+ disable_heater ();
10167
+ cancel_heatup = true ;
10168
+
10169
+ // Clear any saved printing state
10170
+ cancel_saved_printing ();
10171
+
10172
+ // Abort the planner
10173
+ planner_abort_hard ();
10174
+
10175
+ // Reset the queue
10176
+ cmdqueue_reset ();
10177
+ cmdqueue_serial_disabled = false ;
10178
+
10179
+ // Reset the sd status
10180
+ card.sdprinting = false ;
10181
+ card.closefile ();
10182
+
10183
+ st_reset_timer ();
10184
+ CRITICAL_SECTION_END;
10185
+ }
10186
+
10160
10187
// Stop: Emergency stop used by overtemp functions which allows recovery
10161
10188
//
10162
10189
// In addition to stopping the print, this prevents subsequent G[0-3] commands to be
@@ -10169,15 +10196,27 @@ void kill(const char *full_screen_message, unsigned char id)
10169
10196
// the addition of disabling the headers) could allow true recovery in the future.
10170
10197
void Stop ()
10171
10198
{
10199
+ // Keep disabling heaters
10172
10200
disable_heater ();
10201
+
10202
+ // Call the regular stop function if that's the first time during a new print
10173
10203
if (Stopped == false ) {
10174
10204
Stopped = true ;
10175
10205
lcd_print_stop ();
10176
10206
Stopped_gcode_LastN = gcode_LastN; // Save last g_code for restart
10207
+
10208
+ // Eventually report the stopped status (though this is usually overridden by a
10209
+ // higher-priority alert status message)
10177
10210
SERIAL_ERROR_START;
10178
10211
SERIAL_ERRORLNRPGM (MSG_ERR_STOPPED);
10179
10212
LCD_MESSAGERPGM (_T (MSG_STOPPED));
10180
10213
}
10214
+
10215
+ // Return to the status screen to stop any pending menu action which could have been
10216
+ // started by the user while stuck in the Stopped state. This also ensures the NEW
10217
+ // error is immediately shown.
10218
+ if (menu_menu != lcd_status_screen)
10219
+ lcd_return_to_status ();
10181
10220
}
10182
10221
10183
10222
bool IsStopped () { return Stopped; };
0 commit comments