Skip to content

Commit

Permalink
Add support for UBL procedure (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
mrv96 committed Jan 9, 2021
1 parent eb7ce1a commit 19c7892
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 4 deletions.
6 changes: 5 additions & 1 deletion Marlin/src/inc/SanityCheck.h
Original file line number Diff line number Diff line change
Expand Up @@ -3204,7 +3204,9 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
* Require certain features for DGUS_LCD_UI_RELOADED.
*/
#if ENABLED(DGUS_LCD_UI_RELOADED)
#if HOTENDS < 1
#if BUFSIZE < 4
#error "DGUS_LCD_UI_RELOADED requires a BUFSIZE of at least 4."
#elif HOTENDS < 1
#error "DGUS_LCD_UI_RELOADED requires at least 1 hotend."
#elif EXTRUDERS < 1
#error "DGUS_LCD_UI_RELOADED requires at least 1 extruder."
Expand All @@ -3222,5 +3224,7 @@ static_assert( _ARR_TEST(3,0) && _ARR_TEST(3,1) && _ARR_TEST(3,2)
#error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ALWAYS_AVAILABLE."
#elif DISABLED(BABYSTEP_ZPROBE_OFFSET)
#error "DGUS_LCD_UI_RELOADED requires BABYSTEP_ZPROBE_OFFSET."
#elif ENABLED(AUTO_BED_LEVELING_UBL) && DISABLED(UBL_SAVE_ACTIVE_ON_M500)
#warning "Without UBL_SAVE_ACTIVE_ON_M500, your mesh will not be saved when using the touchscreen."
#endif
#endif
11 changes: 10 additions & 1 deletion Marlin/src/lcd/extui/lib/dgus_reloaded/DGUSRxHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -499,6 +499,11 @@ void DGUSRxHandler::Probe(DGUS_VP &vp, void *data_ptr) {
UNUSED(vp);
UNUSED(data_ptr);

#if ENABLED(MESH_BED_LEVELING)
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_ABL_REQUIRED);
return;
#endif

if (!ExtUI::isPositionKnown()) {
dgus_screen_handler.SetStatusMessagePGM(DGUS_MSG_HOMING_REQUIRED);
return;
Expand All @@ -511,7 +516,11 @@ void DGUSRxHandler::Probe(DGUS_VP &vp, void *data_ptr) {

dgus_screen_handler.TriggerScreenChange(DGUS_Screen::LEVELING_PROBING);

queue.enqueue_now_P(PSTR("G29\nM420S1"));
#if ENABLED(AUTO_BED_LEVELING_UBL)
queue.enqueue_now_P(PSTR("G29P1\nG29P3\nG29P5C"));
#else
queue.enqueue_now_P(PSTR("G29"));
#endif
queue.enqueue_now_P(DGUS_CMD_EEPROM_SAVE);
}

Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/lcd/extui/lib/dgus_reloaded/DGUSScreenHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ const char DGUS_MSG_HOMING_REQUIRED[] PROGMEM = "Homing required",
DGUS_MSG_BUSY[] PROGMEM = "Busy",
DGUS_MSG_UNDEF[] PROGMEM = "-",
DGUS_MSG_HOMING[] PROGMEM = "Homing...",
DGUS_MSG_FW_OUTDATED[] PROGMEM = "DWIN GUI/OS update required";
DGUS_MSG_FW_OUTDATED[] PROGMEM = "DWIN GUI/OS update required",
DGUS_MSG_ABL_REQUIRED[] PROGMEM = "Auto bed leveling required";

const char DGUS_CMD_HOME[] PROGMEM = "G28",
DGUS_CMD_EEPROM_SAVE[] PROGMEM = "M500";
Expand Down
3 changes: 2 additions & 1 deletion Marlin/src/lcd/extui/lib/dgus_reloaded/DGUSScreenHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,8 @@ extern const char DGUS_MSG_HOMING_REQUIRED[],
DGUS_MSG_BUSY[],
DGUS_MSG_UNDEF[],
DGUS_MSG_HOMING[],
DGUS_MSG_FW_OUTDATED[];
DGUS_MSG_FW_OUTDATED[],
DGUS_MSG_ABL_REQUIRED[];

extern const char DGUS_CMD_HOME[],
DGUS_CMD_EEPROM_SAVE[];

0 comments on commit 19c7892

Please sign in to comment.