From 3e8f9ecd1c5845f40a9c7ccc16bea92e70cc1c11 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 8 Aug 2016 22:21:01 -0700 Subject: [PATCH] Extend min/max_temp_error for the bed --- Marlin/temperature.cpp | 24 ++++++++++++++++-------- Marlin/temperature.h | 4 ++-- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 13a70bb85b..cf78ad1aa6 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -517,17 +517,25 @@ void Temperature::_temp_error(int e, const char* serial_msg, const char* lcd_msg #endif } -void Temperature::max_temp_error(uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); +void Temperature::max_temp_error(int8_t e) { + #if HAS_TEMP_BED + _temp_error(e, PSTR(MSG_T_MAXTEMP), e >= 0 ? PSTR(MSG_ERR_MAXTEMP) : PSTR(MSG_ERR_MAXTEMP_BED)); + #else + _temp_error(HOTEND_INDEX, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP)); + #if HOTENDS == 1 + UNUSED(e); + #endif #endif - _temp_error(HOTEND_INDEX, PSTR(MSG_T_MAXTEMP), PSTR(MSG_ERR_MAXTEMP)); } -void Temperature::min_temp_error(uint8_t e) { - #if HOTENDS == 1 - UNUSED(e); +void Temperature::min_temp_error(int8_t e) { + #if HAS_TEMP_BED + _temp_error(e, PSTR(MSG_T_MINTEMP), e >= 0 ? PSTR(MSG_ERR_MINTEMP) : PSTR(MSG_ERR_MINTEMP_BED)); + #else + _temp_error(HOTEND_INDEX, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP)); + #if HOTENDS == 1 + UNUSED(e); + #endif #endif - _temp_error(HOTEND_INDEX, PSTR(MSG_T_MINTEMP), PSTR(MSG_ERR_MINTEMP)); } float Temperature::get_pid_output(int e) { diff --git a/Marlin/temperature.h b/Marlin/temperature.h index ffb47a59fe..a66014ac47 100644 --- a/Marlin/temperature.h +++ b/Marlin/temperature.h @@ -437,8 +437,8 @@ class Temperature { #endif static void _temp_error(int e, const char* serial_msg, const char* lcd_msg); - static void min_temp_error(uint8_t e); - static void max_temp_error(uint8_t e); + static void min_temp_error(int8_t e); + static void max_temp_error(int8_t e); #if ENABLED(THERMAL_PROTECTION_HOTENDS) || HAS_THERMALLY_PROTECTED_BED