Skip to content

Commit

Permalink
🔨 DGUS_LCD_UI version check
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead committed Apr 7, 2023
1 parent 4422af5 commit 8a400b1
Show file tree
Hide file tree
Showing 28 changed files with 45 additions and 43 deletions.
2 changes: 1 addition & 1 deletion Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
#include "feature/password/password.h"
#endif

#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
#include "lcd/extui/dgus/DGUSScreenHandler.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1081,7 +1081,7 @@ void GcodeSuite::process_parsed_command(const bool no_ok/*=false*/) {
case 1001: M1001(); break; // M1001: [INTERNAL] Handle SD completion
#endif

#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
case 1002: M1002(); break; // M1002: [INTERNAL] Tool-change and Relative E Move
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/gcode.h
Original file line number Diff line number Diff line change
Expand Up @@ -1226,7 +1226,7 @@ class GcodeSuite {
static void M1001();
#endif

#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
static void M1002();
#endif

Expand Down
4 changes: 2 additions & 2 deletions Marlin/src/gcode/sd/M24_M25.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
#include "../../feature/powerloss.h"
#endif

#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
#include "../../lcd/extui/dgus/DGUSDisplayDef.h"
#endif

Expand All @@ -52,7 +52,7 @@
*/
void GcodeSuite::M24() {

#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
if ((print_job_timer.isPaused() || print_job_timer.isRunning()) && !parser.seen("ST"))
MKS_resume_print_move();
#endif
Expand Down
14 changes: 7 additions & 7 deletions Marlin/src/inc/Conditionals_LCD.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,19 @@
#define FYSETC_MINI_12864_2_1
#endif

// Updated DGUS_UI shorthand single option can be used, or old settings, for now
// Old settings are now conditional on DGUS_LCD_UI
#if DGUS_UI_IS(ORIGIN)
#define DGUS_LCD_UI_ORIGIN
#define DGUS_LCD_UI_ORIGIN 1
#elif DGUS_UI_IS(FYSETC)
#define DGUS_LCD_UI_FYSETC
#define DGUS_LCD_UI_FYSETC 1
#elif DGUS_UI_IS(HIPRECY)
#define DGUS_LCD_UI_HIPRECY
#define DGUS_LCD_UI_HIPRECY 1
#elif DGUS_UI_IS(MKS)
#define DGUS_LCD_UI_MKS
#define DGUS_LCD_UI_MKS 1
#elif DGUS_UI_IS(RELOADED)
#define DGUS_LCD_UI_RELOADED
#define DGUS_LCD_UI_RELOADED 1
#elif DGUS_UI_IS(IA_CREALITY)
#define DGUS_LCD_UI_IA_CREALITY
#define DGUS_LCD_UI_IA_CREALITY 1
#endif

/**
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -656,6 +656,8 @@
#error "EXTRA_LIN_ADVANCE_K is now ADVANCE_K_EXTRA."
#elif defined(POLAR_SEGMENTS_PER_SECOND) || defined(DELTA_SEGMENTS_PER_SECOND) || defined(SCARA_SEGMENTS_PER_SECOND) || defined(TPARA_SEGMENTS_PER_SECOND)
#error "(POLAR|DELTA|SCARA|TPARA)_SEGMENTS_PER_SECOND is now DEFAULT_SEGMENTS_PER_SECOND."
#elif ANY(DGUS_LCD_UI_ORIGIN, DGUS_LCD_UI_FYSETC, DGUS_LCD_UI_HIPRECY, DGUS_LCD_UI_MKS, DGUS_LCD_UI_RELOADED) && !defined(DGUS_LCD_UI)
#error "DGUS_LCD_UI_[TYPE] is now set using DGUS_LCD_UI TYPE."
#endif

// L64xx stepper drivers have been removed
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/lcd/extui/dgus/DGUSDisplayDef.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@ extern const struct DGUS_VP_Variable ListOfVP[];

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

#if ENABLED(DGUS_LCD_UI_ORIGIN)
#if DGUS_LCD_UI_ORIGIN
#include "origin/DGUSDisplayDef.h"
#elif ENABLED(DGUS_LCD_UI_MKS)
#elif DGUS_LCD_UI_MKS
#include "mks/DGUSDisplayDef.h"
#elif ENABLED(DGUS_LCD_UI_FYSETC)
#elif DGUS_LCD_UI_FYSETC
#include "fysetc/DGUSDisplayDef.h"
#elif ENABLED(DGUS_LCD_UI_HIPRECY)
#elif DGUS_LCD_UI_HIPRECY
#include "hiprecy/DGUSDisplayDef.h"
#endif
8 changes: 4 additions & 4 deletions Marlin/src/lcd/extui/dgus/DGUSScreenHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,13 +46,13 @@
#define BE16_P(V) ( ((uint8_t*)(V))[0] << 8U | ((uint8_t*)(V))[1] )
#define BE32_P(V) ( ((uint8_t*)(V))[0] << 24U | ((uint8_t*)(V))[1] << 16U | ((uint8_t*)(V))[2] << 8U | ((uint8_t*)(V))[3] )

#if ENABLED(DGUS_LCD_UI_ORIGIN)
#if DGUS_LCD_UI_ORIGIN
#include "origin/DGUSScreenHandler.h"
#elif ENABLED(DGUS_LCD_UI_MKS)
#elif DGUS_LCD_UI_MKS
#include "mks/DGUSScreenHandler.h"
#elif ENABLED(DGUS_LCD_UI_FYSETC)
#elif DGUS_LCD_UI_FYSETC
#include "fysetc/DGUSScreenHandler.h"
#elif ENABLED(DGUS_LCD_UI_HIPRECY)
#elif DGUS_LCD_UI_HIPRECY
#include "hiprecy/DGUSScreenHandler.h"
#endif

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/fysetc/DGUSDisplayDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

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

#if ENABLED(DGUS_LCD_UI_FYSETC)
#if DGUS_LCD_UI_FYSETC

#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/fysetc/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_FYSETC)
#if DGUS_LCD_UI_FYSETC

#include "../DGUSScreenHandler.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/hiprecy/DGUSDisplayDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

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

#if ENABLED(DGUS_LCD_UI_HIPRECY)
#if DGUS_LCD_UI_HIPRECY

#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/hiprecy/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_HIPRECY)
#if DGUS_LCD_UI_HIPRECY

#include "../DGUSScreenHandler.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/mks/DGUSDisplayDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS

#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/mks/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS

#include "../DGUSScreenHandler.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/origin/DGUSDisplayDef.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

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

#if ENABLED(DGUS_LCD_UI_ORIGIN)
#if DGUS_LCD_UI_ORIGIN

#include "DGUSDisplayDef.h"
#include "../DGUSDisplay.h"
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus/origin/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_ORIGIN)
#if DGUS_LCD_UI_ORIGIN

#include "../DGUSScreenHandler.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_reloaded/DGUSDisplay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "DGUSDisplay.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_reloaded/DGUSRxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "DGUSRxHandler.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_reloaded/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "DGUSScreenHandler.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_reloaded/DGUSSetupHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "DGUSSetupHandler.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_reloaded/DGUSTxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "DGUSTxHandler.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "DGUS_ScreenAddrList.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "DGUS_ScreenSetup.h"

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "DGUS_VPList.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/dgus_reloaded/dgus_reloaded_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

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

#if ENABLED(DGUS_LCD_UI_RELOADED)
#if DGUS_LCD_UI_RELOADED

#include "../ui_api.h"
#include "DGUSScreenHandler.h"
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/ia_creality/FileNavigator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@

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

#if ENABLED(DGUS_LCD_UI_IA_CREALITY)
#if DGUS_LCD_UI_IA_CREALITY

#include "FileNavigator.h"

Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/lcd/extui/ia_creality/creality_extui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@

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

#if ENABLED(DGUS_LCD_UI_IA_CREALITY)
#if DGUS_LCD_UI_IA_CREALITY

#include "creality_extui.h"
#include "FileNavigator.h"
Expand Down
8 changes: 4 additions & 4 deletions Marlin/src/module/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@
#include "../feature/fancheck.h"
#endif

#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
#include "../lcd/extui/dgus/DGUSScreenHandler.h"
#include "../lcd/extui/dgus/DGUSDisplayDef.h"
#endif
Expand Down Expand Up @@ -569,7 +569,7 @@ typedef struct SettingsDataStruct {
//
// MKS UI controller
//
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
MKS_Language mks_language_index; // Display Language
xy_int_t mks_corner_offsets[5]; // Bed Tramming
xyz_int_t mks_park_pos; // Custom Parking (without NOZZLE_PARK)
Expand Down Expand Up @@ -1614,7 +1614,7 @@ void MarlinSettings::postprocess() {
//
// MKS UI controller
//
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
EEPROM_WRITE(mks_language_index);
EEPROM_WRITE(mks_corner_offsets);
EEPROM_WRITE(mks_park_pos);
Expand Down Expand Up @@ -2602,7 +2602,7 @@ void MarlinSettings::postprocess() {
//
// MKS UI controller
//
#if ENABLED(DGUS_LCD_UI_MKS)
#if DGUS_LCD_UI_MKS
_FIELD_TEST(mks_language_index);
EEPROM_READ(mks_language_index);
EEPROM_READ(mks_corner_offsets);
Expand Down

0 comments on commit 8a400b1

Please sign in to comment.