🚸 MarlinUI Endstop Test Screen, and more (#25667)

This commit is contained in:
Scott Lahteine 2023-04-22 01:56:10 -05:00 committed by GitHub
parent 98277f2c1c
commit 4233e4864f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
22 changed files with 952 additions and 791 deletions

View file

@ -32,6 +32,10 @@
#include "../../MarlinCore.h"
#if ENABLED(LCD_ENDSTOP_TEST)
#include "../../module/endstops.h"
#endif
#if HAS_FILAMENT_SENSOR
#include "../../feature/runout.h"
#endif
@ -57,7 +61,7 @@
#include "../../core/debug_out.h"
#define HAS_DEBUG_MENU ENABLED(LCD_PROGRESS_BAR_TEST)
#define HAS_DEBUG_MENU EITHER(LCD_PROGRESS_BAR_TEST, LCD_ENDSTOP_TEST)
void menu_advanced_settings();
#if EITHER(DELTA_CALIBRATION_MENU, DELTA_AUTO_CALIBRATION)
@ -90,6 +94,83 @@ void menu_advanced_settings();
#endif // LCD_PROGRESS_BAR_TEST
#if ENABLED(LCD_ENDSTOP_TEST)
#include "../lcdprint.h"
#define __STOP_ITEM(F,S) PSTRING_ITEM_F_P(F, TEST(stops, S) ? PSTR(STR_ENDSTOP_HIT) : PSTR(STR_ENDSTOP_OPEN), SS_FULL)
#define _STOP_ITEM(L,S) __STOP_ITEM(F(L), S)
#define STOP_ITEM(A,I) _STOP_ITEM(STRINGIFY(A) STRINGIFY(I) " " TERN(A##_HOME_TO_MAX, "Max", "Min"), A##I##_ENDSTOP)
#define FIL_ITEM(N) PSTRING_ITEM_N_P(N-1, MSG_FILAMENT_EN, (READ(FIL_RUNOUT##N##_PIN) != FIL_RUNOUT##N##_STATE) ? PSTR("PRESENT") : PSTR("out"), SS_FULL);
static void endstop_test() {
if (ui.use_click()) {
ui.goto_previous_screen();
//endstops.enable_globally(false);
return;
}
TemporaryGlobalEndstopsState temp(true);
ui.defer_status_screen(true);
const Endstops::endstop_mask_t stops = endstops.state();
START_SCREEN();
STATIC_ITEM_F(GET_TEXT_F(MSG_ENDSTOP_TEST), SS_DEFAULT|SS_INVERT);
#if HAS_X_ENDSTOP
STOP_ITEM(X,);
#if ENABLED(X_DUAL_ENDSTOPS)
STOP_ITEM(X,2);
#endif
#endif
#if HAS_Y_ENDSTOP
STOP_ITEM(Y,);
#if ENABLED(Y_DUAL_ENDSTOPS)
STOP_ITEM(Y,2);
#endif
#endif
#if HAS_Z_ENDSTOP
STOP_ITEM(Z,);
#if ENABLED(Z_MULTI_ENDSTOPS)
STOP_ITEM(Z,2);
#if NUM_Z_STEPPERS >= 3
STOP_ITEM(Z,3);
#if NUM_Z_STEPPERS >= 4
STOP_ITEM(Z,4);
#endif
#endif
#endif
#endif
#if HAS_I_ENDSTOP
STOP_ITEM(I,);
#endif
#if HAS_J_ENDSTOP
STOP_ITEM(J,);
#endif
#if HAS_K_ENDSTOP
STOP_ITEM(K,);
#endif
#if HAS_U_ENDSTOP
STOP_ITEM(U,);
#endif
#if HAS_V_ENDSTOP
STOP_ITEM(V,);
#endif
#if HAS_W_ENDSTOP
STOP_ITEM(W,);
#endif
#if HAS_BED_PROBE && !HAS_DELTA_SENSORLESS_PROBING
__STOP_ITEM(GET_TEXT_F(MSG_Z_PROBE), Z_MIN_PROBE);
#endif
#if ENABLED(FILAMENT_RUNOUT_SENSOR)
REPEAT_1(NUM_RUNOUT_SENSORS, FIL_ITEM)
#endif
END_SCREEN();
ui.refresh(LCDVIEW_CALL_REDRAW_NEXT);
}
#endif // LCD_ENDSTOP_TEST
#if HAS_DEBUG_MENU
void menu_debug() {
@ -101,6 +182,10 @@ void menu_advanced_settings();
SUBMENU(MSG_PROGRESS_BAR_TEST, _progress_bar_test);
#endif
#if ENABLED(LCD_ENDSTOP_TEST)
SUBMENU(MSG_ENDSTOP_TEST, endstop_test);
#endif
END_MENU();
}
@ -161,7 +246,7 @@ void menu_advanced_settings();
}
#endif
#endif
#endif // HAS_MULTI_EXTRUDER
#if HAS_HOTEND_OFFSET
#include "../../module/motion.h"