@@ -907,11 +907,10 @@ volatile bool Temperature::raw_temps_ready = false;
907
907
SERIAL_ECHOPGM (STR_MPC_AUTOTUNE);
908
908
SERIAL_ECHOLNPGM (STR_MPC_AUTOTUNE_INTERRUPTED);
909
909
TERN_ (DWIN_LCD_PROUI, DWIN_MPCTuning (MPC_INTERRUPTED));
910
- return false ;
910
+ return true ;
911
911
}
912
912
913
- wait_for_heatup = false ;
914
- return true ;
913
+ return false ;
915
914
};
916
915
917
916
struct OnExit {
@@ -964,7 +963,7 @@ volatile bool Temperature::raw_temps_ready = false;
964
963
965
964
wait_for_heatup = true ;
966
965
for (;;) { // Can be interrupted with M108
967
- if (! housekeeping (ms, current_temp, next_report_ms)) return ;
966
+ if (housekeeping (ms, current_temp, next_report_ms)) return ;
968
967
969
968
if (ELAPSED (ms, next_test_ms)) {
970
969
if (current_temp >= ambient_temp) {
@@ -975,6 +974,7 @@ volatile bool Temperature::raw_temps_ready = false;
975
974
next_test_ms += 10000UL ;
976
975
}
977
976
}
977
+ wait_for_heatup = false ;
978
978
979
979
#if HAS_FAN
980
980
set_fan_speed (EITHER (MPC_FAN_0_ALL_HOTENDS, MPC_FAN_0_ACTIVE_HOTEND) ? 0 : active_extruder, 0 );
@@ -986,7 +986,7 @@ volatile bool Temperature::raw_temps_ready = false;
986
986
SERIAL_ECHOLNPGM (STR_MPC_HEATING_PAST_200);
987
987
TERN (DWIN_LCD_PROUI, LCD_ALERTMESSAGE (MSG_MPC_HEATING_PAST_200), LCD_MESSAGE (MSG_HEATING));
988
988
hotend.target = 200 .0f ; // So M105 looks nice
989
- hotend.soft_pwm_amount = MPC_MAX >> 1 ;
989
+ hotend.soft_pwm_amount = ( MPC_MAX) >> 1 ;
990
990
const millis_t heat_start_time = next_test_ms = ms;
991
991
celsius_float_t temp_samples[16 ];
992
992
uint8_t sample_count = 0 ;
@@ -995,7 +995,7 @@ volatile bool Temperature::raw_temps_ready = false;
995
995
996
996
wait_for_heatup = true ;
997
997
for (;;) { // Can be interrupted with M108
998
- if (! housekeeping (ms, current_temp, next_report_ms)) return ;
998
+ if (housekeeping (ms, current_temp, next_report_ms)) return ;
999
999
1000
1000
if (ELAPSED (ms, next_test_ms)) {
1001
1001
// Record samples between 100C and 200C
@@ -1017,6 +1017,8 @@ volatile bool Temperature::raw_temps_ready = false;
1017
1017
next_test_ms += 1000UL * sample_distance;
1018
1018
}
1019
1019
}
1020
+ wait_for_heatup = false ;
1021
+
1020
1022
hotend.soft_pwm_amount = 0 ;
1021
1023
1022
1024
// Calculate physical constants from three equally-spaced samples
@@ -1052,7 +1054,7 @@ volatile bool Temperature::raw_temps_ready = false;
1052
1054
1053
1055
wait_for_heatup = true ;
1054
1056
for (;;) { // Can be interrupted with M108
1055
- if (! housekeeping (ms, current_temp, next_report_ms)) return ;
1057
+ if (housekeeping (ms, current_temp, next_report_ms)) return ;
1056
1058
1057
1059
if (ELAPSED (ms, next_test_ms)) {
1058
1060
hotend.soft_pwm_amount = (int )get_pid_output_hotend (active_extruder) >> 1 ;
@@ -1082,6 +1084,7 @@ volatile bool Temperature::raw_temps_ready = false;
1082
1084
break ;
1083
1085
}
1084
1086
}
1087
+ wait_for_heatup = false ;
1085
1088
1086
1089
const float power_fan0 = total_energy_fan0 * 1000 / test_duration;
1087
1090
mpc.ambient_xfer_coeff_fan0 = power_fan0 / (hotend.target - ambient_temp);
0 commit comments