Skip to content

Commit

Permalink
Add additional EXTUI functions utilized by Creality Touch display
Browse files Browse the repository at this point in the history
  • Loading branch information
InsanityAutomation committed Dec 5, 2020
1 parent 2c8f566 commit fe8d85f
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Marlin/src/MarlinCore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ void enable_all_steppers() {
ENABLE_AXIS_Y();
ENABLE_AXIS_Z();
enable_e_steppers();
TERN_(EXTENSIBLE_UI, ExtUI::onSteppersEnabled());
}

void disable_e_steppers() {
Expand All @@ -379,6 +380,7 @@ void disable_all_steppers() {
DISABLE_AXIS_Y();
DISABLE_AXIS_Z();
disable_e_steppers();
TERN_(EXTENSIBLE_UI, ExtUI::onSteppersDisabled());
}

#if ENABLED(G29_RETRY_AND_RECOVER)
Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/gcode/bedlevel/abl/G29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -515,6 +515,8 @@ G29_TYPE GcodeSuite::G29() {

#if ABL_GRID

TERN_(EXTENSIBLE_UI, ExtUI::onMeshLevelingStart());

// Skip any unreachable points
while (abl_probe_index < abl_points) {

Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/gcode/calibrate/G28.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@
#include "../../lcd/dwin/e3v2/dwin.h"
#endif

#if ENABLED(EXTENSIBLE_UI)
#include "../../lcd/extui/ui_api.h"
#endif

#if HAS_L64XX // set L6470 absolute position registers to counts
#include "../../libs/L64XX/L64XX_Marlin.h"
#endif
Expand Down Expand Up @@ -230,6 +234,8 @@ void GcodeSuite::G28() {
return;
}

TERN_(EXTENSIBLE_UI, ExtUI::onHomingStart());

planner.synchronize(); // Wait for planner moves to finish!

SET_SOFT_ENDSTOP_LOOSE(false); // Reset a leftover 'loose' motion state
Expand Down Expand Up @@ -461,6 +467,7 @@ void GcodeSuite::G28() {
ui.refresh();

TERN_(DWIN_CREALITY_LCD, DWIN_CompletedHoming());
TERN_(EXTENSIBLE_UI, ExtUI::onHomingComplete());

report_current_position();

Expand Down
2 changes: 2 additions & 0 deletions Marlin/src/gcode/sd/M1001.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,8 @@ void GcodeSuite::M1001() {
// Purge the recovery file
TERN_(POWER_LOSS_RECOVERY, recovery.purge());

TERN_(EXTENSIBLE_UI, ExtUI::onPrintFinished());

// Announce SD file completion
{
PORT_REDIRECT(SERIAL_BOTH);
Expand Down
7 changes: 7 additions & 0 deletions Marlin/src/lcd/extui/anycubic_chiron_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,13 @@ namespace ExtUI {
// Called for temperature PID tuning result
}
#endif

void onHomingStart() {};
void onHomingComplete() {};
void onPrintFinished() {};
void onSteppersEnabled() {};
void onSteppersDisabled() {};

}

#endif // ANYCUBIC_LCD_CHIRON
7 changes: 7 additions & 0 deletions Marlin/src/lcd/extui/anycubic_i3mega_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,13 @@ namespace ExtUI {
// Called for temperature PID tuning result
}
#endif

void onHomingStart() {};
void onHomingComplete() {};
void onPrintFinished() {};
void onSteppersEnabled() {};
void onSteppersDisabled() {};

}

#endif // ANYCUBIC_LCD_I3MEGA
6 changes: 6 additions & 0 deletions Marlin/src/lcd/extui/dgus_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,5 +146,11 @@ namespace ExtUI {
}
#endif

void onHomingStart() {};
void onHomingComplete() {};
void onPrintFinished() {};
void onSteppersEnabled() {};
void onSteppersDisabled() {};

}
#endif // HAS_DGUS_LCD
7 changes: 7 additions & 0 deletions Marlin/src/lcd/extui/example.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,13 @@ namespace ExtUI {
// Called for temperature PID tuning result
}
#endif

void onHomingStart() {};
void onHomingComplete() {};
void onPrintFinished() {};
void onSteppersEnabled() {};
void onSteppersDisabled() {};

}

#endif // EXTUI_EXAMPLE && EXTENSIBLE_UI
7 changes: 7 additions & 0 deletions Marlin/src/lcd/extui/lib/ftdi_eve_touch_ui/marlin_events.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,13 @@ namespace ExtUI {
GOTO_SCREEN(StatusScreen);
}
#endif // HAS_PID_HEATING

void onHomingStart() {};
void onHomingComplete() {};
void onPrintFinished() {};
void onSteppersEnabled() {};
void onSteppersDisabled() {};

}

#endif // TOUCH_UI_FTDI_EVE
6 changes: 6 additions & 0 deletions Marlin/src/lcd/extui/malyan_lcd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -531,6 +531,12 @@ namespace ExtUI {
#if ENABLED(POWER_LOSS_RECOVERY)
void onPowerLossResume() {}
#endif

void onHomingStart() {};
void onHomingComplete() {};
void onPrintFinished() {};
void onSteppersEnabled() {};
void onSteppersDisabled() {};
}

#endif // MALYAN_LCD
7 changes: 7 additions & 0 deletions Marlin/src/lcd/extui/ui_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,8 @@ namespace ExtUI {
} probe_state_t;
void onMeshUpdate(const int8_t xpos, const int8_t ypos, probe_state_t state);
inline void onMeshUpdate(const xy_int8_t &pos, probe_state_t state) { onMeshUpdate(pos.x, pos.y, state); }

inline void onMeshLevelingStart();
#endif
#endif

Expand Down Expand Up @@ -360,6 +362,11 @@ namespace ExtUI {
#if HAS_PID_HEATING
void onPidTuning(const result_t rst);
#endif
void onHomingStart();
void onHomingComplete();
void onPrintFinished();
void onSteppersEnabled();
void onSteppersDisabled();
};

/**
Expand Down

0 comments on commit fe8d85f

Please sign in to comment.