Skip to content

Commit

Permalink
🚚 Relocate and adjust DWIN E3V2 (MarlinFirmware#22471)
Browse files Browse the repository at this point in the history
  • Loading branch information
thinkyhead authored and Darred committed Dec 1, 2021
1 parent 2d73539 commit 9c49960
Show file tree
Hide file tree
Showing 23 changed files with 305 additions and 268 deletions.
13 changes: 8 additions & 5 deletions Marlin/Configuration_adv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1282,11 +1282,14 @@
//#define LCD_SHOW_E_TOTAL
#endif

#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY) && ANY(HAS_MARLINUI_U8GLIB, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL, EXTENSIBLE_UI)
//#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
// LCD Print Progress options
#if EITHER(SDSUPPORT, LCD_SET_PROGRESS_MANUALLY)
#if ANY(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI, HAS_MARLINUI_HD44780, IS_TFTGLCD_PANEL)
//#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
#endif

#if EITHER(HAS_MARLINUI_U8GLIB, EXTENSIBLE_UI)
Expand Down
10 changes: 3 additions & 7 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,8 @@
#endif

#if ENABLED(DWIN_CREALITY_LCD)
#include "lcd/dwin/e3v2/dwin.h"
#include "lcd/dwin/e3v2/rotary_encoder.h"
#include "lcd/e3v2/creality/dwin.h"
#include "lcd/e3v2/creality/rotary_encoder.h"
#endif

#if ENABLED(EXTENSIBLE_UI)
Expand Down Expand Up @@ -1310,11 +1310,7 @@ void setup() {
// (because EEPROM code calls the UI).

#if ENABLED(DWIN_CREALITY_LCD)
delay(800); // Required delay (since boot?)
SERIAL_ECHOPGM("\nDWIN handshake ");
if (DWIN_Handshake()) SERIAL_ECHOLNPGM("ok."); else SERIAL_ECHOLNPGM("error.");
DWIN_Frame_SetDir(1); // Orientation 90°
DWIN_UpdateLCD(); // Show bootscreen (first image)
SETUP_RUN(DWIN_Startup());
#else
SETUP_RUN(ui.init());
#if BOTH(HAS_WIRED_LCD, SHOW_BOOTSCREEN)
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#endif

#if ENABLED(DWIN_CREALITY_LCD)
#include "../../../lcd/dwin/e3v2/dwin.h"
#include "../../../lcd/e3v2/creality/dwin.h"
#endif

#if HAS_MULTI_HOTEND
Expand Down
2 changes: 1 addition & 1 deletion Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

#include "../../lcd/marlinui.h"
#if ENABLED(DWIN_CREALITY_LCD)
#include "../../lcd/dwin/e3v2/dwin.h"
#include "../../lcd/e3v2/creality/dwin.h"
#endif

#if ENABLED(EXTENSIBLE_UI)
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 @@ -482,10 +482,6 @@
#endif

// Aliases for LCD features
#if EITHER(IS_ULTRA_LCD, EXTENSIBLE_UI)
#define HAS_DISPLAY 1
#endif

#if IS_ULTRA_LCD
#define HAS_WIRED_LCD 1
#if ENABLED(DOGLCD)
Expand All @@ -497,6 +493,10 @@
#endif
#endif

#if EITHER(HAS_WIRED_LCD, EXTENSIBLE_UI)
#define HAS_DISPLAY 1
#endif

#if ANY(HAS_DISPLAY, DWIN_CREALITY_LCD, GLOBAL_STATUS_MESSAGE)
#define HAS_STATUS_MESSAGE 1
#endif
Expand Down
7 changes: 4 additions & 3 deletions Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -791,9 +791,10 @@ void MarlinUI::draw_status_screen() {
//

lcd.setCursor(0, 0);
_draw_axis_value(X_AXIS, ftostr4sign(LOGICAL_X_POSITION(current_position.x)), blink); lcd.write(' ');
_draw_axis_value(Y_AXIS, ftostr4sign(LOGICAL_Y_POSITION(current_position.y)), blink); lcd.write(' ');
_draw_axis_value(Z_AXIS, ftostr52sp(LOGICAL_Z_POSITION(current_position.z)), blink);
const xyz_pos_t lpos = current_position.asLogical();
_draw_axis_value(X_AXIS, ftostr4sign(lpos.x), blink); lcd.write(' ');
_draw_axis_value(Y_AXIS, ftostr4sign(lpos.y), blink); lcd.write(' ');
_draw_axis_value(Z_AXIS, ftostr52sp(lpos.z), blink);

#if HAS_LEVELING && !HAS_HEATED_BED
lcd.write(planner.leveling_active || blink ? '_' : ' ');
Expand Down
File renamed without changes.
Loading

0 comments on commit 9c49960

Please sign in to comment.