Skip to content

Commit d76cea1

Browse files
committed
G80: make temp_compensation_retracted global
1 parent 154fe4e commit d76cea1

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Firmware/Marlin_main.cpp

+9-8
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,10 @@ uint8_t newFanSpeed = 0;
228228
float retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
229229
#endif
230230

231+
#ifndef PINDA_THERMISTOR
232+
static bool temp_compensation_retracted = false;
233+
#endif // !PINDA_THERMISTOR
234+
231235
#ifdef PS_DEFAULT_OFF
232236
bool powersupply = false;
233237
#else
@@ -385,7 +389,7 @@ static void gcode_G28(bool home_x_axis, bool home_y_axis, bool home_z_axis);
385389
static void gcode_M105();
386390

387391
#ifndef PINDA_THERMISTOR
388-
static bool temp_compensation_start();
392+
static void temp_compensation_start();
389393
static void temp_compensation_apply();
390394
#endif
391395

@@ -2838,10 +2842,9 @@ static void gcode_G80()
28382842
bool magnet_elimination = (eeprom_read_byte((uint8_t*)EEPROM_MBL_MAGNET_ELIMINATION) > 0);
28392843

28402844
#ifndef PINDA_THERMISTOR
2841-
static bool temp_compensation_retracted = false;
28422845
if (run == false && eeprom_read_byte((uint8_t *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() == true && target_temperature_bed >= 50)
28432846
{
2844-
temp_compensation_retracted = temp_compensation_start();
2847+
temp_compensation_start();
28452848
run = true;
28462849
repeatcommand_front(); // repeat G80 with all its parameters
28472850
enquecommand_front_P(G28W);
@@ -10242,14 +10245,13 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_
1024210245
#endif //HEATBED_ANALYSIS
1024310246

1024410247
#ifndef PINDA_THERMISTOR
10245-
static bool temp_compensation_start() {
10246-
bool retracted = false;
10248+
static void temp_compensation_start() {
1024710249
custom_message_type = CustomMsg::TempCompPreheat;
1024810250
custom_message_state = PINDA_HEAT_T + 1;
1024910251
lcd_update(2);
10250-
if ((int)degHotend(active_extruder) > extrude_min_temp) {
10252+
if (!temp_compensation_retracted && (int)degHotend(active_extruder) > extrude_min_temp) {
10253+
temp_compensation_retracted = true;
1025110254
current_position[E_AXIS] -= default_retraction;
10252-
retracted = true;
1025310255
}
1025410256
plan_buffer_line_curposXYZE(400);
1025510257

@@ -10268,7 +10270,6 @@ static bool temp_compensation_start() {
1026810270
}
1026910271
custom_message_type = CustomMsg::Status;
1027010272
custom_message_state = 0;
10271-
return retracted;
1027210273
}
1027310274

1027410275
static void temp_compensation_apply() {

0 commit comments

Comments
 (0)