Explorar el Código

M104 was not starting the print timer

João Brázio hace 9 años
padre
commit
187c183c20
Se han modificado 1 ficheros con 20 adiciones y 15 borrados
  1. 20
    15
      Marlin/Marlin_main.cpp

+ 20
- 15
Marlin/Marlin_main.cpp Ver fichero

@@ -4073,6 +4073,9 @@ inline void gcode_M104() {
4073 4073
   if (setTargetedHotend(104)) return;
4074 4074
   if (marlin_debug_flags & DEBUG_DRYRUN) return;
4075 4075
 
4076
+  // Start hook must happen before setTargetHotend()
4077
+  print_job_start();
4078
+
4076 4079
   if (code_seen('S')) {
4077 4080
     float temp = code_value();
4078 4081
     setTargetHotend(temp, target_extruder);
@@ -4080,9 +4083,11 @@ inline void gcode_M104() {
4080 4083
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
4081 4084
         setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
4082 4085
     #endif
4086
+
4087
+    if (temp > degHotend(target_extruder)) LCD_MESSAGEPGM(MSG_HEATING);
4083 4088
   }
4084 4089
 
4085
-  print_job_stop();
4090
+  if (print_job_stop()) LCD_MESSAGEPGM(WELCOME_MSG);
4086 4091
 }
4087 4092
 
4088 4093
 #if HAS_TEMP_0 || HAS_TEMP_BED || ENABLED(HEATER_0_USES_MAX6675)
@@ -4207,12 +4212,12 @@ inline void gcode_M105() {
4207 4212
 inline void gcode_M109() {
4208 4213
   bool no_wait_for_cooling = true;
4209 4214
 
4210
-  // Start hook must happen before setTargetHotend()
4211
-  print_job_start();
4212
-
4213 4215
   if (setTargetedHotend(109)) return;
4214 4216
   if (marlin_debug_flags & DEBUG_DRYRUN) return;
4215 4217
 
4218
+  // Start hook must happen before setTargetHotend()
4219
+  print_job_start();
4220
+
4216 4221
   no_wait_for_cooling = code_seen('S');
4217 4222
   if (no_wait_for_cooling || code_seen('R')) {
4218 4223
     float temp = code_value();
@@ -7677,17 +7682,6 @@ bool print_job_start(millis_t t /* = 0 */) {
7677 7682
 }
7678 7683
 
7679 7684
 /**
7680
- * Output the print job timer in seconds
7681
- *
7682
- * @return the number of seconds
7683
- */
7684
-millis_t print_job_timer() {
7685
-  if (!print_job_start_ms) return 0;
7686
-  return (((print_job_stop_ms > print_job_start_ms)
7687
-    ? print_job_stop_ms : millis()) - print_job_start_ms) / 1000;
7688
-}
7689
-
7690
-/**
7691 7685
  * Check if the running print job has finished and stop the timer
7692 7686
  *
7693 7687
  * When the target temperature for all extruders is zero then we assume that the
@@ -7705,3 +7699,14 @@ bool print_job_stop(bool force /* = false */) {
7705 7699
   print_job_stop_ms = millis();
7706 7700
   return true;
7707 7701
 }
7702
+
7703
+/**
7704
+ * Output the print job timer in seconds
7705
+ *
7706
+ * @return the number of seconds
7707
+ */
7708
+millis_t print_job_timer() {
7709
+  if (!print_job_start_ms) return 0;
7710
+  return (((print_job_stop_ms > print_job_start_ms)
7711
+    ? print_job_stop_ms : millis()) - print_job_start_ms) / 1000;
7712
+}

Loading…
Cancelar
Guardar