|
@@ -499,19 +499,16 @@ FORCE_INLINE void process_commands()
|
499
|
499
|
case 1: // G1
|
500
|
500
|
get_coordinates(); // For X Y Z E F
|
501
|
501
|
prepare_move();
|
502
|
|
- previous_millis_cmd = millis();
|
503
|
502
|
//ClearToSend();
|
504
|
503
|
return;
|
505
|
504
|
//break;
|
506
|
505
|
case 2: // G2 - CW ARC
|
507
|
506
|
get_arc_coordinates();
|
508
|
507
|
prepare_arc_move(true);
|
509
|
|
- previous_millis_cmd = millis();
|
510
|
508
|
return;
|
511
|
509
|
case 3: // G3 - CCW ARC
|
512
|
510
|
get_arc_coordinates();
|
513
|
511
|
prepare_arc_move(false);
|
514
|
|
- previous_millis_cmd = millis();
|
515
|
512
|
return;
|
516
|
513
|
case 4: // G4 dwell
|
517
|
514
|
LCD_MESSAGEPGM("DWELL...");
|
|
@@ -521,7 +518,7 @@ FORCE_INLINE void process_commands()
|
521
|
518
|
|
522
|
519
|
st_synchronize();
|
523
|
520
|
codenum += millis(); // keep track of when we started waiting
|
524
|
|
-
|
|
521
|
+ previous_millis_cmd = millis();
|
525
|
522
|
while(millis() < codenum ){
|
526
|
523
|
manage_heater();
|
527
|
524
|
}
|
|
@@ -837,6 +834,7 @@ FORCE_INLINE void process_commands()
|
837
|
834
|
}
|
838
|
835
|
LCD_MESSAGEPGM("Heating done.");
|
839
|
836
|
starttime=millis();
|
|
837
|
+ previous_millis_cmd = millis();
|
840
|
838
|
}
|
841
|
839
|
break;
|
842
|
840
|
case 190: // M190 - Wait bed for heater to reach target.
|
|
@@ -860,6 +858,7 @@ FORCE_INLINE void process_commands()
|
860
|
858
|
manage_heater();
|
861
|
859
|
}
|
862
|
860
|
LCD_MESSAGEPGM("Bed done.");
|
|
861
|
+ previous_millis_cmd = millis();
|
863
|
862
|
#endif
|
864
|
863
|
break;
|
865
|
864
|
|
|
@@ -1149,6 +1148,7 @@ FORCE_INLINE void get_arc_coordinates()
|
1149
|
1148
|
|
1150
|
1149
|
void prepare_move()
|
1151
|
1150
|
{
|
|
1151
|
+
|
1152
|
1152
|
if (min_software_endstops) {
|
1153
|
1153
|
if (destination[X_AXIS] < 0) destination[X_AXIS] = 0.0;
|
1154
|
1154
|
if (destination[Y_AXIS] < 0) destination[Y_AXIS] = 0.0;
|
|
@@ -1165,6 +1165,7 @@ void prepare_move()
|
1165
|
1165
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|
1166
|
1166
|
current_position[i] = destination[i];
|
1167
|
1167
|
}
|
|
1168
|
+ previous_millis_cmd = millis();
|
1168
|
1169
|
}
|
1169
|
1170
|
|
1170
|
1171
|
void prepare_arc_move(char isclockwise) {
|
|
@@ -1179,6 +1180,7 @@ void prepare_arc_move(char isclockwise) {
|
1179
|
1180
|
for(int8_t i=0; i < NUM_AXIS; i++) {
|
1180
|
1181
|
current_position[i] = destination[i];
|
1181
|
1182
|
}
|
|
1183
|
+ previous_millis_cmd = millis();
|
1182
|
1184
|
}
|
1183
|
1185
|
|
1184
|
1186
|
void manage_inactivity(byte debug)
|
|
@@ -1194,6 +1196,20 @@ void manage_inactivity(byte debug)
|
1194
|
1196
|
disable_z();
|
1195
|
1197
|
disable_e();
|
1196
|
1198
|
}
|
|
1199
|
+ #ifdef EXTRUDER_RUNOUT_PREVENT
|
|
1200
|
+ if( (millis()-previous_millis_cmd) > EXTRUDER_RUNOUT_SECONDS*1000 )
|
|
1201
|
+ if(degHotend(active_extruder)>EXTRUDER_RUNOUT_MINTEMP)
|
|
1202
|
+ {
|
|
1203
|
+ enable_e();
|
|
1204
|
+ float oldepos=current_position[E_AXIS];
|
|
1205
|
+ float oldedes=destination[E_AXIS];
|
|
1206
|
+ plan_buffer_line(current_position[X_AXIS], current_position[Y_AXIS], current_position[Z_AXIS], current_position[E_AXIS]+EXTRUDER_RUNOUT_EXTRUDE, EXTRUDER_RUNOUT_SPEED*feedmultiply/60/100.0, active_extruder);
|
|
1207
|
+ current_position[E_AXIS]=oldepos;
|
|
1208
|
+ destination[E_AXIS]=oldedes;
|
|
1209
|
+ plan_set_e_position(oldepos);
|
|
1210
|
+ previous_millis_cmd=millis();
|
|
1211
|
+ }
|
|
1212
|
+ #endif
|
1197
|
1213
|
check_axes_activity();
|
1198
|
1214
|
}
|
1199
|
1215
|
|