Apply ternary macros

This commit is contained in:
Scott Lahteine
2020-04-25 17:53:06 -05:00
parent 967c1d8534
commit c536b8de62
13 changed files with 79 additions and 230 deletions

View File

@@ -45,6 +45,10 @@
#define HAS_SLOW_BUTTONS 1
#endif
#if E_MANUAL > 1
#define MULTI_MANUAL 1
#endif
#if HAS_SPI_LCD
#include "../MarlinCore.h"
@@ -491,15 +495,9 @@ public:
static void save_previous_screen();
// goto_previous_screen and go_back may also be used as menu item callbacks
#if ENABLED(TURBO_BACK_MENU_ITEM)
static void _goto_previous_screen(const bool is_back);
static inline void goto_previous_screen() { _goto_previous_screen(false); }
static inline void go_back() { _goto_previous_screen(true); }
#else
static void _goto_previous_screen();
FORCE_INLINE static void goto_previous_screen() { _goto_previous_screen(); }
FORCE_INLINE static void go_back() { _goto_previous_screen(); }
#endif
static void _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, const bool is_back));
static inline void goto_previous_screen() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, false)); }
static inline void go_back() { _goto_previous_screen(TERN_(TURBO_BACK_MENU_ITEM, true)); }
static void return_to_status();
static inline bool on_status_screen() { return currentScreen == status_screen; }
@@ -510,11 +508,7 @@ public:
#endif
FORCE_INLINE static void defer_status_screen(const bool defer=true) {
#if LCD_TIMEOUT_TO_STATUS
defer_return_to_status = defer;
#else
UNUSED(defer);
#endif
TERN(LCD_TIMEOUT_TO_STATUS, defer_return_to_status = defer, UNUSED(defer));
}
static inline void goto_previous_screen_no_defer() {
@@ -582,11 +576,7 @@ public:
static uint32_t encoderPosition;
#if ENABLED(REVERSE_ENCODER_DIRECTION)
#define ENCODERBASE -1
#else
#define ENCODERBASE +1
#endif
#define ENCODERBASE (TERN(REVERSE_ENCODER_DIRECTION, -1, +1))
#if EITHER(REVERSE_MENU_DIRECTION, REVERSE_SELECT_DIRECTION)
static int8_t encoderDirection;