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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
162 changed files with 1493 additions and 3530 deletions

View file

@ -39,8 +39,12 @@
#include "game/game.h"
#endif
#define MACHINE_CAN_STOP (EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL))
#define MACHINE_CAN_PAUSE (ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE))
#if EITHER(SDSUPPORT, HOST_PROMPT_SUPPORT) || defined(ACTION_ON_CANCEL)
#define MACHINE_CAN_STOP 1
#endif
#if ANY(SDSUPPORT, HOST_PROMPT_SUPPORT, PARK_HEAD_ON_PAUSE) || defined(ACTION_ON_PAUSE)
#define MACHINE_CAN_PAUSE 1
#endif
#if ENABLED(PRUSA_MMU2)
#include "../../lcd/menu/menu_mmu2.h"
@ -140,9 +144,8 @@ void menu_main() {
#endif // !HAS_ENCODER_WHEEL && SDSUPPORT
#if MACHINE_CAN_PAUSE
if (printingIsPaused()) ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print);
#endif
if (TERN0(MACHINE_CAN_PAUSE, printingIsPaused()))
ACTION_ITEM(MSG_RESUME_PRINT, ui.resume_print);
SUBMENU(MSG_MOTION, menu_motion);
}
@ -236,9 +239,7 @@ void menu_main() {
#if HAS_SERVICE_INTERVALS
static auto _service_reset = [](const int index) {
print_job_timer.resetServiceInterval(index);
#if HAS_BUZZER
ui.completion_feedback();
#endif
TERN_(HAS_BUZZER, ui.completion_feedback());
ui.reset_status();
ui.return_to_status();
};