Skip to content

Commit

Permalink
G80: make temp_compensation_retracted global
Browse files Browse the repository at this point in the history
  • Loading branch information
gudnimg committed Aug 16, 2023
1 parent 154fe4e commit d76cea1
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions Firmware/Marlin_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ uint8_t newFanSpeed = 0;
float retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
#endif

#ifndef PINDA_THERMISTOR
static bool temp_compensation_retracted = false;
#endif // !PINDA_THERMISTOR

#ifdef PS_DEFAULT_OFF
bool powersupply = false;
#else
Expand Down Expand Up @@ -385,7 +389,7 @@ static void gcode_G28(bool home_x_axis, bool home_y_axis, bool home_z_axis);
static void gcode_M105();

#ifndef PINDA_THERMISTOR
static bool temp_compensation_start();
static void temp_compensation_start();
static void temp_compensation_apply();
#endif

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

#ifndef PINDA_THERMISTOR
static bool temp_compensation_retracted = false;
if (run == false && eeprom_read_byte((uint8_t *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() == true && target_temperature_bed >= 50)
{
temp_compensation_retracted = temp_compensation_start();
temp_compensation_start();
run = true;
repeatcommand_front(); // repeat G80 with all its parameters
enquecommand_front_P(G28W);
Expand Down Expand Up @@ -10242,14 +10245,13 @@ void bed_analysis(float x_dimension, float y_dimension, int x_points_num, int y_
#endif //HEATBED_ANALYSIS

#ifndef PINDA_THERMISTOR
static bool temp_compensation_start() {
bool retracted = false;
static void temp_compensation_start() {
custom_message_type = CustomMsg::TempCompPreheat;
custom_message_state = PINDA_HEAT_T + 1;
lcd_update(2);
if ((int)degHotend(active_extruder) > extrude_min_temp) {
if (!temp_compensation_retracted && (int)degHotend(active_extruder) > extrude_min_temp) {
temp_compensation_retracted = true;
current_position[E_AXIS] -= default_retraction;
retracted = true;
}
plan_buffer_line_curposXYZE(400);

Expand All @@ -10268,7 +10270,6 @@ static bool temp_compensation_start() {
}
custom_message_type = CustomMsg::Status;
custom_message_state = 0;
return retracted;
}

static void temp_compensation_apply() {
Expand Down

0 comments on commit d76cea1

Please sign in to comment.