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,6 +4086,9 @@ inline void gcode_M104() {
4086 4086
   if (setTargetedHotend(104)) return;
4087 4087
   if (DEBUGGING(DRYRUN)) return;
4088 4088
 
4089
+  // Start hook must happen before setTargetHotend()
4090
+  print_job_start();
4091
+
4089 4092
   if (code_seen('S')) {
4090 4093
     float temp = code_value();
4091 4094
     setTargetHotend(temp, target_extruder);
@@ -4093,9 +4096,11 @@ inline void gcode_M104() {
4093 4096
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
4094 4097
         setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
4095 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 4106
 #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
@@ -4220,12 +4225,12 @@ inline void gcode_M105() {
4220 4225
 inline void gcode_M109() {
4221 4226
   bool no_wait_for_cooling = true;
4222 4227
 
4223
-  // Start hook must happen before setTargetHotend()
4224
-  print_job_start();
4225
-
4226 4228
   if (setTargetedHotend(109)) return;
4227 4229
   if (DEBUGGING(DRYRUN)) return;
4228 4230
 
4231
+  // Start hook must happen before setTargetHotend()
4232
+  print_job_start();
4233
+
4229 4234
   no_wait_for_cooling = code_seen('S');
4230 4235
   if (no_wait_for_cooling || code_seen('R')) {
4231 4236
     float temp = code_value();
@@ -7699,17 +7704,6 @@ bool print_job_start(millis_t t /* = 0 */) {
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 7707
  * Check if the running print job has finished and stop the timer
7714 7708
  *
7715 7709
  * When the target temperature for all extruders is zero then we assume that the
@@ -7727,3 +7721,14 @@ bool print_job_stop(bool force /* = false */) {
7727 7721
   print_job_stop_ms = millis();
7728 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