Fix kill() and ExtensibleUI (#12160)

* Fix to isPrintingFromMedia()

  - isPrintingFromMedia() will now return true even if SD print is paused.
  - isPrintingFromMediaPaused() allows UI to determine if the print is paused.

* Don't use _delay_us in minkill (#12145)

  - In HAL_DUE, _delay_us is simply an alias for delay, which causes the board to hang and subsequently reboot due to the watchdog timer.

* Shorten code with IFSD macro
This commit is contained in:
Marcio Teixeira
2018-10-20 00:44:46 -06:00
committed by Scott Lahteine
parent b381cad399
commit 2e5e689a7f
3 changed files with 27 additions and 54 deletions

View File

@ -42,6 +42,8 @@
#include "module/printcounter.h" // PrintCounter or Stopwatch
#include "feature/closedloop.h"
#include "HAL/shared/Delay.h"
#ifdef ARDUINO
#include <pins_arduino.h>
#endif
@ -610,7 +612,6 @@ void idle(
* After this the machine will need to be reset.
*/
void kill(PGM_P const lcd_msg/*=NULL*/) {
thermalManager.disable_all_heaters();
SERIAL_ERROR_START();
@ -633,11 +634,14 @@ void kill(PGM_P const lcd_msg/*=NULL*/) {
void minkill() {
_delay_ms(600); // Wait a short time (allows messages to get out before shutting down.
cli(); // Stop interrupts
_delay_ms(250); // Wait to ensure all interrupts stopped
// Wait a short time (allows messages to get out before shutting down.
DELAY_US(600000);
cli(); // Stop interrupts
// Wait to ensure all interrupts stopped
DELAY_US(250000);
disable_all_steppers();
thermalManager.disable_all_heaters(); // turn off heaters again
#if HAS_POWER_SWITCH