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

@ -87,9 +87,7 @@ void GcodeSuite::M104() {
#endif
}
#if ENABLED(AUTOTEMP)
planner.autotemp_M104_M109();
#endif
TERN_(AUTOTEMP, planner.autotemp_M104_M109());
}
/**
@ -139,9 +137,7 @@ void GcodeSuite::M109() {
#endif
}
#if ENABLED(AUTOTEMP)
planner.autotemp_M104_M109();
#endif
TERN_(AUTOTEMP, planner.autotemp_M104_M109());
if (set_temp)
(void)thermalManager.wait_for_hotend(target_extruder, no_wait_for_cooling);

View File

@ -76,9 +76,7 @@ void GcodeSuite::M190() {
const bool no_wait_for_cooling = parser.seenval('S');
if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetBed(parser.value_celsius());
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
thermalManager.check_timer_autostart(true, false);
#endif
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false));
}
else return;

View File

@ -75,9 +75,7 @@ void GcodeSuite::M191() {
const bool no_wait_for_cooling = parser.seenval('S');
if (no_wait_for_cooling || parser.seenval('R')) {
thermalManager.setTargetChamber(parser.value_celsius());
#if ENABLED(PRINTJOB_TIMER_AUTOSTART)
thermalManager.check_timer_autostart(true, false);
#endif
TERN_(PRINTJOB_TIMER_AUTOSTART, thermalManager.check_timer_autostart(true, false));
}
else return;

View File

@ -72,9 +72,7 @@ void GcodeSuite::M303() {
const heater_ind_t e = (heater_ind_t)parser.intval('E');
if (!WITHIN(e, SI, EI)) {
SERIAL_ECHOLNPGM(STR_PID_BAD_EXTRUDER_NUM);
#if ENABLED(EXTENSIBLE_UI)
ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM);
#endif
TERN_(EXTENSIBLE_UI, ExtUI::onPidTuning(ExtUI::result_t::PID_BAD_EXTRUDER_NUM));
return;
}