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

@ -127,9 +127,7 @@ void GCodeQueue::_commit_command(bool say_ok
#if NUM_SERIAL > 1
port[index_w] = p;
#endif
#if ENABLED(POWER_LOSS_RECOVERY)
recovery.commit_sdpos(index_w);
#endif
TERN_(POWER_LOSS_RECOVERY, recovery.commit_sdpos(index_w));
if (++index_w >= BUFSIZE) index_w = 0;
length++;
}
@ -522,9 +520,7 @@ void GCodeQueue::get_serial_commands() {
// Process critical commands early
if (strcmp(command, "M108") == 0) {
wait_for_heatup = false;
#if HAS_LCD_MENU
wait_for_user = false;
#endif
TERN_(HAS_LCD_MENU, wait_for_user = false);
}
if (strcmp(command, "M112") == 0) kill(M112_KILL_STR, nullptr, true);
if (strcmp(command, "M410") == 0) quickstop_stepper();
@ -601,9 +597,7 @@ void GCodeQueue::get_available_commands() {
get_serial_commands();
#if ENABLED(SDSUPPORT)
get_sdcard_commands();
#endif
TERN_(SDSUPPORT, get_sdcard_commands());
}
/**