Skip to content

Commit

Permalink
Rename LCD conditionals (MarlinFirmware#19533)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 29, 2021
1 parent ac900b1 commit 58deab1
Show file tree
Hide file tree
Showing 138 changed files with 353 additions and 333 deletions.
10 changes: 5 additions & 5 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1106,18 +1106,18 @@
#define BOOTSCREEN_TIMEOUT 4000 // (ms) Total Duration to display the boot screen(s)
#endif

#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && (HAS_GRAPHICAL_LCD || HAS_CHARACTER_LCD)
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && (HAS_MARLINUI_U8GLIB || HAS_MARLINUI_HD44780)
//#define SHOW_REMAINING_TIME // Display estimated time to completion
#if ENABLED(SHOW_REMAINING_TIME)
//#define USE_M73_REMAINING_TIME // Use remaining time from M73 command instead of estimation
//#define ROTATE_PROGRESS_DISPLAY // Display (P)rogress, (E)lapsed, and (R)emaining time
#endif

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB
//#define PRINT_PROGRESS_SHOW_DECIMALS // Show progress with decimal digits
#endif

#if HAS_CHARACTER_LCD
#if HAS_MARLINUI_HD44780
//#define LCD_PROGRESS_BAR // Show a progress bar on HD44780 LCDs for SD printing
#if ENABLED(LCD_PROGRESS_BAR)
#define PROGRESS_BAR_BAR_TIME 2000 // (ms) Amount of time to show the bar
Expand Down Expand Up @@ -1328,7 +1328,7 @@
* controller events, as there is a trade-off between reliable
* printing performance versus fast display updates.
*/
#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB
// Show SD percentage next to the progress bar
//#define DOGM_SD_PERCENT

Expand Down Expand Up @@ -1398,7 +1398,7 @@
//#define MARLIN_SNAKE
//#define GAMES_EASTER_EGG // Add extra blank lines above the "Games" sub-menu

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB

//
// Additional options for DGUS / DWIN displays
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/AVR/u8g_com_HAL_AVR_sw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#include "../../inc/MarlinConfigPre.h"

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB

#include "../shared/Marduino.h"
#include "../shared/Delay.h"
Expand Down Expand Up @@ -189,5 +189,5 @@ uint8_t u8g_com_HAL_AVR_sw_sp_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
return 1;
}

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB
#endif // ARDUINO_ARCH_SAM
4 changes: 2 additions & 2 deletions Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_shared_hw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@

#include "../../../inc/MarlinConfigPre.h"

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB

#include <U8glib.h>

Expand Down Expand Up @@ -145,6 +145,6 @@ uint8_t u8g_com_HAL_DUE_shared_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_va
return 1;
}

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB

#endif // __SAM3X8E__
4 changes: 2 additions & 2 deletions Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#include "../../../inc/MarlinConfigPre.h"

#if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920)
#if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920)

#undef SPI_SPEED
#define SPI_SPEED 2 // About 2 MHz
Expand Down Expand Up @@ -144,5 +144,5 @@ uint8_t u8g_com_HAL_DUE_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val, void
return 1;
}

#endif // HAS_GRAPHICAL_LCD && !U8GLIB_ST7920
#endif // HAS_MARLINUI_U8GLIB && !U8GLIB_ST7920
#endif // ARDUINO_ARCH_SAM
4 changes: 2 additions & 2 deletions Marlin/src/HAL/DUE/dogm/u8g_com_HAL_DUE_sw_spi_shared.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#include "../../../inc/MarlinConfigPre.h"

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB

#include "../../shared/Delay.h"

Expand Down Expand Up @@ -108,5 +108,5 @@ void u8g_spiSend_sw_DUE_mode_3(uint8_t val) { // 3.5MHz
}
}

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB
#endif // ARDUINO_ARCH_SAM
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LINUX/spi_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "../../core/macros.h"
#include "../../inc/MarlinConfigPre.h"

#if BOTH(HAS_GRAPHICAL_LCD, SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#if BOTH(HAS_MARLINUI_U8GLIB, SDSUPPORT) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static_assert(DISABLED(BAUD_RATE_GCODE), "BAUD_RATE_GCODE is not yet supported o
#define _IS_RX1_1 IS_RX1
#if IS_TX1(TMC_SW_SCK)
#error "Serial port pins (1) conflict with other pins!"
#elif HAS_SPI_LCD
#elif HAS_WIRED_LCD
#if IS_TX1(BTN_EN2) || IS_RX1(BTN_EN1)
#error "Serial port pins (1) conflict with Encoder Buttons!"
#elif ANY_TX(1, SCK_PIN, LCD_PINS_D4, DOGLCD_SCK, LCD_RESET_PIN, LCD_PINS_RS, SHIFT_CLK) \
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/HAL/LPC1768/spi_pins.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "../../core/macros.h"

#if BOTH(SDSUPPORT, HAS_GRAPHICAL_LCD) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#if BOTH(SDSUPPORT, HAS_MARLINUI_U8GLIB) && (LCD_PINS_D4 == SCK_PIN || LCD_PINS_ENABLE == MOSI_PIN || DOGLCD_SCK == SCK_PIN || DOGLCD_MOSI == MOSI_PIN)
#define LPC_SOFTWARE_SPI // If the SD card and LCD adapter share the same SPI pins, then software SPI is currently
// needed due to the speed and mode required for communicating with each device being different.
// This requirement can be removed if the SPI access to these devices is updated to use
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_hw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#include "../../../inc/MarlinConfigPre.h"

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB

#include <U8glib.h>
#include "../../shared/HAL_SPI.h"
Expand Down Expand Up @@ -124,6 +124,6 @@ uint8_t u8g_com_HAL_LPC1768_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val,
return 1;
}

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB

#endif // TARGET_LPC1768
4 changes: 2 additions & 2 deletions Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_ssd_hw_i2c.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@

#include "../../../inc/MarlinConfigPre.h"

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB

#include <U8glib.h>

Expand Down Expand Up @@ -193,6 +193,6 @@ uint8_t u8g_com_HAL_LPC1768_ssd_hw_i2c_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_v
return 1;
}

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB

#endif // TARGET_LPC1768
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#include "../../../inc/MarlinConfigPre.h"

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB

#include <U8glib.h>
#include "../../shared/HAL_SPI.h"
Expand Down Expand Up @@ -133,6 +133,6 @@ uint8_t u8g_com_HAL_LPC1768_ST7920_hw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t ar
return 1;
}

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB

#endif // TARGET_LPC1768
4 changes: 2 additions & 2 deletions Marlin/src/HAL/LPC1768/u8g/u8g_com_HAL_LPC1768_sw_spi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@

#include "../../../inc/MarlinConfigPre.h"

#if HAS_GRAPHICAL_LCD && DISABLED(U8GLIB_ST7920)
#if HAS_MARLINUI_U8GLIB && DISABLED(U8GLIB_ST7920)

#include <SoftwareSPI.h>

Expand Down Expand Up @@ -203,5 +203,5 @@ uint8_t u8g_com_HAL_LPC1768_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val,
return 1;
}

#endif // HAS_GRAPHICAL_LCD && !U8GLIB_ST7920
#endif // HAS_MARLINUI_U8GLIB && !U8GLIB_ST7920
#endif // TARGET_LPC1768
4 changes: 2 additions & 2 deletions Marlin/src/HAL/STM32F1/dogm/u8g_com_stm32duino_swspi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@

#include "../../../inc/MarlinConfig.h"

#if BOTH(HAS_GRAPHICAL_LCD, FORCE_SOFT_SPI)
#if BOTH(HAS_MARLINUI_U8GLIB, FORCE_SOFT_SPI)

#include "../HAL.h"
#include <U8glib.h>
Expand Down Expand Up @@ -161,5 +161,5 @@ uint8_t u8g_com_HAL_STM32F1_sw_spi_fn(u8g_t *u8g, uint8_t msg, uint8_t arg_val,
return 1;
}

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB
#endif // STM32F1
2 changes: 1 addition & 1 deletion Marlin/src/HAL/shared/HAL_ST7920.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
* (bypassing U8G), it will allow the LIGHTWEIGHT_UI to operate.
*/

#if BOTH(HAS_GRAPHICAL_LCD, LIGHTWEIGHT_UI)
#if BOTH(HAS_MARLINUI_U8GLIB, LIGHTWEIGHT_UI)
void ST7920_cs();
void ST7920_ncs();
void ST7920_set_cmd();
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1072,7 +1072,7 @@ void setup() {
DWIN_UpdateLCD(); // Show bootscreen (first image)
#else
SETUP_RUN(ui.init());
#if HAS_SPI_LCD && ENABLED(SHOW_BOOTSCREEN)
#if HAS_WIRED_LCD && ENABLED(SHOW_BOOTSCREEN)
SETUP_RUN(ui.show_bootscreen());
#endif
SETUP_RUN(ui.reset_status()); // Load welcome message early. (Retained if no errors exist.)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/core/language.h
Original file line number Diff line number Diff line change
Expand Up @@ -303,7 +303,7 @@
#define LCD_STR_C STR_C
#define LCD_STR_E STR_E

#if HAS_CHARACTER_LCD
#if HAS_MARLINUI_HD44780

// Custom characters defined in the first 8 characters of the LCD
#define LCD_STR_BEDTEMP "\x00" // Print only as a char. This will have 'unexpected' results when used in a string!
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/feature/power_monitor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ uint8_t PowerMonitor::display_item;

PowerMonitor power_monitor; // Single instance - this calls the constructor

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB

#if ENABLED(POWER_MONITOR_CURRENT)
void PowerMonitor::draw_current() {
Expand All @@ -70,6 +70,6 @@ PowerMonitor power_monitor; // Single instance - this calls the constructor
}
#endif

#endif // HAS_GRAPHICAL_LCD
#endif // HAS_MARLINUI_U8GLIB

#endif // HAS_POWER_MONITOR
4 changes: 2 additions & 2 deletions Marlin/src/feature/power_monitor.h
Original file line number Diff line number Diff line change
Expand Up @@ -88,8 +88,8 @@ class PowerMonitor {
FORCE_INLINE static float getPower() { return getAmps() * getVolts(); }
#endif

#if HAS_SPI_LCD
#if HAS_GRAPHICAL_LCD && DISABLED(LIGHTWEIGHT_UI)
#if HAS_WIRED_LCD
#if HAS_MARLINUI_U8GLIB && DISABLED(LIGHTWEIGHT_UI)
FORCE_INLINE static bool display_enabled() { return flags != 0x00; }
#endif
#if ENABLED(POWER_MONITOR_CURRENT)
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/gcode/bedlevel/G26.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,7 @@ inline bool turn_on_heaters() {
#if HAS_HEATED_BED

if (g26_bed_temp > 25) {
#if HAS_SPI_LCD
#if HAS_WIRED_LCD
ui.set_status_P(GET_TEXT(MSG_G26_HEATING_BED), 99);
ui.quick_feedback();
TERN_(HAS_LCD_MENU, ui.capture());
Expand All @@ -378,7 +378,7 @@ inline bool turn_on_heaters() {
#endif // HAS_HEATED_BED

// Start heating the active nozzle
#if HAS_SPI_LCD
#if HAS_WIRED_LCD
ui.set_status_P(GET_TEXT(MSG_G26_HEATING_NOZZLE), 99);
ui.quick_feedback();
#endif
Expand All @@ -391,7 +391,7 @@ inline bool turn_on_heaters() {
#endif
)) return G26_ERR;

#if HAS_SPI_LCD
#if HAS_WIRED_LCD
ui.reset_status();
ui.quick_feedback();
#endif
Expand Down Expand Up @@ -446,7 +446,7 @@ inline bool prime_nozzle() {
else
#endif
{
#if HAS_SPI_LCD
#if HAS_WIRED_LCD
ui.set_status_P(GET_TEXT(MSG_G26_FIXED_LENGTH), 99);
ui.quick_feedback();
#endif
Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/calibrate/M48.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ void GcodeSuite::M48() {
float sample_sum = 0.0;

LOOP_L_N(n, n_samples) {
#if HAS_SPI_LCD
#if HAS_WIRED_LCD
// Display M48 progress in the status bar
ui.status_printf_P(0, PSTR(S_FMT ": %d/%d"), GET_TEXT(MSG_M48_POINT), int(n + 1), int(n_samples));
#endif
Expand Down Expand Up @@ -258,7 +258,7 @@ void GcodeSuite::M48() {
SERIAL_ECHOLNPGM("Finished!");
dev_report(verbose_level > 0, mean, sigma, min, max, true);

#if HAS_SPI_LCD
#if HAS_WIRED_LCD
// Display M48 results in the status bar
char sigma_str[8];
ui.status_printf_P(0, PSTR(S_FMT ": %s"), GET_TEXT(MSG_M48_DEVIATION), dtostrf(sigma, 2, 6, sigma_str));
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/feature/power_monitor/M430.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
*/
void GcodeSuite::M430() {
bool do_report = true;
#if HAS_SPI_LCD
#if HAS_WIRED_LCD
#if ENABLED(POWER_MONITOR_CURRENT)
if (parser.seen('I')) { power_monitor.set_current_display(parser.value_bool()); do_report = false; }
#endif
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -456,11 +456,11 @@
#endif

#if ENABLED(ULTRA_LCD)
#define HAS_SPI_LCD 1
#define HAS_WIRED_LCD 1
#if ENABLED(DOGLCD)
#define HAS_GRAPHICAL_LCD 1
#define HAS_MARLINUI_U8GLIB 1
#elif DISABLED(HAS_GRAPHICAL_TFT)
#define HAS_CHARACTER_LCD 1
#define HAS_MARLINUI_HD44780 1
#endif
#endif

Expand All @@ -471,7 +471,7 @@
#define HAS_ADC_BUTTONS 1
#endif

#if HAS_GRAPHICAL_LCD
#if HAS_MARLINUI_U8GLIB
#ifndef LCD_PIXEL_WIDTH
#define LCD_PIXEL_WIDTH 128
#endif
Expand Down
Loading

0 comments on commit 58deab1

Please sign in to comment.