Unify M600 and M125 pause features (#6407)

* Unify M600 and M125 pause features
* Cleanup per thinkyhead's comments
* Rename filament_change_menu_response to advanced_pause_menu_response
* Include HAS_BED_PROBE in QUIET_PROBING
* Update gMax example file
* is_idle() is out of scope without the braces
* Convert FT-i3-2020 to Advance Pause names...
* Allow pause even if not printing
This commit is contained in:
Thomas Moore
2017-05-26 13:01:02 -05:00
committed by Roxy-3D
parent 73ed0c63b4
commit fb5e0ffe16
54 changed files with 1092 additions and 847 deletions

View File

@ -257,10 +257,14 @@ class Temperature {
#if ENABLED(PROBING_HEATERS_OFF)
static bool paused;
static int16_t paused_hotend_temp[HOTENDS];
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
static millis_t heater_idle_timeout_ms[HOTENDS];
static bool heater_idle_timeout_exceeded[HOTENDS];
#if HAS_TEMP_BED
static int16_t paused_bed_temp;
static millis_t bed_idle_timeout_ms;
static bool bed_idle_timeout_exceeded;
#endif
#endif
@ -458,6 +462,54 @@ class Temperature {
#if ENABLED(PROBING_HEATERS_OFF)
static void pause(const bool p);
static bool is_paused() { return paused; }
#endif
#if ENABLED(ADVANCED_PAUSE_FEATURE)
static void start_heater_idle_timer(uint8_t e, millis_t timeout_ms) {
#if HOTENDS == 1
UNUSED(e);
#endif
heater_idle_timeout_ms[HOTEND_INDEX] = millis() + timeout_ms;
heater_idle_timeout_exceeded[HOTEND_INDEX] = false;
}
static void reset_heater_idle_timer(uint8_t e) {
#if HOTENDS == 1
UNUSED(e);
#endif
heater_idle_timeout_ms[HOTEND_INDEX] = 0;
heater_idle_timeout_exceeded[HOTEND_INDEX] = false;
#if WATCH_HOTENDS
start_watching_heater(HOTEND_INDEX);
#endif
}
static bool is_heater_idle(uint8_t e) {
#if HOTENDS == 1
UNUSED(e);
#endif
return heater_idle_timeout_exceeded[HOTEND_INDEX];
}
#if HAS_TEMP_BED
static void start_bed_idle_timer(millis_t timeout_ms) {
bed_idle_timeout_ms = millis() + timeout_ms;
bed_idle_timeout_exceeded = false;
}
static void reset_bed_idle_timer() {
bed_idle_timeout_ms = 0;
bed_idle_timeout_exceeded = false;
#if WATCH_THE_BED
start_watching_bed();
#endif
}
static bool is_bed_idle() {
return bed_idle_timeout_exceeded;
}
#endif
#endif
private: