@@ -352,25 +352,35 @@ xyz_pos_t Probe::offset; // Initialized by settings.load()
352
352
FORCE_INLINE void probe_specific_action (const bool deploy) {
353
353
DEBUG_SECTION (log_psa, " Probe::probe_specific_action" , DEBUGGING (LEVELING));
354
354
#if ENABLED(PAUSE_BEFORE_DEPLOY_STOW)
355
- do {
356
- #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED)
357
- if (deploy != PROBE_TRIGGERED ()) break ;
358
- #endif
359
355
360
- OKAY_BUZZ ();
356
+ // Start preheating before waiting for user confirmation that the probe is ready.
357
+ TERN_ (PREHEAT_BEFORE_PROBING, if (deploy) probe.preheat_for_probing (0 , PROBING_BED_TEMP, true ));
358
+
359
+ FSTR_P const ds_str = deploy ? GET_TEXT_F (MSG_MANUAL_DEPLOY) : GET_TEXT_F (MSG_MANUAL_STOW);
360
+ ui.return_to_status (); // To display the new status message
361
+ ui.set_status (ds_str, 99 );
362
+ SERIAL_ECHOLNF (deploy ? GET_EN_TEXT_F (MSG_MANUAL_DEPLOY) : GET_EN_TEXT_F (MSG_MANUAL_STOW));
363
+
364
+ OKAY_BUZZ ();
365
+
366
+ #if ENABLED(PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED)
367
+ // Wait for the probe to be attached or detached before asking for explicit user confirmation
368
+ // Allow the user to interrupt
369
+ {
370
+ KEEPALIVE_STATE (PAUSED_FOR_USER);
371
+ TERN_ (HAS_RESUME_CONTINUE, wait_for_user = true );
372
+ while (deploy == PROBE_TRIGGERED () && TERN1 (HAS_RESUME_CONTINUE, wait_for_user)) idle_no_sleep ();
373
+ TERN_ (HAS_RESUME_CONTINUE, wait_for_user = false );
374
+ OKAY_BUZZ ();
375
+ }
376
+ #endif
361
377
362
- FSTR_P const ds_str = deploy ? GET_TEXT_F (MSG_MANUAL_DEPLOY) : GET_TEXT_F (MSG_MANUAL_STOW );
363
- ui. return_to_status (); // To display the new status message
364
- ui. set_status ( ds_str, 99 );
365
- SERIAL_ECHOLNF (deploy ? GET_EN_TEXT_F (MSG_MANUAL_DEPLOY) : GET_EN_TEXT_F (MSG_MANUAL_STOW ));
378
+ TERN_ (HOST_PROMPT_SUPPORT, hostui. continue_prompt (ds_str) );
379
+ TERN_ (EXTENSIBLE_UI, ExtUI::onUserConfirmRequired (ds_str));
380
+ TERN_ (DWIN_LCD_PROUI, DWIN_Popup_Confirm (ICON_BLTouch, ds_str, FPSTR (CONTINUE_STR)) );
381
+ TERN_ (HAS_RESUME_CONTINUE, wait_for_user_response ( ));
366
382
367
- TERN_ (HOST_PROMPT_SUPPORT, hostui.continue_prompt (ds_str));
368
- TERN_ (EXTENSIBLE_UI, ExtUI::onUserConfirmRequired (ds_str));
369
- TERN_ (DWIN_LCD_PROUI, DWIN_Popup_Confirm (ICON_BLTouch, ds_str, FPSTR (CONTINUE_STR)));
370
- TERN_ (HAS_RESUME_CONTINUE, wait_for_user_response ());
371
- ui.reset_status ();
372
-
373
- } while (ENABLED (PAUSE_PROBE_DEPLOY_WHEN_TRIGGERED));
383
+ ui.reset_status ();
374
384
375
385
#endif // PAUSE_BEFORE_DEPLOY_STOW
376
386
@@ -435,15 +445,15 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
435
445
* - If a preheat input is higher than the current target, raise the target temperature.
436
446
* - If a preheat input is higher than the current temperature, wait for stabilization.
437
447
*/
438
- void Probe::preheat_for_probing (const celsius_t hotend_temp, const celsius_t bed_temp) {
448
+ void Probe::preheat_for_probing (const celsius_t hotend_temp, const celsius_t bed_temp, const bool early /* =false */ ) {
439
449
#if HAS_HOTEND && (PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP)
440
450
#define WAIT_FOR_NOZZLE_HEAT
441
451
#endif
442
452
#if HAS_HEATED_BED && (PROBING_BED_TEMP || LEVELING_BED_TEMP)
443
453
#define WAIT_FOR_BED_HEAT
444
454
#endif
445
455
446
- LCD_MESSAGE (MSG_PREHEATING);
456
+ if (!early) LCD_MESSAGE (MSG_PREHEATING);
447
457
448
458
DEBUG_ECHOPGM (" Preheating " );
449
459
@@ -453,23 +463,23 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
453
463
DEBUG_ECHOPGM (" hotend (" , hotendPreheat, " )" );
454
464
thermalManager.setTargetHotend (hotendPreheat, 0 );
455
465
}
456
- #elif ENABLED(WAIT_FOR_BED_HEAT)
457
- constexpr celsius_t hotendPreheat = 0 ;
458
466
#endif
459
467
460
468
#if ENABLED(WAIT_FOR_BED_HEAT)
461
469
const celsius_t bedPreheat = bed_temp > thermalManager.degTargetBed () ? bed_temp : 0 ;
462
470
if (bedPreheat) {
463
- if (hotendPreheat) DEBUG_ECHOPGM (" and " );
471
+ if (TERN0 (WAIT_FOR_NOZZLE_HEAT, hotendPreheat) ) DEBUG_ECHOPGM (" and " );
464
472
DEBUG_ECHOPGM (" bed (" , bedPreheat, " )" );
465
473
thermalManager.setTargetBed (bedPreheat);
466
474
}
467
475
#endif
468
476
469
477
DEBUG_EOL ();
470
478
471
- TERN_ (WAIT_FOR_NOZZLE_HEAT, if (hotend_temp > thermalManager.wholeDegHotend (0 ) + (TEMP_WINDOW)) thermalManager.wait_for_hotend (0 ));
472
- TERN_ (WAIT_FOR_BED_HEAT, if (bed_temp > thermalManager.wholeDegBed () + (TEMP_BED_WINDOW)) thermalManager.wait_for_bed_heating ());
479
+ if (!early) {
480
+ TERN_ (WAIT_FOR_NOZZLE_HEAT, if (hotend_temp > thermalManager.wholeDegHotend (0 ) + (TEMP_WINDOW)) thermalManager.wait_for_hotend (0 ));
481
+ TERN_ (WAIT_FOR_BED_HEAT, if (bed_temp > thermalManager.wholeDegBed () + (TEMP_BED_WINDOW)) thermalManager.wait_for_bed_heating ());
482
+ }
473
483
}
474
484
475
485
#endif
0 commit comments