Browse Source

Merge pull request #3282 from jbrazio/bugfix/m104-timer-wont-start

M104 not starting the print timer
Scott Lahteine 9 years ago
parent
commit
8bf5f7c676
1 changed files with 20 additions and 15 deletions
  1. 20
    15
      Marlin/Marlin_main.cpp

+ 20
- 15
Marlin/Marlin_main.cpp View File

4086
   if (setTargetedHotend(104)) return;
4086
   if (setTargetedHotend(104)) return;
4087
   if (DEBUGGING(DRYRUN)) return;
4087
   if (DEBUGGING(DRYRUN)) return;
4088
 
4088
 
4089
+  // Start hook must happen before setTargetHotend()
4090
+  print_job_start();
4091
+
4089
   if (code_seen('S')) {
4092
   if (code_seen('S')) {
4090
     float temp = code_value();
4093
     float temp = code_value();
4091
     setTargetHotend(temp, target_extruder);
4094
     setTargetHotend(temp, target_extruder);
4093
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
4096
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
4094
         setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
4097
         setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
4095
     #endif
4098
     #endif
4099
+
4100
+    if (temp > degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
4096
   }
4101
   }
4097
 
4102
 
4098
-  print_job_stop();
4103
+  if (print_job_stop()) LCD_MESSAGEPGM(WELCOME_MSG);
4099
 }
4104
 }
4100
 
4105
 
4101
 #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
4106
 #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
4220
 inline void gcode_M109() {
4225
 inline void gcode_M109() {
4221
   bool no_wait_for_cooling = true;
4226
   bool no_wait_for_cooling = true;
4222
 
4227
 
4223
-  // Start hook must happen before setTargetHotend()
4224
-  print_job_start();
4225
-
4226
   if (setTargetedHotend(109)) return;
4228
   if (setTargetedHotend(109)) return;
4227
   if (DEBUGGING(DRYRUN)) return;
4229
   if (DEBUGGING(DRYRUN)) return;
4228
 
4230
 
4231
+  // Start hook must happen before setTargetHotend()
4232
+  print_job_start();
4233
+
4229
   no_wait_for_cooling = code_seen('S');
4234
   no_wait_for_cooling = code_seen('S');
4230
   if (no_wait_for_cooling || code_seen('R')) {
4235
   if (no_wait_for_cooling || code_seen('R')) {
4231
     float temp = code_value();
4236
     float temp = code_value();
7699
 }
7704
 }
7700
 
7705
 
7701
 /**
7706
 /**
7702
- * Output the print job timer in seconds
7703
- *
7704
- * @return the number of seconds
7705
- */
7706
-millis_t print_job_timer() {
7707
-  if (!print_job_start_ms) return 0;
7708
-  return (((print_job_stop_ms > print_job_start_ms)
7709
-    ? print_job_stop_ms : millis()) - print_job_start_ms) / 1000;
7710
-}
7711
-
7712
-/**
7713
  * Check if the running print job has finished and stop the timer
7707
  * Check if the running print job has finished and stop the timer
7714
  *
7708
  *
7715
  * When the target temperature for all extruders is zero then we assume that the
7709
  * When the target temperature for all extruders is zero then we assume that the
7727
   print_job_stop_ms = millis();
7721
   print_job_stop_ms = millis();
7728
   return true;
7722
   return true;
7729
 }
7723
 }
7724
+
7725
+/**
7726
+ * Output the print job timer in seconds
7727
+ *
7728
+ * @return the number of seconds
7729
+ */
7730
+millis_t print_job_timer() {
7731
+  if (!print_job_start_ms) return 0;
7732
+  return (((print_job_stop_ms > print_job_start_ms)
7733
+    ? print_job_stop_ms : millis()) - print_job_start_ms) / 1000;
7734
+}

Loading…
Cancel
Save