Browse Source

Merge pull request #3611 from alephobjects/M108_cancel_heatup

Introduce M108 cancel wait for heatup/cooldown of the hotend and bed
Scott Lahteine 9 years ago
parent
commit
e48502866b
1 changed files with 13 additions and 0 deletions
  1. 13
    0
      Marlin/Marlin_main.cpp

+ 13
- 0
Marlin/Marlin_main.cpp View File

160
  * M105 - Read current temp
160
  * M105 - Read current temp
161
  * M106 - Fan on
161
  * M106 - Fan on
162
  * M107 - Fan off
162
  * M107 - Fan off
163
+ * M108 - Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser
163
  * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
164
  * M109 - Sxxx Wait for extruder current temp to reach target temp. Waits only when heating
164
  *        Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
165
  *        Rxxx Wait for extruder current temp to reach target temp. Waits when heating and cooling
165
  *        IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
166
  *        IF AUTOTEMP is enabled, S<mintemp> B<maxtemp> F<factor>. Exit autotemp by any M109 without F
1103
 
1104
 
1104
       // If command was e-stop process now
1105
       // If command was e-stop process now
1105
       if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED));
1106
       if (strcmp(command, "M112") == 0) kill(PSTR(MSG_KILLED));
1107
+      if (strcmp(command, "M108") == 0) cancel_heatup = true;
1106
 
1108
 
1107
       #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0
1109
       #if defined(NO_TIMEOUTS) && NO_TIMEOUTS > 0
1108
         last_command_time = ms;
1110
         last_command_time = ms;
4517
 #endif // FAN_COUNT > 0
4519
 #endif // FAN_COUNT > 0
4518
 
4520
 
4519
 /**
4521
 /**
4522
+ * M108: Cancel heatup and wait for the hotend and bed, this G-code is asynchronously handled in the get_serial_commands() parser
4523
+ */
4524
+inline void gcode_M108() {
4525
+  cancel_heatup = true;
4526
+}
4527
+
4528
+/**
4520
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
4529
  * M109: Sxxx Wait for extruder(s) to reach temperature. Waits only when heating.
4521
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
4530
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
4522
  */
4531
  */
6954
         KEEPALIVE_STATE(NOT_BUSY);
6963
         KEEPALIVE_STATE(NOT_BUSY);
6955
         return; // "ok" already printed
6964
         return; // "ok" already printed
6956
 
6965
 
6966
+      case 108:
6967
+        gcode_M108();
6968
+        break;
6969
+
6957
       case 109: // M109: Wait for temperature
6970
       case 109: // M109: Wait for temperature
6958
         gcode_M109();
6971
         gcode_M109();
6959
         break;
6972
         break;

Loading…
Cancel
Save