🚸 Clear "heating/cooling" message on temp reached

This commit is contained in:
Scott Lahteine
2022-03-25 17:35:00 -05:00
committed by Scott Lahteine
parent 9324132a40
commit 0e693854d0
6 changed files with 29 additions and 4 deletions

View File

@ -3631,7 +3631,7 @@ void Temperature::isr() {
#endif
#if HAS_HOTEND && HAS_STATUS_MESSAGE
void Temperature::set_heating_message(const uint8_t e) {
void Temperature::set_heating_message(const uint8_t e, const bool isM104/*=false*/) {
const bool heating = isHeatingHotend(e);
ui.status_printf(0,
#if HAS_MULTI_HOTEND
@ -3641,6 +3641,14 @@ void Temperature::isr() {
#endif
, heating ? GET_TEXT(MSG_HEATING) : GET_TEXT(MSG_COOLING)
);
if (isM104) {
static uint8_t wait_e; wait_e = e;
ui.set_status_reset_fn([]{
const celsius_t c = degTargetHotend(wait_e);
return c < 30 || degHotendNear(wait_e, c);
});
}
}
#endif

View File

@ -961,9 +961,9 @@ class Temperature {
#endif
#if HAS_HOTEND && HAS_STATUS_MESSAGE
static void set_heating_message(const uint8_t e);
static void set_heating_message(const uint8_t e, const bool isM104=false);
#else
static void set_heating_message(const uint8_t) {}
static void set_heating_message(const uint8_t, const bool=false) {}
#endif
#if HAS_MARLINUI_MENU && HAS_TEMPERATURE