Browse Source

Introduce M108 cancel heatup for the hotend and bed

This G-code is asynchronously handled in the get_serial_commands() parser.
gralco 9 years ago
parent
commit
840e13f664
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      Marlin/Marlin_main.cpp

+ 13
- 0
Marlin/Marlin_main.cpp View File

149
  * M105 - Read current temp
149
  * M105 - Read current temp
150
  * M106 - Fan on
150
  * M106 - Fan on
151
  * M107 - Fan off
151
  * M107 - Fan off
152
+ * M108 - Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser
152
  * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
153
  * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
153
  *        Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
154
  *        Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
154
  *        IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
155
  *        IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
1018
 
1019
 
1019
       // If command was e-stop process now
1020
       // If command was e-stop process now
1020
       if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED));
1021
       if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED));
1022
+      if (strcmp(command, "M108") == 0) cancel_heatup = true;
1021
 
1023
 
1022
       #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0
1024
       #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0
1023
         last_command_time = ms;
1025
         last_command_time = ms;
4406
 #endif // FAN_COUNT > 0
4408
 #endif // FAN_COUNT > 0
4407
 
4409
 
4408
 /**
4410
 /**
4411
+ * M108: Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser
4412
+ */
4413
+inline void gcode_M108() {
4414
+  cancel_heatup = true;
4415
+}
4416
+
4417
+/**
4409
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
4418
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
4410
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
4419
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
4411
  */
4420
  */
6667
         KEEPALIVE_STATE(NOT_BUSY);
6676
         KEEPALIVE_STATE(NOT_BUSY);
6668
         return; // "ok" already printed
6677
         return; // "ok" already printed
6669
 
6678
 
6679
+      case 108:
6680
+        gcode_M108();
6681
+        break;
6682
+
6670
       case 109: // M109: Wait for temperature
6683
       case 109: // M109: Wait for temperature
6671
         gcode_M109();
6684
         gcode_M109();
6672
         break;
6685
         break;

Loading…
Cancel
Save