Browse Source

Merge pull request #6311 from thinkyhead/rc_bare_M109_M190

Have M109 / M190 do nothing with no parameters
Scott Lahteine 7 years ago
parent
commit
4ea447959e
1 changed files with 16 additions and 27 deletions
  1. 16
    27
      Marlin/Marlin_main.cpp

+ 16
- 27
Marlin/Marlin_main.cpp View File

@@ -5854,10 +5854,9 @@ inline void gcode_M104() {
5854 5854
 
5855 5855
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
5856 5856
       /**
5857
-       * Stop the timer at the end of print, starting is managed by
5858
-       * 'heat and wait' M109.
5857
+       * Stop the timer at the end of print. Start is managed by 'heat and wait' M109.
5859 5858
        * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
5860
-       * stand by mode, for instance in a dual extruder setup, without affecting
5859
+       * standby mode, for instance in a dual extruder setup, without affecting
5861 5860
        * the running print timer.
5862 5861
        */
5863 5862
       if (code_value_temp_abs() <= (EXTRUDE_MINTEMP)/2) {
@@ -6039,7 +6038,7 @@ inline void gcode_M109() {
6039 6038
     if (target_extruder != active_extruder) return;
6040 6039
   #endif
6041 6040
 
6042
-  bool no_wait_for_cooling = code_seen('S');
6041
+  const bool no_wait_for_cooling = code_seen('S');
6043 6042
   if (no_wait_for_cooling || code_seen('R')) {
6044 6043
     thermalManager.setTargetHotend(code_value_temp_abs(), target_extruder);
6045 6044
     #if ENABLED(DUAL_X_CARRIAGE)
@@ -6049,24 +6048,21 @@ inline void gcode_M109() {
6049 6048
 
6050 6049
     #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
6051 6050
       /**
6052
-       * We use half EXTRUDE_MINTEMP here to allow nozzles to be put into hot
6053
-       * stand by mode, for instance in a dual extruder setup, without affecting
6051
+       * Use half EXTRUDE_MINTEMP to allow nozzles to be put into hot
6052
+       * standby mode, (e.g., in a dual extruder setup) without affecting
6054 6053
        * the running print timer.
6055 6054
        */
6056
-      if (code_value_temp_abs() <= (EXTRUDE_MINTEMP)/2) {
6055
+      if (code_value_temp_abs() <= (EXTRUDE_MINTEMP) / 2) {
6057 6056
         print_job_timer.stop();
6058 6057
         LCD_MESSAGEPGM(WELCOME_MSG);
6059 6058
       }
6060
-      /**
6061
-       * We do not check if the timer is already running because this check will
6062
-       * be done for us inside the Stopwatch::start() method thus a running timer
6063
-       * will not restart.
6064
-       */
6065
-      else print_job_timer.start();
6059
+      else
6060
+        print_job_timer.start();
6066 6061
     #endif
6067 6062
 
6068 6063
     if (thermalManager.isHeatingHotend(target_extruder)) lcd_status_printf_P(0, PSTR("E%i %s"), target_extruder + 1, MSG_HEATING);
6069 6064
   }
6065
+  else return;
6070 6066
 
6071 6067
   #if ENABLED(AUTOTEMP)
6072 6068
     planner.autotemp_M104_M109();
@@ -6079,7 +6075,7 @@ inline void gcode_M109() {
6079 6075
   #else
6080 6076
     // Loop until the temperature is very close target
6081 6077
     #define TEMP_CONDITIONS (wants_to_cool ? thermalManager.isCoolingHotend(target_extruder) : thermalManager.isHeatingHotend(target_extruder))
6082
-  #endif //TEMP_RESIDENCY_TIME > 0
6078
+  #endif
6083 6079
 
6084 6080
   float theTarget = -1.0, old_temp = 9999.0;
6085 6081
   bool wants_to_cool = false;
@@ -6134,7 +6130,7 @@ inline void gcode_M109() {
6134 6130
         residency_start_ms = now;
6135 6131
       }
6136 6132
 
6137
-    #endif //TEMP_RESIDENCY_TIME > 0
6133
+    #endif
6138 6134
 
6139 6135
     // Prevent a wait-forever situation if R is misused i.e. M109 R0
6140 6136
     if (wants_to_cool) {
@@ -6171,23 +6167,15 @@ inline void gcode_M109() {
6171 6167
     if (DEBUGGING(DRYRUN)) return;
6172 6168
 
6173 6169
     LCD_MESSAGEPGM(MSG_BED_HEATING);
6174
-    bool no_wait_for_cooling = code_seen('S');
6170
+    const bool no_wait_for_cooling = code_seen('S');
6175 6171
     if (no_wait_for_cooling || code_seen('R')) {
6176 6172
       thermalManager.setTargetBed(code_value_temp_abs());
6177 6173
       #if ENABLED(PRINTJOB_TIMER_AUTOSTART)
6178
-        if (code_value_temp_abs() > BED_MINTEMP) {
6179
-          /**
6180
-          * We start the timer when 'heating and waiting' command arrives, LCD
6181
-          * functions never wait. Cooling down managed by extruders.
6182
-          *
6183
-          * We do not check if the timer is already running because this check will
6184
-          * be done for us inside the Stopwatch::start() method thus a running timer
6185
-          * will not restart.
6186
-          */
6174
+        if (code_value_temp_abs() > BED_MINTEMP)
6187 6175
           print_job_timer.start();
6188
-        }
6189 6176
       #endif
6190 6177
     }
6178
+    else return;
6191 6179
 
6192 6180
     #if TEMP_BED_RESIDENCY_TIME > 0
6193 6181
       millis_t residency_start_ms = 0;
@@ -6196,7 +6184,7 @@ inline void gcode_M109() {
6196 6184
     #else
6197 6185
       // Loop until the temperature is very close target
6198 6186
       #define TEMP_BED_CONDITIONS (wants_to_cool ? thermalManager.isCoolingBed() : thermalManager.isHeatingBed())
6199
-    #endif //TEMP_BED_RESIDENCY_TIME > 0
6187
+    #endif
6200 6188
 
6201 6189
     float theTarget = -1.0, old_temp = 9999.0;
6202 6190
     bool wants_to_cool = false;
@@ -6378,6 +6366,7 @@ inline void gcode_M140() {
6378 6366
 
6379 6367
   /**
6380 6368
    * M145: Set the heatup state for a material in the LCD menu
6369
+   *
6381 6370
    *   S<material> (0=PLA, 1=ABS)
6382 6371
    *   H<hotend temp>
6383 6372
    *   B<bed temp>

Loading…
Cancel
Save