Add HOST_PROMPT_SUPPORT (#13039)

This commit is contained in:
InsanityAutomation
2019-02-12 16:55:47 -05:00
committed by Scott Lahteine
parent 0feeef2604
commit 7f1b69b0c8
189 changed files with 2076 additions and 3479 deletions

View File

@@ -36,12 +36,21 @@
#include "../lcd/extensible_ui/ui_api.h"
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
#include "pause.h"
#endif
//#define FILAMENT_RUNOUT_SENSOR_DEBUG
class FilamentMonitorBase {
public:
static bool enabled;
static bool filament_ran_out;
static bool enabled, filament_ran_out;
#if ENABLED(HOST_ACTION_COMMANDS)
static bool host_handling;
#else
constexpr static bool host_handling = false;
#endif
};
template<class RESPONSE_T, class SENSOR_T>
@@ -80,7 +89,7 @@ class TFilamentMonitor : public FilamentMonitorBase {
// Give the response a chance to update its counter.
static inline void run() {
if (enabled && !filament_ran_out && (IS_SD_PRINTING() || print_job_timer.isRunning())) {
if (enabled && !filament_ran_out && (IS_SD_PRINTING() || print_job_timer.isRunning() || did_pause_print)) {
#if FILAMENT_RUNOUT_DISTANCE_MM > 0
cli(); // Prevent RunoutResponseDelayed::block_completed from accumulating here
#endif
@@ -92,24 +101,7 @@ class TFilamentMonitor : public FilamentMonitorBase {
#endif
if (ran_out) {
filament_ran_out = true;
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onFilamentRunout(ExtUI::getActiveTool());
#endif
#ifdef ACTION_ON_FILAMENT_RUNOUT
#if NUM_RUNOUT_SENSORS > 1
host_action_filament_runout(false);
SERIAL_CHAR(' ');
SERIAL_ECHOLN(int(active_extruder));
#else
host_action_filament_runout();
#endif
if (!IS_SD_PRINTING())
reset();
else
#endif
{
enqueue_and_echo_commands_P(PSTR(FILAMENT_RUNOUT_SCRIPT));
}
event_filament_runout();
planner.synchronize();
}
}
@@ -317,7 +309,11 @@ class FilamentSensorBase {
}
static inline void block_completed(const block_t* const b) {
if (b->steps[X_AXIS] || b->steps[Y_AXIS] || b->steps[Z_AXIS]) {
if (b->steps[X_AXIS] || b->steps[Y_AXIS] || b->steps[Z_AXIS]
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|| did_pause_print // Allow pause purge move to re-trigger runout state
#endif
) {
// Only trigger on extrusion with XYZ movement to allow filament change and retract/recover.
const uint8_t e = b->extruder;
const int32_t steps = b->steps[E_AXIS];