From d53eb691501e0031701faadb47bab88d6d27ba0d Mon Sep 17 00:00:00 2001 From: Yuri D'Elia Date: Thu, 12 May 2022 12:20:54 +0200 Subject: [PATCH] Manually cast to int when comparing against extrude_min_temp Avoid the automatic conversion to float to improve code size. --- Firmware/Marlin_main.cpp | 6 +++--- Firmware/planner.cpp | 2 +- Firmware/ultralcd.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Firmware/Marlin_main.cpp b/Firmware/Marlin_main.cpp index c2833a13..05d0426e 100644 --- a/Firmware/Marlin_main.cpp +++ b/Firmware/Marlin_main.cpp @@ -3421,7 +3421,7 @@ static void gcode_G80() go_home_with_z_lift(); // SERIAL_ECHOLNPGM("Go home finished"); //unretract (after PINDA preheat retraction) - if ((degHotend(active_extruder) > extrude_min_temp) && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() && (target_temperature_bed >= 50)) { + if (((int)degHotend(active_extruder) > extrude_min_temp) && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() && (target_temperature_bed >= 50)) { current_position[E_AXIS] += default_retraction; plan_buffer_line_curposXYZE(400); } @@ -9860,7 +9860,7 @@ static uint16_t nFSCheckCount=0; #ifdef PAT9125 fsensor_autoload_check_stop(); #endif //PAT9125 -//-// if (degHotend0() > extrude_min_temp) +//-// if ((int)degHotend0() > extrude_min_temp) if(0) { Sound_MakeCustom(50,1000,false); @@ -10801,7 +10801,7 @@ static void temp_compensation_start() { custom_message_type = CustomMsg::TempCompPreheat; custom_message_state = PINDA_HEAT_T + 1; lcd_update(2); - if (degHotend(active_extruder) > extrude_min_temp) { + if ((int)degHotend(active_extruder) > extrude_min_temp) { current_position[E_AXIS] -= default_retraction; } plan_buffer_line_curposXYZE(400, active_extruder); diff --git a/Firmware/planner.cpp b/Firmware/planner.cpp index 4c3b6694..16f4dfee 100644 --- a/Firmware/planner.cpp +++ b/Firmware/planner.cpp @@ -833,7 +833,7 @@ void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate #ifdef PREVENT_DANGEROUS_EXTRUDE if(target[E_AXIS]!=position[E_AXIS]) { - if(degHotend(active_extruder) extrude_min_temp) + if ((int)degHotend0() > extrude_min_temp) { if (lcd_encoder != 0) {