|
@@ -4463,15 +4463,6 @@ inline void gcode_M109() {
|
4463
|
4463
|
if (code_seen('B')) autotemp_max = code_value();
|
4464
|
4464
|
#endif
|
4465
|
4465
|
|
4466
|
|
- bool wants_to_cool = isCoolingHotend(target_extruder);
|
4467
|
|
-
|
4468
|
|
-
|
4469
|
|
- if (no_wait_for_cooling && wants_to_cool) return;
|
4470
|
|
-
|
4471
|
|
-
|
4472
|
|
-
|
4473
|
|
- if (wants_to_cool && degTargetHotend(target_extruder) < (EXTRUDE_MINTEMP)/2) return;
|
4474
|
|
-
|
4475
|
4466
|
#if TEMP_RESIDENCY_TIME > 0
|
4476
|
4467
|
millis_t residency_start_ms = 0;
|
4477
|
4468
|
|
|
@@ -4481,11 +4472,15 @@ inline void gcode_M109() {
|
4481
|
4472
|
#define TEMP_CONDITIONS (wants_to_cool ? isCoolingHotend(target_extruder) : isHeatingHotend(target_extruder))
|
4482
|
4473
|
#endif
|
4483
|
4474
|
|
4484
|
|
- KEEPALIVE_STATE(NOT_BUSY);
|
4485
|
|
-
|
|
4475
|
+ float theTarget = -1;
|
|
4476
|
+ bool wants_to_cool;
|
4486
|
4477
|
cancel_heatup = false;
|
4487
|
4478
|
millis_t now, next_temp_ms = 0;
|
|
4479
|
+
|
|
4480
|
+ KEEPALIVE_STATE(NOT_BUSY);
|
|
4481
|
+
|
4488
|
4482
|
do {
|
|
4483
|
+
|
4489
|
4484
|
now = millis();
|
4490
|
4485
|
if (ELAPSED(now, next_temp_ms)) {
|
4491
|
4486
|
next_temp_ms = now + 1000UL;
|
|
@@ -4506,12 +4501,25 @@ inline void gcode_M109() {
|
4506
|
4501
|
#endif
|
4507
|
4502
|
}
|
4508
|
4503
|
|
|
4504
|
+
|
|
4505
|
+ if (theTarget != degTargetHotend(target_extruder)) {
|
|
4506
|
+ theTarget = degTargetHotend(target_extruder);
|
|
4507
|
+ wants_to_cool = isCoolingHotend(target_extruder);
|
|
4508
|
+
|
|
4509
|
+
|
|
4510
|
+ if (no_wait_for_cooling && wants_to_cool) break;
|
|
4511
|
+
|
|
4512
|
+
|
|
4513
|
+
|
|
4514
|
+ if (wants_to_cool && theTarget < (EXTRUDE_MINTEMP)/2) break;
|
|
4515
|
+ }
|
|
4516
|
+
|
4509
|
4517
|
idle();
|
4510
|
4518
|
refresh_cmd_timeout();
|
4511
|
4519
|
|
4512
|
4520
|
#if TEMP_RESIDENCY_TIME > 0
|
4513
|
4521
|
|
4514
|
|
- float temp_diff = fabs(degTargetHotend(target_extruder) - degHotend(target_extruder));
|
|
4522
|
+ float temp_diff = fabs(theTarget - degHotend(target_extruder));
|
4515
|
4523
|
|
4516
|
4524
|
if (!residency_start_ms) {
|
4517
|
4525
|
|
|
@@ -4543,11 +4551,6 @@ inline void gcode_M109() {
|
4543
|
4551
|
bool no_wait_for_cooling = code_seen('S');
|
4544
|
4552
|
if (no_wait_for_cooling || code_seen('R')) setTargetBed(code_value());
|
4545
|
4553
|
|
4546
|
|
- bool wants_to_cool = isCoolingBed();
|
4547
|
|
-
|
4548
|
|
-
|
4549
|
|
- if (no_wait_for_cooling && wants_to_cool) return;
|
4550
|
|
-
|
4551
|
4554
|
#if TEMP_BED_RESIDENCY_TIME > 0
|
4552
|
4555
|
millis_t residency_start_ms = 0;
|
4553
|
4556
|
|
|
@@ -4557,11 +4560,13 @@ inline void gcode_M109() {
|
4557
|
4560
|
#define TEMP_BED_CONDITIONS (wants_to_cool ? isCoolingBed() : isHeatingBed())
|
4558
|
4561
|
#endif
|
4559
|
4562
|
|
|
4563
|
+ float theTarget = -1;
|
|
4564
|
+ bool wants_to_cool;
|
4560
|
4565
|
cancel_heatup = false;
|
4561
|
4566
|
millis_t now, next_temp_ms = 0;
|
4562
|
4567
|
|
4563
|
|
-
|
4564
|
4568
|
KEEPALIVE_STATE(NOT_BUSY);
|
|
4569
|
+
|
4565
|
4570
|
do {
|
4566
|
4571
|
now = millis();
|
4567
|
4572
|
if (ELAPSED(now, next_temp_ms)) {
|
|
@@ -4581,6 +4586,19 @@ inline void gcode_M109() {
|
4581
|
4586
|
#endif
|
4582
|
4587
|
}
|
4583
|
4588
|
|
|
4589
|
+
|
|
4590
|
+ if (theTarget != degTargetBed()) {
|
|
4591
|
+ theTarget = degTargetBed();
|
|
4592
|
+ wants_to_cool = isCoolingBed();
|
|
4593
|
+
|
|
4594
|
+
|
|
4595
|
+ if (no_wait_for_cooling && wants_to_cool) break;
|
|
4596
|
+
|
|
4597
|
+
|
|
4598
|
+
|
|
4599
|
+ if (wants_to_cool && theTarget < (EXTRUDE_MINTEMP)/2) break;
|
|
4600
|
+ }
|
|
4601
|
+
|
4584
|
4602
|
idle();
|
4585
|
4603
|
refresh_cmd_timeout();
|
4586
|
4604
|
|