|
@@ -7310,7 +7310,7 @@ inline void gcode_M503() {
|
7310
|
7310
|
}
|
7311
|
7311
|
}
|
7312
|
7312
|
|
7313
|
|
- bool busy_doing_M600 = false;
|
|
7313
|
+ static bool busy_doing_M600 = false;
|
7314
|
7314
|
|
7315
|
7315
|
/**
|
7316
|
7316
|
* M600: Pause for filament change
|
|
@@ -7351,8 +7351,6 @@ inline void gcode_M503() {
|
7351
|
7351
|
#define RUNPLAN(RATE_MM_S) line_to_destination(RATE_MM_S);
|
7352
|
7352
|
#endif
|
7353
|
7353
|
|
7354
|
|
- KEEPALIVE_STATE(IN_HANDLER);
|
7355
|
|
-
|
7356
|
7354
|
// Initial retract before move to filament change position
|
7357
|
7355
|
if (code_seen('E')) destination[E_AXIS] += code_value_axis_units(E_AXIS);
|
7358
|
7356
|
#if defined(FILAMENT_CHANGE_RETRACT_LENGTH) && FILAMENT_CHANGE_RETRACT_LENGTH > 0
|
|
@@ -7409,10 +7407,9 @@ inline void gcode_M503() {
|
7409
|
7407
|
disable_e3();
|
7410
|
7408
|
delay(100);
|
7411
|
7409
|
|
7412
|
|
- millis_t nozzle_timeout = millis() + FILAMENT_CHANGE_NOZZLE_TIMEOUT*1000L;
|
|
7410
|
+ millis_t nozzle_timeout = millis() + FILAMENT_CHANGE_NOZZLE_TIMEOUT * 1000L;
|
7413
|
7411
|
bool nozzle_timed_out = false;
|
7414
|
7412
|
float temps[4];
|
7415
|
|
- int iii;
|
7416
|
7413
|
|
7417
|
7414
|
// Wait for filament insert by user and press button
|
7418
|
7415
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
|
|
@@ -7422,62 +7419,62 @@ inline void gcode_M503() {
|
7422
|
7419
|
wait_for_user = true; // LCD click or M108 will clear this
|
7423
|
7420
|
next_buzz = 0;
|
7424
|
7421
|
runout_beep = 0;
|
7425
|
|
- for( iii=0; iii<HOTENDS; iii++) //Save nozzle temps
|
7426
|
|
- temps[iii] = thermalManager.target_temperature[iii];
|
|
7422
|
+ HOTEND_LOOP() temps[e] = thermalManager.target_temperature[e]; // Save nozzle temps
|
7427
|
7423
|
|
7428
|
7424
|
while (wait_for_user) {
|
7429
|
7425
|
millis_t current_ms = millis();
|
7430
|
|
- if (nozzle_timed_out == true)
|
|
7426
|
+ if (nozzle_timed_out)
|
7431
|
7427
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
|
|
7428
|
+
|
7432
|
7429
|
#if HAS_BUZZER
|
7433
|
7430
|
filament_change_beep();
|
7434
|
|
- #endif //HAS_BUZZER
|
|
7431
|
+ #endif
|
7435
|
7432
|
|
7436
|
7433
|
if (current_ms >= nozzle_timeout) {
|
7437
|
|
- if (nozzle_timed_out == false ) {
|
7438
|
|
- nozzle_timed_out = true; // if the nozzle time out happens, remember we turned off the nozzles.
|
7439
|
|
- for( iii=0; iii<HOTENDS; iii++) // turn off all the nozzles
|
7440
|
|
- thermalManager.setTargetHotend( 0.0 , iii );
|
7441
|
|
-
|
|
7434
|
+ if (!nozzle_timed_out) {
|
|
7435
|
+ nozzle_timed_out = true; // on nozzle timeout remember the nozzles need to be reheated
|
|
7436
|
+ HOTEND_LOOP() thermalManager.setTargetHotend(0, e); // Turn off all the nozzles
|
7442
|
7437
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_CLICK_TO_HEAT_NOZZLE);
|
7443
|
7438
|
}
|
7444
|
7439
|
}
|
7445
|
7440
|
idle(true);
|
7446
|
7441
|
}
|
7447
|
7442
|
|
7448
|
|
- if (nozzle_timed_out == true ) { // Turn nozzles back on if we turned them off.
|
7449
|
|
- for( iii=0; iii<HOTENDS; iii++)
|
7450
|
|
- thermalManager.setTargetHotend( temps[iii] , iii );
|
7451
|
|
- lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
|
7452
|
|
- }
|
|
7443
|
+ if (nozzle_timed_out) // Turn nozzles back on if they were turned off
|
|
7444
|
+ HOTEND_LOOP() thermalManager.setTargetHotend(temps[e], e);
|
7453
|
7445
|
|
7454
|
|
-KEEP_CHECKING_TEMPS:
|
7455
|
|
- idle();
|
7456
|
|
- for( iii=0; iii<HOTENDS; iii++){
|
7457
|
|
- if (abs(thermalManager.degHotend(iii)-temps[iii]) > 3 ) {
|
7458
|
|
- lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
|
7459
|
|
- goto KEEP_CHECKING_TEMPS;
|
|
7446
|
+ // Show "wait for heating"
|
|
7447
|
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_WAIT_FOR_NOZZLES_TO_HEAT);
|
|
7448
|
+
|
|
7449
|
+ wait_for_heatup = true;
|
|
7450
|
+ while (wait_for_heatup) {
|
|
7451
|
+ idle();
|
|
7452
|
+ wait_for_heatup = false;
|
|
7453
|
+ HOTEND_LOOP() {
|
|
7454
|
+ if (abs(thermalManager.degHotend(e) - temps[e]) > 3) {
|
|
7455
|
+ wait_for_heatup = true;
|
|
7456
|
+ break;
|
|
7457
|
+ }
|
7460
|
7458
|
}
|
7461
|
7459
|
}
|
7462
|
7460
|
|
|
7461
|
+ // Show "insert filament"
|
|
7462
|
+ if (nozzle_timed_out)
|
|
7463
|
+ lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
|
|
7464
|
+
|
7463
|
7465
|
wait_for_user = true; // LCD click or M108 will clear this
|
7464
|
7466
|
next_buzz = 0;
|
7465
|
7467
|
runout_beep = 0;
|
7466
|
|
- while (wait_for_user) {
|
7467
|
|
- if (nozzle_timed_out == true)
|
7468
|
|
- lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_INSERT);
|
7469
|
|
- else break;
|
|
7468
|
+ while (wait_for_user && nozzle_timed_out) {
|
7470
|
7469
|
#if HAS_BUZZER
|
7471
|
7470
|
filament_change_beep();
|
7472
|
7471
|
#endif
|
7473
|
7472
|
idle(true);
|
7474
|
7473
|
}
|
7475
|
7474
|
|
7476
|
|
- // Show load message
|
|
7475
|
+ // Show "load" message
|
7477
|
7476
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_LOAD);
|
7478
|
7477
|
|
7479
|
|
- idle();
|
7480
|
|
-
|
7481
|
7478
|
// Load filament
|
7482
|
7479
|
if (code_seen('L')) destination[E_AXIS] -= code_value_axis_units(E_AXIS);
|
7483
|
7480
|
#if defined(FILAMENT_CHANGE_LOAD_LENGTH) && FILAMENT_CHANGE_LOAD_LENGTH > 0
|
|
@@ -7504,8 +7501,6 @@ KEEP_CHECKING_TEMPS:
|
7504
|
7501
|
|
7505
|
7502
|
lcd_filament_change_show_message(FILAMENT_CHANGE_MESSAGE_RESUME);
|
7506
|
7503
|
|
7507
|
|
- KEEPALIVE_STATE(IN_HANDLER);
|
7508
|
|
-
|
7509
|
7504
|
// Set extruder to saved position
|
7510
|
7505
|
destination[E_AXIS] = current_position[E_AXIS] = lastpos[E_AXIS];
|
7511
|
7506
|
planner.set_e_position_mm(current_position[E_AXIS]);
|
|
@@ -10144,14 +10139,15 @@ void manage_inactivity(bool ignore_stepper_queue/*=false*/) {
|
10144
|
10139
|
millis_t ms = millis();
|
10145
|
10140
|
|
10146
|
10141
|
if (max_inactive_time && ELAPSED(ms, previous_cmd_ms + max_inactive_time)) kill(PSTR(MSG_KILLED));
|
10147
|
|
-
|
10148
|
|
- #if ENABLED(FILAMENT_CHANGE_FEATURE)
|
10149
|
|
- #ifdef STEPPER_MOTORS_DONT_TIMEOUT_DURING_FILAMENT_CHANGE
|
10150
|
|
- if (busy_doing_M600 == false ) // We only allow the stepper motors to time out if
|
10151
|
|
- #endif // we are not in the middle of an M600 command.
|
|
10142
|
+
|
|
10143
|
+ // Prevent steppers timing-out in the middle of M600
|
|
10144
|
+ #if ENABLED(FILAMENT_CHANGE_FEATURE) && ENABLED(FILAMENT_CHANGE_NO_STEPPER_TIMEOUT)
|
|
10145
|
+ #define M600_TEST !busy_doing_M600
|
|
10146
|
+ #else
|
|
10147
|
+ #define M600_TEST true
|
10152
|
10148
|
#endif
|
10153
|
10149
|
|
10154
|
|
- if (stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
|
|
10150
|
+ if (M600_TEST && stepper_inactive_time && ELAPSED(ms, previous_cmd_ms + stepper_inactive_time)
|
10155
|
10151
|
&& !ignore_stepper_queue && !planner.blocks_queued()) {
|
10156
|
10152
|
#if ENABLED(DISABLE_INACTIVE_X)
|
10157
|
10153
|
disable_x();
|