Преглед на файлове

Clean up the code a bit

João Brázio преди 9 години
родител
ревизия
793cd0ae3b
променени са 3 файла, в които са добавени 9 реда и са изтрити 10 реда
  1. 5
    6
      Marlin/Marlin_main.cpp
  2. 2
    2
      Marlin/dogm_lcd_implementation.h
  3. 2
    2
      Marlin/ultralcd_implementation_hitachi_HD44780.h

+ 5
- 6
Marlin/Marlin_main.cpp Целия файл

@@ -3837,7 +3837,7 @@ inline void gcode_M104() {
3837 3837
   // Detect if a print job has finished.
3838 3838
   // When the target temperature for all extruders is zero then we must have
3839 3839
   // finished printing.
3840
-  if( print_job_start_ms != 0 ) {
3840
+  if (print_job_start_ms) {
3841 3841
     bool all_extruders_cooling = true;
3842 3842
     for (int i = 0; i < EXTRUDERS; i++) if( degTargetHotend(i) > 0 ) {
3843 3843
       all_extruders_cooling = false;
@@ -3957,7 +3957,6 @@ inline void gcode_M105() {
3957 3957
  *       Rxxx Wait for extruder(s) to reach temperature. Waits when heating and cooling.
3958 3958
  */
3959 3959
 inline void gcode_M109() {
3960
-  float temp;
3961 3960
   bool no_wait_for_cooling = true;
3962 3961
 
3963 3962
   if (setTargetedHotend(109)) return;
@@ -3965,16 +3964,16 @@ inline void gcode_M109() {
3965 3964
 
3966 3965
   no_wait_for_cooling = code_seen('S');
3967 3966
   if (no_wait_for_cooling || code_seen('R')) {
3968
-    temp = code_value();
3967
+    float temp = code_value();
3969 3968
     setTargetHotend(temp, target_extruder);
3970 3969
     #if ENABLED(DUAL_X_CARRIAGE)
3971 3970
       if (dual_x_carriage_mode == DXC_DUPLICATION_MODE && target_extruder == 0)
3972 3971
         setTargetHotend1(temp == 0.0 ? 0.0 : temp + duplicate_extruder_temp_offset);
3973 3972
     #endif
3974
-  }
3975 3973
 
3976
-  // Only makes sense to show the heating message if we're in fact heating.
3977
-  if( temp > 0 ) LCD_MESSAGEPGM(MSG_HEATING);
3974
+    // Only makes sense to show the heating message if we're in fact heating.
3975
+    if (temp > 0) LCD_MESSAGEPGM(MSG_HEATING);
3976
+  }
3978 3977
 
3979 3978
   #if ENABLED(AUTOTEMP)
3980 3979
     autotemp_enabled = code_seen('F');

+ 2
- 2
Marlin/dogm_lcd_implementation.h Целия файл

@@ -306,8 +306,8 @@ static void lcd_implementation_status_screen() {
306 306
 
307 307
     u8g.setPrintPos(80,48);
308 308
     if (print_job_start_ms != 0) {
309
-      uint16_t time = ((print_job_stop_ms > print_job_start_ms)
310
-                       ? print_job_stop_ms : millis()) / 60000 - print_job_start_ms / 60000;
309
+      uint16_t time = (((print_job_stop_ms > print_job_start_ms)
310
+                       ? print_job_stop_ms : millis()) - print_job_start_ms) / 60000;
311 311
       lcd_print(itostr2(time/60));
312 312
       lcd_print(':');
313 313
       lcd_print(itostr2(time%60));

+ 2
- 2
Marlin/ultralcd_implementation_hitachi_HD44780.h Целия файл

@@ -707,8 +707,8 @@ static void lcd_implementation_status_screen() {
707 707
     lcd.setCursor(LCD_WIDTH - 6, 2);
708 708
     lcd.print(LCD_STR_CLOCK[0]);
709 709
     if (print_job_start_ms != 0) {
710
-      uint16_t time = ((print_job_stop_ms > print_job_start_ms)
711
-                       ? print_job_stop_ms : millis()) / 60000 - print_job_start_ms / 60000;
710
+      uint16_t time = (((print_job_stop_ms > print_job_start_ms)
711
+                       ? print_job_stop_ms : millis()) - print_job_start_ms) / 60000;
712 712
       lcd.print(itostr2(time / 60));
713 713
       lcd.print(':');
714 714
       lcd.print(itostr2(time % 60));

Loading…
Отказ
Запис