Browse Source

octoprint stop fix

NotaRobotexe 4 years ago
parent
commit
8fb30f886a
3 changed files with 6 additions and 3 deletions
  1. 5 1
      Firmware/Marlin_main.cpp
  2. 1 1
      Firmware/temperature.cpp
  3. 0 1
      Firmware/ultralcd.cpp

+ 5 - 1
Firmware/Marlin_main.cpp

@@ -6734,6 +6734,10 @@ Sigma_Exit:
 	}
 	break;
 
+  case 603: { //! M603 - Stop print
+		lcd_print_stop();
+	}
+
 #ifdef PINDA_THERMISTOR
 	case 860: // M860 - Wait for PINDA thermistor to reach target temperature.
 	{
@@ -9501,7 +9505,6 @@ void restore_print_from_ram_and_continue(float e_move)
 		card.setIndex(saved_sdpos);
 		sdpos_atomic = saved_sdpos;
 		card.sdprinting = true;
-		printf_P(PSTR("ok\n")); //dummy response because of octoprint is waiting for this
 	}
 	else if (saved_printing_type == PRINTING_TYPE_USB) { //was usb printing
 		gcode_LastN = saved_sdpos; //saved_sdpos was reused for storing line number when usb printing
@@ -9511,6 +9514,7 @@ void restore_print_from_ram_and_continue(float e_move)
 	else {
 		//not sd printing nor usb printing
 	}
+	printf_P(PSTR("ok\n")); //dummy response because of octoprint is waiting for this
 	lcd_setstatuspgm(_T(WELCOME_MSG));
 	saved_printing = false;
 }

+ 1 - 1
Firmware/temperature.cpp

@@ -547,7 +547,7 @@ void fanSpeedError(unsigned char _fan) {
 		}
 		else {
 			fan_check_error = EFCE_DETECTED;
-
+      SERIAL_ECHOLNPGM("// action:pause"); //for octoprint
 		}
 	}
 	else {

+ 0 - 1
Firmware/ultralcd.cpp

@@ -6952,7 +6952,6 @@ void lcd_print_stop()
      if(!card.sdprinting)
           {
           SERIAL_ECHOLNPGM("// action:cancel");   // for Octoprint
-          return;
           }
 	saved_printing = false;
 	cancel_heatup = true;