From 1c36606886104281e9f37774373c95141d59107b Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Wed, 4 Apr 2018 18:53:37 -0500 Subject: [PATCH] Fix MSG_HEATING_FAILED_LCD_BED macro evaluation --- Marlin/src/module/temperature.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/Marlin/src/module/temperature.cpp b/Marlin/src/module/temperature.cpp index b40ea8f225..e2814d32b9 100644 --- a/Marlin/src/module/temperature.cpp +++ b/Marlin/src/module/temperature.cpp @@ -64,19 +64,22 @@ Temperature thermalManager; * elimination should (hopefully) optimize out the unused strings. */ #if HAS_TEMP_BED - #define _BED_ERR_PSTR(MSG, E) (E) == -1 ? PSTR(MSG ## _BED) : + #define TEMP_ERR_PSTR(MSG, E) \ + (E) == -1 ? PSTR(MSG ## _BED) : \ + (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ + (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ + (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ + (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ + PSTR(MSG_E1 " " MSG) #else - #define _BED_ERR_PSTR(MSG, E) + #define TEMP_ERR_PSTR(MSG, E) \ + (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ + (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ + (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ + (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ + PSTR(MSG_E1 " " MSG) #endif -#define TEMP_ERR_PSTR(MSG, E) \ - _BED_ERR_PSTR(MSG, E) \ - (HOTENDS > 1 && (E) == 1) ? PSTR(MSG_E2 " " MSG) : \ - (HOTENDS > 2 && (E) == 2) ? PSTR(MSG_E3 " " MSG) : \ - (HOTENDS > 3 && (E) == 3) ? PSTR(MSG_E4 " " MSG) : \ - (HOTENDS > 4 && (E) == 4) ? PSTR(MSG_E5 " " MSG) : \ - PSTR(MSG_E1 " " MSG) - // public: float Temperature::current_temperature[HOTENDS] = { 0.0 },