Apply TERN to compact code (#17619)

This commit is contained in:
Scott Lahteine
2020-04-22 16:35:03 -05:00
committed by GitHub
parent 88bdd26c99
commit 6d90d1e1f5
162 changed files with 1493 additions and 3530 deletions

View File

@@ -113,9 +113,7 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
#endif
LOOP_S_L_N(n, 1, HOTENDS) PREHEAT_ITEMS(1,n);
ACTION_ITEM(MSG_PREHEAT_1_ALL, []() {
#if HAS_HEATED_BED
_preheat_bed(0);
#endif
TERN_(HAS_HEATED_BED, _preheat_bed(0));
HOTEND_LOOP() thermalManager.setTargetHotend(ui.preheat_hotend_temp[0], e);
});
#endif // HAS_MULTI_HOTEND
@@ -141,9 +139,7 @@ void _lcd_preheat(const int16_t endnum, const int16_t temph, const int16_t tempb
#endif
LOOP_S_L_N(n, 1, HOTENDS) PREHEAT_ITEMS(2,n);
ACTION_ITEM(MSG_PREHEAT_2_ALL, []() {
#if HAS_HEATED_BED
_preheat_bed(1);
#endif
TERN_(HAS_HEATED_BED, _preheat_bed(1));
HOTEND_LOOP() thermalManager.setTargetHotend(ui.preheat_hotend_temp[1], e);
});
#endif // HAS_MULTI_HOTEND
@@ -284,9 +280,7 @@ void menu_temperature() {
//
bool has_heat = false;
HOTEND_LOOP() if (thermalManager.temp_hotend[HOTEND_INDEX].target) { has_heat = true; break; }
#if HAS_HEATED_BED
if (thermalManager.temp_bed.target) has_heat = true;
#endif
if (TERN0(HAS_HEATED_BED, thermalManager.temp_bed.target)) has_heat = true;
if (has_heat) ACTION_ITEM(MSG_COOLDOWN, lcd_cooldown);
#endif // HAS_TEMP_HOTEND