From d3fdec92d5d36f57ba7383f12bbfd48269bdad7e Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Sat, 18 Mar 2023 22:11:22 -0500 Subject: [PATCH] Throw out MKS UI filament runout handling --- .../lcd/extui/mks_ui/printer_operation.cpp | 70 ------------------- .../src/lcd/extui/mks_ui/printer_operation.h | 2 - 2 files changed, 72 deletions(-) diff --git a/Marlin/src/lcd/extui/mks_ui/printer_operation.cpp b/Marlin/src/lcd/extui/mks_ui/printer_operation.cpp index dc22609d3a7c6..782a4f9facd3b 100644 --- a/Marlin/src/lcd/extui/mks_ui/printer_operation.cpp +++ b/Marlin/src/lcd/extui/mks_ui/printer_operation.cpp @@ -142,77 +142,7 @@ void printer_state_polling() { } #endif - #if ENABLED(FILAMENT_RUNOUT_SENSOR) - if (uiCfg.print_state == WORKING) filament_check(); - #endif - TERN_(MKS_WIFI_MODULE, wifi_looping()); } -#if ENABLED(FILAMENT_RUNOUT_SENSOR) - - void filament_pin_setup() { - #if PIN_EXISTS(FIL_RUNOUT1) - SET_INPUT_PULLUP(FIL_RUNOUT_PIN); - #endif - #if PIN_EXISTS(FIL_RUNOUT2) && NUM_RUNOUT_SENSORS >= 2 - SET_INPUT_PULLUP(FIL_RUNOUT2_PIN); - #endif - #if PIN_EXISTS(FIL_RUNOUT3) && NUM_RUNOUT_SENSORS >= 3 - SET_INPUT_PULLUP(FIL_RUNOUT3_PIN); - #endif - } - - void filament_check() { - #if PIN_EXISTS(FIL_RUNOUT1) - static int fil_det_count_1 = 0; - if (READ(FIL_RUNOUT_PIN) == FIL_RUNOUT1_STATE) - fil_det_count_1++; - else if (fil_det_count_1 > 0) - fil_det_count_1--; - #endif - - #if PIN_EXISTS(FIL_RUNOUT2) && NUM_RUNOUT_SENSORS >= 2 - static int fil_det_count_2 = 0; - if (READ(FIL_RUNOUT2_PIN) == FIL_RUNOUT2_STATE) - fil_det_count_2++; - else if (fil_det_count_2 > 0) - fil_det_count_2--; - #endif - - #if PIN_EXISTS(FIL_RUNOUT3) && NUM_RUNOUT_SENSORS >= 3 - static int fil_det_count_3 = 0; - if (READ(FIL_RUNOUT3_PIN) == FIL_RUNOUT3_STATE) - fil_det_count_3++; - else if (fil_det_count_3 > 0) - fil_det_count_3--; - #endif - - if (false - #if PIN_EXISTS(FIL_RUNOUT1) - || fil_det_count_1 >= FILAMENT_RUNOUT_THRESHOLD - #endif - #if PIN_EXISTS(FIL_RUNOUT2) && NUM_RUNOUT_SENSORS >= 2 - || fil_det_count_2 >= FILAMENT_RUNOUT_THRESHOLD - #endif - #if PIN_EXISTS(FIL_RUNOUT3) && NUM_RUNOUT_SENSORS >= 3 - || fil_det_count_3 >= FILAMENT_RUNOUT_THRESHOLD - #endif - ) { - clear_cur_ui(); - card.pauseSDPrint(); - stop_print_time(); - uiCfg.print_state = PAUSING; - - if (gCfgItems.from_flash_pic) - flash_preview_begin = true; - else - default_preview_flg = true; - - lv_draw_printing(); - } - } - -#endif // FILAMENT_RUNOUT_SENSOR - #endif // HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/mks_ui/printer_operation.h b/Marlin/src/lcd/extui/mks_ui/printer_operation.h index d9c0b741f23e7..1413512d69326 100644 --- a/Marlin/src/lcd/extui/mks_ui/printer_operation.h +++ b/Marlin/src/lcd/extui/mks_ui/printer_operation.h @@ -28,8 +28,6 @@ #define MIN_FILE_PRINTED 100 //5000 void printer_state_polling(); -void filament_pin_setup(); -void filament_check(); #ifdef __cplusplus } /* C-declarations for C++ */