Skip to content

Commit 73d0f36

Browse files
SilverCorynextux
authored andcommitted
Allow bypass for cold E movement (MarlinFirmware#19606)
1 parent fd891a7 commit 73d0f36

File tree

3 files changed

+62
-44
lines changed

3 files changed

+62
-44
lines changed

Marlin/src/lcd/menu/menu_motion.cpp

+48-31
Original file line numberDiff line numberDiff line change
@@ -170,11 +170,6 @@ void _goto_manual_move(const float scale) {
170170

171171
void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int8_t eindex=-1) {
172172
_manual_move_func_ptr = func;
173-
#if ENABLED(PREVENT_COLD_EXTRUSION)
174-
const bool too_cold = axis == E_AXIS && thermalManager.tooColdToExtrude(eindex >= 0 ? eindex : active_extruder);
175-
#else
176-
constexpr bool too_cold = false;
177-
#endif
178173
START_MENU();
179174
if (LCD_HEIGHT >= 4) {
180175
switch (axis) {
@@ -187,35 +182,57 @@ void _menu_move_distance(const AxisEnum axis, const screenFunc_t func, const int
187182
break;
188183
}
189184
}
190-
if (too_cold)
191-
BACK_ITEM(MSG_HOTEND_TOO_COLD);
192-
else {
193-
BACK_ITEM(MSG_MOVE_AXIS);
194-
SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); });
195-
SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); });
196-
SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); });
197-
if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) {
198-
// Determine digits needed right of decimal
199-
constexpr uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 :
200-
!UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2;
201-
PGM_P const label = GET_TEXT(MSG_MOVE_Z_DIST);
202-
char tmp[strlen_P(label) + 10 + 1], numstr[10];
203-
sprintf_P(tmp, label, dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr));
204-
205-
#if DISABLED(HAS_GRAPHICAL_TFT)
206-
extern const char NUL_STR[];
207-
SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); });
208-
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
209-
lcd_put_u8str(tmp);
210-
MENU_ITEM_ADDON_END();
211-
#else
212-
SUBMENU_P(tmp, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); });
213-
#endif
214-
}
185+
186+
BACK_ITEM(MSG_MOVE_AXIS);
187+
SUBMENU(MSG_MOVE_10MM, []{ _goto_manual_move(10); });
188+
SUBMENU(MSG_MOVE_1MM, []{ _goto_manual_move( 1); });
189+
SUBMENU(MSG_MOVE_01MM, []{ _goto_manual_move( 0.1f); });
190+
if (axis == Z_AXIS && (SHORT_MANUAL_Z_MOVE) > 0.0f && (SHORT_MANUAL_Z_MOVE) < 0.1f) {
191+
// Determine digits needed right of decimal
192+
constexpr uint8_t digs = !UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 1000 - int((SHORT_MANUAL_Z_MOVE) * 1000)) ? 4 :
193+
!UNEAR_ZERO((SHORT_MANUAL_Z_MOVE) * 100 - int((SHORT_MANUAL_Z_MOVE) * 100)) ? 3 : 2;
194+
PGM_P const label = GET_TEXT(MSG_MOVE_Z_DIST);
195+
char tmp[strlen_P(label) + 10 + 1], numstr[10];
196+
sprintf_P(tmp, label, dtostrf(SHORT_MANUAL_Z_MOVE, 1, digs, numstr));
197+
198+
#if DISABLED(HAS_GRAPHICAL_TFT)
199+
extern const char NUL_STR[];
200+
SUBMENU_P(NUL_STR, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); });
201+
MENU_ITEM_ADDON_START(0 + ENABLED(HAS_MARLINUI_HD44780));
202+
lcd_put_u8str(tmp);
203+
MENU_ITEM_ADDON_END();
204+
#else
205+
SUBMENU_P(tmp, []{ _goto_manual_move(float(SHORT_MANUAL_Z_MOVE)); });
206+
#endif
215207
}
216208
END_MENU();
217209
}
218210

211+
#if E_MANUAL
212+
213+
inline void _goto_menu_move_distance_e() {
214+
ui.goto_screen([]{ _menu_move_distance(E_AXIS, []{ lcd_move_e(); }, -1); });
215+
}
216+
217+
inline void _menu_move_distance_e_maybe() {
218+
#if ENABLED(PREVENT_COLD_EXTRUSION)
219+
const bool too_cold = thermalManager.tooColdToExtrude(active_extruder);
220+
if (too_cold) {
221+
ui.goto_screen([]{
222+
MenuItem_confirm::select_screen(
223+
GET_TEXT(MSG_BUTTON_PROCEED), GET_TEXT(MSG_BACK),
224+
_goto_menu_move_distance_e, ui.goto_previous_screen,
225+
GET_TEXT(MSG_HOTEND_TOO_COLD), (const char *)nullptr, PSTR("!")
226+
);
227+
});
228+
return;
229+
}
230+
#endif
231+
_goto_menu_move_distance_e();
232+
}
233+
234+
#endif // E_MANUAL
235+
219236
void menu_move() {
220237
START_MENU();
221238
BACK_ITEM(MSG_MOTION);
@@ -278,7 +295,7 @@ void menu_move() {
278295
#if E_MANUAL
279296

280297
// The current extruder
281-
SUBMENU(MSG_MOVE_E, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(); }, -1); });
298+
SUBMENU(MSG_MOVE_E, []{ _menu_move_distance_e_maybe(); });
282299

283300
#define SUBMENU_MOVE_E(N) SUBMENU_N(N, MSG_MOVE_EN, []{ _menu_move_distance(E_AXIS, []{ lcd_move_e(MenuItemBase::itemIndex); }, MenuItemBase::itemIndex); });
284301

buildroot/tests/mega1280-tests

+1-9
Original file line numberDiff line numberDiff line change
@@ -52,16 +52,8 @@ exec_test $1 $2 "RAMPS | DELTA | RRD LCD | DELTA_AUTO_CALIBRATION | DELTA_CALIBR
5252
# Delta Config (generic) + ABL bilinear + BLTOUCH
5353
use_example_configs delta/generic
5454
opt_set LCD_LANGUAGE cz
55-
opt_set X_DRIVER_TYPE L6470
56-
opt_set Y_DRIVER_TYPE L6470
57-
opt_set Z_DRIVER_TYPE L6470
58-
opt_add L6470_CHAIN_SCK_PIN 53
59-
opt_add L6470_CHAIN_MISO_PIN 49
60-
opt_add L6470_CHAIN_MOSI_PIN 40
61-
opt_add L6470_CHAIN_SS_PIN 42
62-
opt_add "ENABLE_RESET_L64XX_CHIPS(V) NOOP"
6355
opt_enable REPRAP_DISCOUNT_SMART_CONTROLLER DELTA_CALIBRATION_MENU AUTO_BED_LEVELING_BILINEAR BLTOUCH
64-
exec_test $1 $2 "DELTA | L6470 | RRD LCD | ABL Bilinear | BLTOUCH"
56+
exec_test $1 $2 "DELTA | RRD LCD | ABL Bilinear | BLTOUCH"
6557

6658
# clean up
6759
restore_configs

buildroot/tests/mega2560-tests

+13-4
Original file line numberDiff line numberDiff line change
@@ -256,13 +256,22 @@ exec_test $1 $2 "Full-featured CR-10S config"
256256
#exec_test $1 $2 "Stuff"
257257

258258
#
259-
# Delta Config (generic) + UBL + ALLEN_KEY + OLED_PANEL_TINYBOY2 + EEPROM_SETTINGS
259+
# Delta Config (generic) + UBL + ALLEN_KEY + EEPROM_SETTINGS + OLED_PANEL_TINYBOY2
260260
#
261261
use_example_configs delta/generic
262+
opt_enable RESTORE_LEVELING_AFTER_G28 EEPROM_SETTINGS EEPROM_CHITCHAT \
263+
Z_PROBE_ALLEN_KEY AUTO_BED_LEVELING_UBL \
264+
OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY DELTA_CALIBRATION_MENU
262265
opt_set LCD_LANGUAGE ko_KR
263-
opt_enable AUTO_BED_LEVELING_UBL RESTORE_LEVELING_AFTER_G28 Z_PROBE_ALLEN_KEY EEPROM_SETTINGS EEPROM_CHITCHAT \
264-
OLED_PANEL_TINYBOY2 MESH_EDIT_GFX_OVERLAY
265-
exec_test $1 $2 "RAMPS | DELTA | OLED_PANEL_TINYBOY2 | UBL | Allen Key | EEPROM"
266+
opt_set X_DRIVER_TYPE L6470
267+
opt_set Y_DRIVER_TYPE L6470
268+
opt_set Z_DRIVER_TYPE L6470
269+
opt_add L6470_CHAIN_SCK_PIN 53
270+
opt_add L6470_CHAIN_MISO_PIN 49
271+
opt_add L6470_CHAIN_MOSI_PIN 40
272+
opt_add L6470_CHAIN_SS_PIN 42
273+
opt_add "ENABLE_RESET_L64XX_CHIPS(V) NOOP"
274+
exec_test $1 $2 "DELTA, RAMPS, L6470, UBL, Allen Key, EEPROM, OLED_PANEL_TINYBOY2..."
266275

267276
#
268277
# Delta Config (FLSUN AC because it's complex)

0 commit comments

Comments
 (0)