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

@@ -227,9 +227,7 @@ bool MarlinUI::detected() { return true; }
}
void MarlinUI::show_bootscreen() {
#if ENABLED(SHOW_CUSTOM_BOOTSCREEN)
show_custom_bootscreen();
#endif
TERN_(SHOW_CUSTOM_BOOTSCREEN, show_custom_bootscreen());
show_marlin_bootscreen();
}
@@ -267,17 +265,11 @@ void MarlinUI::init_lcd() {
WRITE(LCD_BACKLIGHT_PIN, HIGH);
#endif
#if HAS_LCD_CONTRAST
refresh_contrast();
#endif
TERN_(HAS_LCD_CONTRAST, refresh_contrast());
#if ENABLED(LCD_SCREEN_ROT_90)
u8g.setRot90();
#elif ENABLED(LCD_SCREEN_ROT_180)
u8g.setRot180();
#elif ENABLED(LCD_SCREEN_ROT_270)
u8g.setRot270();
#endif
TERN_(LCD_SCREEN_ROT_90, u8g.setRot90());
TERN_(LCD_SCREEN_ROT_180, u8g.setRot180());
TERN_(LCD_SCREEN_ROT_270, u8g.setRot270());
#endif // !MKS_LCD12864B
@@ -286,9 +278,7 @@ void MarlinUI::init_lcd() {
// The kill screen is displayed for unrecoverable conditions
void MarlinUI::draw_kill_screen() {
#if ENABLED(LIGHTWEIGHT_UI)
ST7920_Lite_Status_Screen::clear_text_buffer();
#endif
TERN_(LIGHTWEIGHT_UI, ST7920_Lite_Status_Screen::clear_text_buffer());
const u8g_uint_t h4 = u8g.getHeight() / 4;
u8g.firstPage();
do {