make custom Anycubic touchscreen implementation an ExtUI module

Start migration to ExtUI module. We do not yet change much of the custom
logic, but this brings us closer to upstream and allows use of some
integration hooks with less patching required.
This commit is contained in:
Stefan Kalscheuer
2022-12-23 16:01:45 +01:00
parent a9513299c0
commit 36c8aee75b
9 changed files with 167 additions and 49 deletions

View File

@@ -254,7 +254,7 @@
// PATCH START: Knutwurst
#if ENABLED(ANYCUBIC_TOUCHSCREEN)
#include "lcd/anycubic_touchscreen.h"
#include "lcd/extui/knutwurst/anycubic_touchscreen.h"
#endif
// PATCH END: Knutwurst
@@ -353,7 +353,7 @@ void startOrResumeJob() {
TERN_(GCODE_REPEAT_MARKERS, repeat.reset());
TERN_(CANCEL_OBJECTS, cancelable.reset());
TERN_(LCD_SHOW_E_TOTAL, e_move_accumulator = 0);
#if ENABLED(SET_REMAINING_TIME)
#if BOTH(LCD_SET_PROGRESS_MANUALLY, USE_M73_REMAINING_TIME)
ui.reset_remaining_time();
#endif
}
@@ -890,10 +890,6 @@ void idle(bool no_stepper_sleep/*=false*/) {
TERN_(MAX7219_DEBUG, max7219.idle_tasks());
// PATCH START: Knutwurst
#ifdef ANYCUBIC_TOUCHSCREEN
AnycubicTouchscreen.CommandScan();
#endif
#ifdef ENDSTOP_BEEP
EndstopBeep();
#endif
@@ -1011,12 +1007,6 @@ void kill(FSTR_P const lcd_error/*=nullptr*/, FSTR_P const lcd_component/*=nullp
// "Error:Printer halted. kill() called!"
SERIAL_ERROR_MSG(STR_ERR_KILLED);
// PATCH START: Knutwurst
#ifdef ANYCUBIC_TOUCHSCREEN
AnycubicTouchscreen.KillTFT();
#endif
// PATCH END: Knutwurst
#ifdef ACTION_ON_KILL
hostui.kill();
#endif
@@ -1292,12 +1282,6 @@ void setup() {
#endif
SERIAL_ECHOLNPGM("start");
// PATCH START: Knutwurst
#ifdef ANYCUBIC_TOUCHSCREEN
AnycubicTouchscreen.Setup();
#endif
// PATCH END: Knutwurst
// Set up these pins early to prevent suicide
#if HAS_KILL
SETUP_LOG("KILL_PIN");
@@ -1796,13 +1780,6 @@ void loop() {
endstops.event_handler();
// PATCH START: Knutwurst
idle();
#ifdef ANYCUBIC_TOUCHSCREEN
AnycubicTouchscreen.CommandScan();
#endif
// PATCH END: Knutwurst
TERN_(HAS_TFT_LVGL_UI, printer_state_polling());
TERN_(MARLIN_TEST_BUILD, runPeriodicTests());