|
@@ -327,30 +327,61 @@ FORCE_INLINE void probe_specific_action(const bool deploy) {
|
327
|
327
|
|
328
|
328
|
#if EITHER(PREHEAT_BEFORE_PROBING, PREHEAT_BEFORE_LEVELING)
|
329
|
329
|
|
|
330
|
+ #if ENABLED(PREHEAT_BEFORE_PROBING)
|
|
331
|
+ #ifndef PROBING_NOZZLE_TEMP
|
|
332
|
+ #define PROBING_NOZZLE_TEMP 0
|
|
333
|
+ #endif
|
|
334
|
+ #ifndef PROBING_BED_TEMP
|
|
335
|
+ #define PROBING_BED_TEMP 0
|
|
336
|
+ #endif
|
|
337
|
+ #endif
|
|
338
|
+ #if ENABLED(PREHEAT_BEFORE_LEVELING)
|
|
339
|
+ #ifndef LEVELING_NOZZLE_TEMP
|
|
340
|
+ #define LEVELING_NOZZLE_TEMP 0
|
|
341
|
+ #endif
|
|
342
|
+ #ifndef LEVELING_BED_TEMP
|
|
343
|
+ #define LEVELING_BED_TEMP 0
|
|
344
|
+ #endif
|
|
345
|
+ #endif
|
|
346
|
+
|
330
|
347
|
/**
|
331
|
|
- * Do preheating as required before leveling or probing
|
|
348
|
+ * Do preheating as required before leveling or probing.
|
|
349
|
+ * - If a preheat input is higher than the current target, raise the target temperature.
|
|
350
|
+ * - If a preheat input is higher than the current temperature, wait for stabilization.
|
332
|
351
|
*/
|
333
|
352
|
void Probe::preheat_for_probing(const uint16_t hotend_temp, const uint16_t bed_temp) {
|
334
|
|
- #if PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP
|
|
353
|
+ #if HAS_HOTEND && (PROBING_NOZZLE_TEMP || LEVELING_NOZZLE_TEMP)
|
335
|
354
|
#define WAIT_FOR_NOZZLE_HEAT
|
336
|
355
|
#endif
|
337
|
|
- #if PROBING_BED_TEMP || LEVELING_BED_TEMP
|
|
356
|
+ #if HAS_HEATED_BED && (PROBING_BED_TEMP || LEVELING_BED_TEMP)
|
338
|
357
|
#define WAIT_FOR_BED_HEAT
|
339
|
358
|
#endif
|
340
|
|
- const uint16_t hotendPreheat = TERN0(WAIT_FOR_NOZZLE_HEAT, thermalManager.degHotend(0) < hotend_temp) ? hotend_temp : 0,
|
341
|
|
- bedPreheat = TERN0(WAIT_FOR_BED_HEAT, thermalManager.degBed() < bed_temp) ? bed_temp : 0;
|
|
359
|
+
|
342
|
360
|
DEBUG_ECHOPGM("Preheating ");
|
343
|
|
- if (hotendPreheat) {
|
344
|
|
- DEBUG_ECHOPAIR("hotend (", hotendPreheat, ") ");
|
345
|
|
- if (bedPreheat) DEBUG_ECHOPGM("and ");
|
346
|
|
- }
|
347
|
|
- if (bedPreheat) DEBUG_ECHOPAIR("bed (", bedPreheat, ") ");
|
|
361
|
+
|
|
362
|
+ #if ENABLED(WAIT_FOR_NOZZLE_HEAT)
|
|
363
|
+ const uint16_t hotendPreheat = hotend_temp > thermalManager.degTargetHotend(0) ? hotend_temp : 0;
|
|
364
|
+ if (hotendPreheat) {
|
|
365
|
+ DEBUG_ECHOPAIR("hotend (", hotendPreheat, ")");
|
|
366
|
+ thermalManager.setTargetHotend(hotendPreheat, 0);
|
|
367
|
+ }
|
|
368
|
+ #elif ENABLED(WAIT_FOR_BED_HEAT)
|
|
369
|
+ constexpr uint16_t hotendPreheat = 0;
|
|
370
|
+ #endif
|
|
371
|
+
|
|
372
|
+ #if ENABLED(WAIT_FOR_BED_HEAT)
|
|
373
|
+ const uint16_t bedPreheat = bed_temp > thermalManager.degTargetBed() ? bed_temp : 0;
|
|
374
|
+ if (bedPreheat) {
|
|
375
|
+ if (hotendPreheat) DEBUG_ECHOPGM(" and ");
|
|
376
|
+ DEBUG_ECHOPAIR("bed (", bedPreheat, ")");
|
|
377
|
+ thermalManager.setTargetBed(bedPreheat);
|
|
378
|
+ }
|
|
379
|
+ #endif
|
|
380
|
+
|
348
|
381
|
DEBUG_EOL();
|
349
|
382
|
|
350
|
|
- TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.setTargetHotend(hotendPreheat, 0));
|
351
|
|
- TERN_(WAIT_FOR_BED_HEAT, if (bedPreheat) thermalManager.setTargetBed(bedPreheat));
|
352
|
|
- TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotendPreheat) thermalManager.wait_for_hotend(0));
|
353
|
|
- TERN_(WAIT_FOR_BED_HEAT, if (bedPreheat) thermalManager.wait_for_bed_heating());
|
|
383
|
+ TERN_(WAIT_FOR_NOZZLE_HEAT, if (hotend_temp > thermalManager.degHotend(0) + (TEMP_WINDOW)) thermalManager.wait_for_hotend(0));
|
|
384
|
+ TERN_(WAIT_FOR_BED_HEAT, if (bed_temp > thermalManager.degBed() + (TEMP_BED_WINDOW)) thermalManager.wait_for_bed_heating());
|
354
|
385
|
}
|
355
|
386
|
|
356
|
387
|
#endif
|