Skip to content

Commit 56bc2f1

Browse files
authored
Merge pull request prusa3d#3495 from wavexx/extrude_min_temp
Replace EXTRUDE_MINTEMP with the configurable extrude_min_temp
2 parents 9466945 + d53eb69 commit 56bc2f1

File tree

4 files changed

+15
-14
lines changed

4 files changed

+15
-14
lines changed

Firmware/Marlin_main.cpp

+6-6
Original file line numberDiff line numberDiff line change
@@ -3376,7 +3376,7 @@ static void gcode_G80()
33763376
go_home_with_z_lift();
33773377
// SERIAL_ECHOLNPGM("Go home finished");
33783378
//unretract (after PINDA preheat retraction)
3379-
if ((degHotend(active_extruder) > EXTRUDE_MINTEMP) && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() && (target_temperature_bed >= 50)) {
3379+
if (((int)degHotend(active_extruder) > extrude_min_temp) && eeprom_read_byte((unsigned char *)EEPROM_TEMP_CAL_ACTIVE) && calibration_status_pinda() && (target_temperature_bed >= 50)) {
33803380
current_position[E_AXIS] += default_retraction;
33813381
plan_buffer_line_curposXYZE(400);
33823382
}
@@ -7729,8 +7729,8 @@ SERIAL_PROTOCOLPGM("\n\n");
77297729
*/
77307730
case 302:
77317731
{
7732-
float temp = .0;
7733-
if (code_seen('S')) temp=code_value();
7732+
int temp = 0;
7733+
if (code_seen('S')) temp=code_value_short();
77347734
set_extrude_min_temp(temp);
77357735
}
77367736
break;
@@ -9679,7 +9679,7 @@ static uint16_t nFSCheckCount=0;
96799679
#ifdef PAT9125
96809680
fsensor_autoload_check_stop();
96819681
#endif //PAT9125
9682-
//-// if (degHotend0() > EXTRUDE_MINTEMP)
9682+
//-// if ((int)degHotend0() > extrude_min_temp)
96839683
if(0)
96849684
{
96859685
Sound_MakeCustom(50,1000,false);
@@ -9695,7 +9695,7 @@ if(0)
96959695
*/
96969696
eFilamentAction=FilamentAction::AutoLoad;
96979697
bFilamentFirstRun=false;
9698-
if(target_temperature[0]>=EXTRUDE_MINTEMP){
9698+
if(target_temperature[0] >= extrude_min_temp){
96999699
bFilamentPreheatState=true;
97009700
// mFilamentItem(target_temperature[0],target_temperature_bed);
97019701
menu_submenu(mFilamentItemForce);
@@ -10620,7 +10620,7 @@ static void temp_compensation_start() {
1062010620
custom_message_type = CustomMsg::TempCompPreheat;
1062110621
custom_message_state = PINDA_HEAT_T + 1;
1062210622
lcd_update(2);
10623-
if (degHotend(active_extruder) > EXTRUDE_MINTEMP) {
10623+
if ((int)degHotend(active_extruder) > extrude_min_temp) {
1062410624
current_position[E_AXIS] -= default_retraction;
1062510625
}
1062610626
plan_buffer_line_curposXYZE(400, active_extruder);

Firmware/planner.cpp

+4-4
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static uint8_t g_cntr_planner_queue_min = 0;
122122
//=============================private variables ============================
123123
//===========================================================================
124124
#ifdef PREVENT_DANGEROUS_EXTRUDE
125-
float extrude_min_temp=EXTRUDE_MINTEMP;
125+
int extrude_min_temp = EXTRUDE_MINTEMP;
126126
#endif
127127

128128
#ifdef LIN_ADVANCE
@@ -833,7 +833,7 @@ void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate
833833
#ifdef PREVENT_DANGEROUS_EXTRUDE
834834
if(target[E_AXIS]!=position[E_AXIS])
835835
{
836-
if(degHotend(active_extruder)<extrude_min_temp)
836+
if((int)degHotend(active_extruder)<extrude_min_temp)
837837
{
838838
position[E_AXIS]=target[E_AXIS]; //behave as if the move really took place, but ignore E part
839839
#ifdef LIN_ADVANCE
@@ -1434,9 +1434,9 @@ void plan_reset_next_e()
14341434
}
14351435

14361436
#ifdef PREVENT_DANGEROUS_EXTRUDE
1437-
void set_extrude_min_temp(float temp)
1437+
void set_extrude_min_temp(int temp)
14381438
{
1439-
extrude_min_temp=temp;
1439+
extrude_min_temp = temp;
14401440
}
14411441
#endif
14421442

Firmware/planner.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,8 @@ extern void planner_abort_hard();
262262
extern bool waiting_inside_plan_buffer_line_print_aborted;
263263

264264
#ifdef PREVENT_DANGEROUS_EXTRUDE
265-
void set_extrude_min_temp(float temp);
265+
extern int extrude_min_temp;
266+
void set_extrude_min_temp(int temp);
266267
#endif
267268

268269
void reset_acceleration_rates();

Firmware/ultralcd.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2312,7 +2312,7 @@ static void lcd_menu_AutoLoadFilament()
23122312
static void preheat_or_continue()
23132313
{
23142314
bFilamentFirstRun = false;
2315-
if (target_temperature[0] >= EXTRUDE_MINTEMP)
2315+
if (target_temperature[0] >= extrude_min_temp)
23162316
{
23172317
bFilamentPreheatState = true;
23182318
mFilamentItem(target_temperature[0], target_temperature_bed);
@@ -2445,7 +2445,7 @@ static void _lcd_move(const char *name, uint8_t axis, int min, int max)
24452445

24462446
void lcd_move_e()
24472447
{
2448-
if (degHotend0() > EXTRUDE_MINTEMP)
2448+
if ((int)degHotend0() > extrude_min_temp)
24492449
{
24502450
if (lcd_encoder != 0)
24512451
{
@@ -5555,7 +5555,7 @@ static void mmu_cut_filament_menu()
55555555
{
55565556
eFilamentAction=FilamentAction::MmuCut;
55575557
bFilamentFirstRun=false;
5558-
if(target_temperature[0]>=EXTRUDE_MINTEMP)
5558+
if(target_temperature[0] >= extrude_min_temp)
55595559
{
55605560
bFilamentPreheatState=true;
55615561
mFilamentItem(target_temperature[0],target_temperature_bed);

0 commit comments

Comments
 (0)