Преглед изворни кода

Merge pull request #6893 from thinkyhead/bf_lcd_leveling_fixes

Patch PROBE_MANUALLY + LCD_BED_LEVELING
Scott Lahteine пре 8 година
родитељ
комит
5d6366d4e6

+ 13
- 17
Marlin/G26_Mesh_Validation_Tool.cpp Прегледај датотеку

131
   void set_destination_to_current();
131
   void set_destination_to_current();
132
   void set_current_to_destination();
132
   void set_current_to_destination();
133
   void prepare_move_to_destination();
133
   void prepare_move_to_destination();
134
-  void lcd_setstatuspgm(const char* const message, const uint8_t level);
134
+  void lcd_setstatusPGM(const char* const message, const int8_t level);
135
   void sync_plan_position_e();
135
   void sync_plan_position_e();
136
   void chirp_at_user();
136
   void chirp_at_user();
137
 
137
 
181
     safe_delay(10);                       // Wait for click to settle
181
     safe_delay(10);                       // Wait for click to settle
182
 
182
 
183
     #if ENABLED(ULTRA_LCD)
183
     #if ENABLED(ULTRA_LCD)
184
-      lcd_setstatuspgm(PSTR("Mesh Validation Stopped."), 99);
184
+      lcd_setstatusPGM(PSTR("Mesh Validation Stopped."), 99);
185
       lcd_quick_feedback();
185
       lcd_quick_feedback();
186
     #endif
186
     #endif
187
-    lcd_reset_alert_level();
188
 
187
 
189
     while (!ubl_lcd_clicked()) idle();    // Wait for button release
188
     while (!ubl_lcd_clicked()) idle();    // Wait for button release
190
 
189
 
191
     // If the button is suddenly pressed again,
190
     // If the button is suddenly pressed again,
192
     // ask the user to resolve the issue
191
     // ask the user to resolve the issue
193
-    lcd_setstatuspgm(PSTR("Release button"), 99); // will never appear...
192
+    lcd_setstatusPGM(PSTR("Release button"), 99); // will never appear...
194
     while (ubl_lcd_clicked()) idle();             // unless this loop happens
193
     while (ubl_lcd_clicked()) idle();             // unless this loop happens
195
-    lcd_setstatuspgm(PSTR(""));
194
+    lcd_setstatusPGM(PSTR(""), -1);
196
 
195
 
197
     return true;
196
     return true;
198
   }
197
   }
351
     } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0);
350
     } while (--g26_repeats && location.x_index >= 0 && location.y_index >= 0);
352
 
351
 
353
     LEAVE:
352
     LEAVE:
354
-    lcd_reset_alert_level();
355
-    lcd_setstatuspgm(PSTR("Leaving G26"));
353
+    lcd_setstatusPGM(PSTR("Leaving G26"), -1);
356
 
354
 
357
     retract_filament(destination);
355
     retract_filament(destination);
358
     destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
356
     destination[Z_AXIS] = Z_CLEARANCE_BETWEEN_PROBES;
726
   }
724
   }
727
 
725
 
728
   bool unified_bed_leveling::exit_from_g26() {
726
   bool unified_bed_leveling::exit_from_g26() {
729
-    lcd_reset_alert_level();
730
-    lcd_setstatuspgm(PSTR("Leaving G26"));
727
+    lcd_setstatusPGM(PSTR("Leaving G26"), -1);
731
     while (ubl_lcd_clicked()) idle();
728
     while (ubl_lcd_clicked()) idle();
732
     return UBL_ERR;
729
     return UBL_ERR;
733
   }
730
   }
741
     #if HAS_TEMP_BED
738
     #if HAS_TEMP_BED
742
       #if ENABLED(ULTRA_LCD)
739
       #if ENABLED(ULTRA_LCD)
743
         if (g26_bed_temp > 25) {
740
         if (g26_bed_temp > 25) {
744
-          lcd_setstatuspgm(PSTR("G26 Heating Bed."), 99);
741
+          lcd_setstatusPGM(PSTR("G26 Heating Bed."), 99);
745
           lcd_quick_feedback();
742
           lcd_quick_feedback();
746
       #endif
743
       #endif
747
           has_control_of_lcd_panel = true;
744
           has_control_of_lcd_panel = true;
757
           }
754
           }
758
       #if ENABLED(ULTRA_LCD)
755
       #if ENABLED(ULTRA_LCD)
759
         }
756
         }
760
-        lcd_setstatuspgm(PSTR("G26 Heating Nozzle."), 99);
757
+        lcd_setstatusPGM(PSTR("G26 Heating Nozzle."), 99);
761
         lcd_quick_feedback();
758
         lcd_quick_feedback();
762
       #endif
759
       #endif
763
     #endif
760
     #endif
774
     }
771
     }
775
 
772
 
776
     #if ENABLED(ULTRA_LCD)
773
     #if ENABLED(ULTRA_LCD)
777
-      lcd_reset_alert_level();
778
-      lcd_setstatuspgm(PSTR(""));
774
+      lcd_setstatusPGM(PSTR(""), -1);
779
       lcd_quick_feedback();
775
       lcd_quick_feedback();
780
     #endif
776
     #endif
781
 
777
 
792
 
788
 
793
       has_control_of_lcd_panel = true;
789
       has_control_of_lcd_panel = true;
794
 
790
 
795
-      lcd_setstatuspgm(PSTR("User-Controlled Prime"), 99);
791
+      lcd_setstatusPGM(PSTR("User-Controlled Prime"), 99);
796
       chirp_at_user();
792
       chirp_at_user();
797
 
793
 
798
       set_destination_to_current();
794
       set_destination_to_current();
819
       while (ubl_lcd_clicked()) idle();           // Debounce Encoder Wheel
815
       while (ubl_lcd_clicked()) idle();           // Debounce Encoder Wheel
820
 
816
 
821
       #if ENABLED(ULTRA_LCD)
817
       #if ENABLED(ULTRA_LCD)
822
-        strcpy_P(lcd_status_message, PSTR("Done Priming")); // We can't do lcd_setstatuspgm() without having it continue;
818
+        strcpy_P(lcd_status_message, PSTR("Done Priming")); // We can't do lcd_setstatusPGM() without having it continue;
823
                                                             // So...  We cheat to get a message up.
819
                                                             // So...  We cheat to get a message up.
824
-        lcd_setstatuspgm(PSTR("Done Priming"), 99);
820
+        lcd_setstatusPGM(PSTR("Done Priming"), 99);
825
         lcd_quick_feedback();
821
         lcd_quick_feedback();
826
       #endif
822
       #endif
827
 
823
 
830
     }
826
     }
831
     else {
827
     else {
832
       #if ENABLED(ULTRA_LCD)
828
       #if ENABLED(ULTRA_LCD)
833
-        lcd_setstatuspgm(PSTR("Fixed Length Prime."), 99);
829
+        lcd_setstatusPGM(PSTR("Fixed Length Prime."), 99);
834
         lcd_quick_feedback();
830
         lcd_quick_feedback();
835
       #endif
831
       #endif
836
       set_destination_to_current();
832
       set_destination_to_current();

+ 2
- 2
Marlin/Marlin.h Прегледај датотеку

217
 extern int flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder
217
 extern int flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder
218
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
218
 extern float filament_size[EXTRUDERS]; // cross-sectional area of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder.
219
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
219
 extern float volumetric_multiplier[EXTRUDERS]; // reciprocal of cross-sectional area of filament (in square millimeters), stored this way to reduce computational burden in planner
220
-extern bool axis_known_position[XYZ]; // axis[n].is_known
221
-extern bool axis_homed[XYZ]; // axis[n].is_homed
220
+extern bool axis_known_position[XYZ];
221
+extern bool axis_homed[XYZ];
222
 extern volatile bool wait_for_heatup;
222
 extern volatile bool wait_for_heatup;
223
 
223
 
224
 #if HAS_RESUME_CONTINUE
224
 #if HAS_RESUME_CONTINUE

+ 42
- 24
Marlin/Marlin_main.cpp Прегледај датотеку

1743
 #if HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || ENABLED(DELTA_AUTO_CALIBRATION)
1743
 #if HAS_PROBING_PROCEDURE || HOTENDS > 1 || ENABLED(Z_PROBE_ALLEN_KEY) || ENABLED(Z_PROBE_SLED) || ENABLED(NOZZLE_CLEAN_FEATURE) || ENABLED(NOZZLE_PARK_FEATURE) || ENABLED(DELTA_AUTO_CALIBRATION)
1744
 
1744
 
1745
   bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) {
1745
   bool axis_unhomed_error(const bool x/*=true*/, const bool y/*=true*/, const bool z/*=true*/) {
1746
-#if ENABLED(HOME_AFTER_DEACTIVATE)
1747
-    const bool xx = x && !axis_known_position[X_AXIS],
1748
-               yy = y && !axis_known_position[Y_AXIS],
1749
-               zz = z && !axis_known_position[Z_AXIS];
1750
-#else
1751
-    const bool xx = x && !axis_homed[X_AXIS],
1752
-               yy = y && !axis_homed[Y_AXIS],
1753
-               zz = z && !axis_homed[Z_AXIS];
1754
-#endif
1746
+    #if ENABLED(HOME_AFTER_DEACTIVATE)
1747
+      const bool xx = x && !axis_known_position[X_AXIS],
1748
+                 yy = y && !axis_known_position[Y_AXIS],
1749
+                 zz = z && !axis_known_position[Z_AXIS];
1750
+    #else
1751
+      const bool xx = x && !axis_homed[X_AXIS],
1752
+                 yy = y && !axis_homed[Y_AXIS],
1753
+                 zz = z && !axis_homed[Z_AXIS];
1754
+    #endif
1755
     if (xx || yy || zz) {
1755
     if (xx || yy || zz) {
1756
       SERIAL_ECHO_START;
1756
       SERIAL_ECHO_START;
1757
       SERIAL_ECHOPGM(MSG_HOME " ");
1757
       SERIAL_ECHOPGM(MSG_HOME " ");
2467
     #endif
2467
     #endif
2468
     for (uint8_t y = 0; y < sy; y++) {
2468
     for (uint8_t y = 0; y < sy; y++) {
2469
       #ifdef SCAD_MESH_OUTPUT
2469
       #ifdef SCAD_MESH_OUTPUT
2470
-        SERIAL_PROTOCOLLNPGM(" [");           // open sub-array
2470
+        SERIAL_PROTOCOLPGM(" [");           // open sub-array
2471
       #else
2471
       #else
2472
         if (y < 10) SERIAL_PROTOCOLCHAR(' ');
2472
         if (y < 10) SERIAL_PROTOCOLCHAR(' ');
2473
         SERIAL_PROTOCOL((int)y);
2473
         SERIAL_PROTOCOL((int)y);
2501
       SERIAL_EOL;
2501
       SERIAL_EOL;
2502
     }
2502
     }
2503
     #ifdef SCAD_MESH_OUTPUT
2503
     #ifdef SCAD_MESH_OUTPUT
2504
-      SERIAL_PROTOCOLPGM("\n];");                     // close 2D array
2504
+      SERIAL_PROTOCOLPGM("];");                       // close 2D array
2505
     #endif
2505
     #endif
2506
     SERIAL_EOL;
2506
     SERIAL_EOL;
2507
   }
2507
   }
3798
     tool_change(old_tool_index, 0, true);
3798
     tool_change(old_tool_index, 0, true);
3799
   #endif
3799
   #endif
3800
 
3800
 
3801
+  lcd_refresh();
3802
+
3801
   report_current_position();
3803
   report_current_position();
3802
 
3804
 
3803
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3805
   #if ENABLED(DEBUG_LEVELING_FEATURE)
3839
 
3841
 
3840
     #if MANUAL_PROBE_HEIGHT > 0
3842
     #if MANUAL_PROBE_HEIGHT > 0
3841
       feedrate_mm_s = homing_feedrate_mm_s[Z_AXIS];
3843
       feedrate_mm_s = homing_feedrate_mm_s[Z_AXIS];
3842
-      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + 0.2; // just slightly over the bed
3844
+      current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS); // just slightly over the bed
3843
       line_to_current_position();
3845
       line_to_current_position();
3844
     #endif
3846
     #endif
3845
 
3847
 
4132
       #endif
4134
       #endif
4133
     #endif
4135
     #endif
4134
 
4136
 
4137
+    #if ENABLED(PROBE_MANUALLY)
4138
+      const bool seenA = parser.seen('A'), seenQ = parser.seen('Q'), no_action = seenA || seenQ;
4139
+    #endif
4140
+
4135
     #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
4141
     #if ENABLED(DEBUG_LEVELING_FEATURE) && DISABLED(PROBE_MANUALLY)
4136
       const bool faux = parser.seen('C') && parser.value_bool();
4142
       const bool faux = parser.seen('C') && parser.value_bool();
4143
+    #elif ENABLED(PROBE_MANUALLY)
4144
+      const bool faux = no_action;
4137
     #else
4145
     #else
4138
       bool constexpr faux = false;
4146
       bool constexpr faux = false;
4139
     #endif
4147
     #endif
4231
             return;
4239
             return;
4232
           }
4240
           }
4233
 
4241
 
4234
-          const float z = parser.seen('Z') && parser.has_value() ? parser.value_float() : 99999;
4235
-          if (!WITHIN(z, -10, 10)) {
4242
+          const float z = parser.seen('Z') && parser.has_value() ? parser.value_float() : NAN;
4243
+          if (!isnan(z) || !WITHIN(z, -10, 10)) {
4236
             SERIAL_ERROR_START;
4244
             SERIAL_ERROR_START;
4237
             SERIAL_ERRORLNPGM("Bad Z value");
4245
             SERIAL_ERRORLNPGM("Bad Z value");
4238
             return;
4246
             return;
4239
           }
4247
           }
4240
 
4248
 
4241
-          const float x = parser.seen('X') && parser.has_value() ? parser.value_float() : 99999,
4242
-                      y = parser.seen('Y') && parser.has_value() ? parser.value_float() : 99999;
4249
+          const float x = parser.seen('X') && parser.has_value() ? parser.value_float() : NAN,
4250
+                      y = parser.seen('Y') && parser.has_value() ? parser.value_float() : NAN;
4243
           int8_t i = parser.seen('I') && parser.has_value() ? parser.value_byte() : -1,
4251
           int8_t i = parser.seen('I') && parser.has_value() ? parser.value_byte() : -1,
4244
                  j = parser.seen('J') && parser.has_value() ? parser.value_byte() : -1;
4252
                  j = parser.seen('J') && parser.has_value() ? parser.value_byte() : -1;
4245
 
4253
 
4246
-          if (x < 99998 && y < 99998) {
4254
+          if (!isnan(x) && !isnan(y)) {
4247
             // Get nearest i / j from x / y
4255
             // Get nearest i / j from x / y
4248
             i = (x - LOGICAL_X_POSITION(bilinear_start[X_AXIS]) + 0.5 * xGridSpacing) / xGridSpacing;
4256
             i = (x - LOGICAL_X_POSITION(bilinear_start[X_AXIS]) + 0.5 * xGridSpacing) / xGridSpacing;
4249
             j = (y - LOGICAL_Y_POSITION(bilinear_start[Y_AXIS]) + 0.5 * yGridSpacing) / yGridSpacing;
4257
             j = (y - LOGICAL_Y_POSITION(bilinear_start[Y_AXIS]) + 0.5 * yGridSpacing) / yGridSpacing;
4279
         return;
4287
         return;
4280
       }
4288
       }
4281
 
4289
 
4282
-      dryrun = parser.seen('D') && parser.value_bool();
4290
+      dryrun = (parser.seen('D') && parser.value_bool())
4291
+        #if ENABLED(PROBE_MANUALLY)
4292
+          || no_action
4293
+        #endif
4294
+      ;
4283
 
4295
 
4284
       #if ENABLED(AUTO_BED_LEVELING_LINEAR)
4296
       #if ENABLED(AUTO_BED_LEVELING_LINEAR)
4285
 
4297
 
4424
 
4436
 
4425
     #if ENABLED(PROBE_MANUALLY)
4437
     #if ENABLED(PROBE_MANUALLY)
4426
 
4438
 
4427
-      const bool seenA = parser.seen('A'), seenQ = parser.seen('Q');
4428
-
4429
       // For manual probing, get the next index to probe now.
4439
       // For manual probing, get the next index to probe now.
4430
       // On the first probe this will be incremented to 0.
4440
       // On the first probe this will be incremented to 0.
4431
-      if (!seenA && !seenQ) {
4441
+      if (!no_action) {
4432
         ++abl_probe_index;
4442
         ++abl_probe_index;
4433
         g29_in_progress = true;
4443
         g29_in_progress = true;
4434
       }
4444
       }
4435
 
4445
 
4436
-      // Abort current G29 procedure, go back to ABLStart
4446
+      // Abort current G29 procedure, go back to idle state
4437
       if (seenA && g29_in_progress) {
4447
       if (seenA && g29_in_progress) {
4438
         SERIAL_PROTOCOLLNPGM("Manual G29 aborted");
4448
         SERIAL_PROTOCOLLNPGM("Manual G29 aborted");
4439
         #if HAS_SOFTWARE_ENDSTOPS
4449
         #if HAS_SOFTWARE_ENDSTOPS
4450
       if (verbose_level || seenQ) {
4460
       if (verbose_level || seenQ) {
4451
         SERIAL_PROTOCOLPGM("Manual G29 ");
4461
         SERIAL_PROTOCOLPGM("Manual G29 ");
4452
         if (g29_in_progress) {
4462
         if (g29_in_progress) {
4453
-          SERIAL_PROTOCOLPAIR("point ", abl_probe_index + 1);
4463
+          SERIAL_PROTOCOLPAIR("point ", min(abl_probe_index + 1, abl2));
4454
           SERIAL_PROTOCOLLNPAIR(" of ", abl2);
4464
           SERIAL_PROTOCOLLNPAIR(" of ", abl2);
4455
         }
4465
         }
4456
         else
4466
         else
4457
           SERIAL_PROTOCOLLNPGM("idle");
4467
           SERIAL_PROTOCOLLNPGM("idle");
4458
       }
4468
       }
4459
 
4469
 
4460
-      if (seenA || seenQ) return;
4470
+      if (no_action) return;
4461
 
4471
 
4462
       if (abl_probe_index == 0) {
4472
       if (abl_probe_index == 0) {
4463
         // For the initial G29 save software endstop state
4473
         // For the initial G29 save software endstop state
4482
 
4492
 
4483
           z_values[xCount][yCount] = measured_z + zoffset;
4493
           z_values[xCount][yCount] = measured_z + zoffset;
4484
 
4494
 
4495
+          #if ENABLED(DEBUG_LEVELING_FEATURE)
4496
+            if (DEBUGGING(LEVELING)) {
4497
+              SERIAL_PROTOCOLPAIR("Save X", xCount);
4498
+              SERIAL_PROTOCOLPAIR(" Y", yCount);
4499
+              SERIAL_PROTOCOLLNPAIR(" Z", measured_z + zoffset);
4500
+            }
4501
+          #endif
4502
+
4485
         #elif ENABLED(AUTO_BED_LEVELING_3POINT)
4503
         #elif ENABLED(AUTO_BED_LEVELING_3POINT)
4486
 
4504
 
4487
           points[i].z = measured_z;
4505
           points[i].z = measured_z;

+ 2
- 2
Marlin/language_en.h Прегледај датотеку

394
 #ifndef MSG_VE_JERK
394
 #ifndef MSG_VE_JERK
395
   #define MSG_VE_JERK                         _UxGT("Ve-jerk")
395
   #define MSG_VE_JERK                         _UxGT("Ve-jerk")
396
 #endif
396
 #endif
397
-#ifndef MSG_FEEDRATE
398
-  #define MSG_FEEDRATE                        _UxGT("Feedrate")
397
+#ifndef MSG_VELOCITY
398
+  #define MSG_VELOCITY                        _UxGT("Velocity")
399
 #endif
399
 #endif
400
 #ifndef MSG_VMAX
400
 #ifndef MSG_VMAX
401
   #define MSG_VMAX                            _UxGT("Vmax ")
401
   #define MSG_VMAX                            _UxGT("Vmax ")

+ 1
- 1
Marlin/ubl_G29.cpp Прегледај датотеку

58
   typedef void (*screenFunc_t)();
58
   typedef void (*screenFunc_t)();
59
   extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0);
59
   extern void lcd_goto_screen(screenFunc_t screen, const uint32_t encoder = 0);
60
   extern void lcd_setstatus(const char* message, const bool persist);
60
   extern void lcd_setstatus(const char* message, const bool persist);
61
-  extern void lcd_setstatuspgm(const char* message, const uint8_t level);
61
+  extern void lcd_setstatusPGM(const char* message, const int8_t level);
62
 
62
 
63
   int    unified_bed_leveling::g29_verbose_level,
63
   int    unified_bed_leveling::g29_verbose_level,
64
          unified_bed_leveling::g29_phase_value,
64
          unified_bed_leveling::g29_phase_value,

+ 113
- 67
Marlin/ultralcd.cpp Прегледај датотеку

481
   /**
481
   /**
482
    * Show "Moving..." till moves are done, then revert to previous display.
482
    * Show "Moving..." till moves are done, then revert to previous display.
483
    */
483
    */
484
-  inline void lcd_synchronize(const char * const msg=NULL) {
484
+  static const char moving[] PROGMEM = MSG_MOVING;
485
+  static const char *sync_message = moving;
486
+
487
+  //
488
+  // Display the synchronize screen until moves are
489
+  // finished, and don't return to the caller until
490
+  // done. ** This blocks the command queue! **
491
+  //
492
+  void _lcd_synchronize() {
485
     static bool no_reentry = false;
493
     static bool no_reentry = false;
486
-    const static char moving[] PROGMEM = MSG_MOVING;
487
-    lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, msg ? msg : moving);
494
+    if (lcdDrawUpdate) lcd_implementation_drawmenu_static(LCD_HEIGHT >= 4 ? 1 : 0, sync_message);
488
     if (no_reentry) return;
495
     if (no_reentry) return;
489
 
496
 
490
     // Make this the current handler till all moves are done
497
     // Make this the current handler till all moves are done
491
     no_reentry = true;
498
     no_reentry = true;
492
     screenFunc_t old_screen = currentScreen;
499
     screenFunc_t old_screen = currentScreen;
493
-    lcd_goto_screen(lcd_synchronize);
500
+    lcd_goto_screen(_lcd_synchronize);
494
     stepper.synchronize();
501
     stepper.synchronize();
495
     no_reentry = false;
502
     no_reentry = false;
496
     lcd_goto_screen(old_screen);
503
     lcd_goto_screen(old_screen);
497
   }
504
   }
498
 
505
 
506
+  // Display the synchronize screen with a custom message
507
+  // ** This blocks the command queue! **
508
+  void lcd_synchronize(const char * const msg=NULL) {
509
+    sync_message = msg ? msg : moving;
510
+    _lcd_synchronize();
511
+  }
512
+
499
   void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
513
   void lcd_return_to_status() { lcd_goto_screen(lcd_status_screen); }
500
 
514
 
501
   void lcd_save_previous_screen() {
515
   void lcd_save_previous_screen() {
680
       #if ENABLED(PARK_HEAD_ON_PAUSE)
694
       #if ENABLED(PARK_HEAD_ON_PAUSE)
681
         enqueue_and_echo_commands_P(PSTR("M125"));
695
         enqueue_and_echo_commands_P(PSTR("M125"));
682
       #endif
696
       #endif
683
-      lcd_setstatuspgm(PSTR(MSG_PRINT_PAUSED), true);
697
+      lcd_setstatusPGM(PSTR(MSG_PRINT_PAUSED), -1);
684
     }
698
     }
685
 
699
 
686
     void lcd_sdcard_resume() {
700
     void lcd_sdcard_resume() {
690
         card.startFileprint();
704
         card.startFileprint();
691
         print_job_timer.start();
705
         print_job_timer.start();
692
       #endif
706
       #endif
693
-      lcd_setstatuspgm(PSTR(""), true);
707
+      lcd_setstatusPGM(PSTR(""), -1);
694
     }
708
     }
695
 
709
 
696
     void lcd_sdcard_stop() {
710
     void lcd_sdcard_stop() {
703
         for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
717
         for (uint8_t i = 0; i < FAN_COUNT; i++) fanSpeeds[i] = 0;
704
       #endif
718
       #endif
705
       wait_for_heatup = false;
719
       wait_for_heatup = false;
706
-      LCD_MESSAGEPGM(MSG_PRINT_ABORTED);
720
+      lcd_setstatusPGM(PSTR(MSG_PRINT_PAUSED), -1);
707
     }
721
     }
708
 
722
 
709
   #endif // SDSUPPORT
723
   #endif // SDSUPPORT
1420
       #endif
1434
       #endif
1421
     );
1435
     );
1422
 
1436
 
1437
+    //
1438
+    // Raise Z to the "manual probe height"
1439
+    // Don't return until done.
1440
+    // ** This blocks the command queue! **
1441
+    //
1442
+    void _lcd_after_probing() {
1443
+      #if MANUAL_PROBE_HEIGHT > 0
1444
+        current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
1445
+        line_to_current(Z_AXIS);
1446
+      #endif
1447
+      // Display "Done" screen and wait for moves to complete
1448
+      #if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING)
1449
+        lcd_synchronize(PSTR(MSG_LEVEL_BED_DONE));
1450
+      #endif
1451
+      lcd_goto_previous_menu();
1452
+      lcd_completion_feedback();
1453
+      defer_return_to_status = false;
1454
+      //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE);
1455
+    }
1456
+
1423
     #if ENABLED(MESH_BED_LEVELING)
1457
     #if ENABLED(MESH_BED_LEVELING)
1424
 
1458
 
1425
       // Utility to go to the next mesh point
1459
       // Utility to go to the next mesh point
1432
         current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
1466
         current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
1433
         planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
1467
         planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
1434
         #if MANUAL_PROBE_HEIGHT > 0
1468
         #if MANUAL_PROBE_HEIGHT > 0
1435
-          current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + 0.2;
1469
+          current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS);
1436
           line_to_current(Z_AXIS);
1470
           line_to_current(Z_AXIS);
1437
         #endif
1471
         #endif
1438
         lcd_synchronize();
1472
         lcd_synchronize();
1439
       }
1473
       }
1440
 
1474
 
1441
-    #endif // MESH_BED_LEVELING
1475
+    #elif ENABLED(PROBE_MANUALLY)
1442
 
1476
 
1443
-    void _lcd_level_bed_done() {
1444
-      if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE));
1445
-      lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
1446
-    }
1477
+      bool lcd_wait_for_move;
1478
+
1479
+      //
1480
+      // Bed leveling is done. Wait for G29 to complete.
1481
+      // A flag is used so that this can release control
1482
+      // and allow the command queue to be processed.
1483
+      //
1484
+      void _lcd_level_bed_done() {
1485
+        if (!lcd_wait_for_move) _lcd_after_probing();
1486
+        if (lcdDrawUpdate) lcd_implementation_drawedit(PSTR(MSG_LEVEL_BED_DONE));
1487
+        lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
1488
+      }
1489
+
1490
+    #endif
1447
 
1491
 
1448
     void _lcd_level_goto_next_point();
1492
     void _lcd_level_goto_next_point();
1449
 
1493
 
1455
 
1499
 
1456
       if (lcd_clicked) {
1500
       if (lcd_clicked) {
1457
 
1501
 
1458
-        // Use a hook to set the probe point z
1502
+        //
1503
+        // Save the current Z position
1504
+        //
1505
+
1459
         #if ENABLED(MESH_BED_LEVELING)
1506
         #if ENABLED(MESH_BED_LEVELING)
1460
 
1507
 
1508
+          //
1461
           // MBL records the position but doesn't move to the next one
1509
           // MBL records the position but doesn't move to the next one
1462
-          mbl.set_zigzag_z(manual_probe_index, current_position[Z_AXIS]);
1510
+          //
1463
 
1511
 
1464
-        #elif ENABLED(PROBE_MANUALLY)
1465
-
1466
-          // The last G29 will record but not move
1467
-          if (manual_probe_index == total_probe_points - 1)
1468
-            enqueue_and_echo_commands_P(PSTR("G29 V1"));
1512
+          mbl.set_zigzag_z(manual_probe_index, current_position[Z_AXIS]);
1469
 
1513
 
1470
         #endif
1514
         #endif
1471
 
1515
 
1472
         // If done...
1516
         // If done...
1473
         if (++manual_probe_index >= total_probe_points) {
1517
         if (++manual_probe_index >= total_probe_points) {
1474
 
1518
 
1475
-          // Say "Done!"
1476
-          lcd_goto_screen(_lcd_level_bed_done);
1519
+          #if ENABLED(PROBE_MANUALLY)
1477
 
1520
 
1478
-          // Raise Z to the "manual probe height"
1479
-          #if MANUAL_PROBE_HEIGHT > 0
1480
-            current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT;
1481
-            line_to_current(Z_AXIS);
1482
-          #endif
1521
+            //
1522
+            // The last G29 will record and enable but not move.
1523
+            // Since G29 is deferred, 
1524
+            //
1525
+            lcd_wait_for_move = true;
1526
+            enqueue_and_echo_commands_P(PSTR("G29 V1"));
1527
+            lcd_goto_screen(_lcd_level_bed_done);
1483
 
1528
 
1484
-          #if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING)
1485
-            lcd_synchronize(PSTR(MSG_LEVEL_BED_DONE));
1486
-          #endif
1529
+          #elif ENABLED(MESH_BED_LEVELING)
1487
 
1530
 
1488
-          // Enable leveling, if needed
1489
-          #if ENABLED(MESH_BED_LEVELING)
1531
+            _lcd_after_probing();
1490
 
1532
 
1491
             mbl.set_has_mesh(true);
1533
             mbl.set_has_mesh(true);
1492
             mesh_probing_done();
1534
             mesh_probing_done();
1493
 
1535
 
1494
-          #elif ENABLED(PROBE_MANUALLY)
1495
-
1496
-            // ABL will be enabled due to "G29".
1497
-
1498
           #endif
1536
           #endif
1499
 
1537
 
1500
-          lcd_return_to_status();
1501
-          //LCD_MESSAGEPGM(MSG_LEVEL_BED_DONE);
1502
-          lcd_completion_feedback();
1503
         }
1538
         }
1504
-        else
1539
+        else {
1540
+          // MESH_BED_LEVELING: Z already stored, just move
1541
+          //    PROBE_MANUALLY: Send G29 to record Z, then move
1505
           _lcd_level_goto_next_point();
1542
           _lcd_level_goto_next_point();
1543
+        }
1506
 
1544
 
1507
         return;
1545
         return;
1508
       }
1546
       }
1509
 
1547
 
1548
+      //
1510
       // Encoder knob or keypad buttons adjust the Z position
1549
       // Encoder knob or keypad buttons adjust the Z position
1550
+      //
1511
       if (encoderPosition) {
1551
       if (encoderPosition) {
1512
         refresh_cmd_timeout();
1552
         refresh_cmd_timeout();
1513
         current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP);
1553
         current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP);
1518
         encoderPosition = 0;
1558
         encoderPosition = 0;
1519
       }
1559
       }
1520
 
1560
 
1521
-      // Update on first display, then only on updates to Z position
1522
-      // Show message above on clicks instead
1561
+      //
1562
+      // Draw on first display, then only on Z change
1563
+      //
1523
       if (lcdDrawUpdate) {
1564
       if (lcdDrawUpdate) {
1524
         const float v = current_position[Z_AXIS];
1565
         const float v = current_position[Z_AXIS];
1525
         lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+'));
1566
         lcd_implementation_drawedit(PSTR(MSG_MOVE_Z), ftostr43sign(v + (v < 0 ? -0.0001 : 0.0001), '+'));
1530
      * Step 6: Display "Next point: 1 / 9" while waiting for move to finish
1571
      * Step 6: Display "Next point: 1 / 9" while waiting for move to finish
1531
      */
1572
      */
1532
 
1573
 
1533
-    #if ENABLED(PROBE_MANUALLY)
1534
-      bool lcd_wait_for_move;
1535
-    #endif
1536
-
1537
     void _lcd_level_bed_moving() {
1574
     void _lcd_level_bed_moving() {
1538
       if (lcdDrawUpdate) {
1575
       if (lcdDrawUpdate) {
1539
         char msg[10];
1576
         char msg[10];
1570
 
1607
 
1571
       #elif ENABLED(PROBE_MANUALLY)
1608
       #elif ENABLED(PROBE_MANUALLY)
1572
 
1609
 
1573
-        // G29 will signal when it's done
1610
+        // G29 Records Z, moves, and signals when it pauses
1574
         lcd_wait_for_move = true;
1611
         lcd_wait_for_move = true;
1575
         enqueue_and_echo_commands_P(PSTR("G29 V1"));
1612
         enqueue_and_echo_commands_P(PSTR("G29 V1"));
1576
 
1613
 
1620
     /**
1657
     /**
1621
      * Step 1: Bed Level entry-point
1658
      * Step 1: Bed Level entry-point
1622
      *  - Cancel
1659
      *  - Cancel
1660
+     *  - Auto Home       (if homing needed)
1661
+     *  - Leveling On/Off (if data exists, and homed)
1623
      *  - Level Bed >
1662
      *  - Level Bed >
1624
-     *  - Leveling On/Off (if there is leveling data)
1625
-     *  - Fade Height (Req: ENABLE_LEVELING_FADE_HEIGHT)
1626
-     *  - Mesh Z Offset (Req: MESH_BED_LEVELING)
1627
-     *  - Z Probe Offset (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET)
1628
-     *  - Load Settings (Req: EEPROM_SETTINGS)
1629
-     *  - Save Settings (Req: EEPROM_SETTINGS)
1663
+     *  - Fade Height     (Req: ENABLE_LEVELING_FADE_HEIGHT)
1664
+     *  - Mesh Z Offset   (Req: MESH_BED_LEVELING)
1665
+     *  - Z Probe Offset  (Req: HAS_BED_PROBE, Opt: BABYSTEP_ZPROBE_OFFSET)
1666
+     *  - Load Settings   (Req: EEPROM_SETTINGS)
1667
+     *  - Save Settings   (Req: EEPROM_SETTINGS)
1630
      */
1668
      */
1631
-    void lcd_level_bed() {
1669
+    void lcd_bed_leveling() {
1632
       START_MENU();
1670
       START_MENU();
1633
       MENU_BACK(MSG_PREPARE);
1671
       MENU_BACK(MSG_PREPARE);
1634
-      MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
1635
-      if (leveling_is_valid()) {      // Leveling data exists? Show more options.
1672
+
1673
+      if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
1674
+        MENU_ITEM(gcode, MSG_AUTO_HOME, PSTR("G28"));
1675
+      else if (leveling_is_valid()) {
1636
         _level_state = leveling_is_active();
1676
         _level_state = leveling_is_active();
1637
         MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &_level_state, _lcd_toggle_bed_leveling);
1677
         MENU_ITEM_EDIT_CALLBACK(bool, MSG_BED_LEVELING, &_level_state, _lcd_toggle_bed_leveling);
1638
       }
1678
       }
1642
         MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_Z_FADE_HEIGHT, &planner.z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height);
1682
         MENU_MULTIPLIER_ITEM_EDIT_CALLBACK(float62, MSG_Z_FADE_HEIGHT, &planner.z_fade_height, 0.0, 100.0, _lcd_set_z_fade_height);
1643
       #endif
1683
       #endif
1644
 
1684
 
1645
-      // Manual bed leveling, Bed Z:
1685
+      //
1686
+      // MBL Z Offset
1687
+      //
1646
       #if ENABLED(MESH_BED_LEVELING)
1688
       #if ENABLED(MESH_BED_LEVELING)
1647
         MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
1689
         MENU_ITEM_EDIT(float43, MSG_BED_Z, &mbl.z_offset, -1, 1);
1648
       #endif
1690
       #endif
1653
         MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
1695
         MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
1654
       #endif
1696
       #endif
1655
 
1697
 
1698
+      MENU_ITEM(submenu, MSG_LEVEL_BED, _lcd_level_bed_continue);
1699
+
1656
       #if ENABLED(EEPROM_SETTINGS)
1700
       #if ENABLED(EEPROM_SETTINGS)
1657
         MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);
1701
         MENU_ITEM(function, MSG_LOAD_EEPROM, lcd_load_settings);
1658
         MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
1702
         MENU_ITEM(function, MSG_STORE_EEPROM, lcd_store_settings);
2063
       #if ENABLED(PROBE_MANUALLY)
2107
       #if ENABLED(PROBE_MANUALLY)
2064
         if (!g29_in_progress)
2108
         if (!g29_in_progress)
2065
       #endif
2109
       #endif
2066
-      MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_level_bed);
2110
+      MENU_ITEM(submenu, MSG_BED_LEVELING, lcd_bed_leveling);
2067
     #endif
2111
     #endif
2068
 
2112
 
2069
     #if HAS_M206_COMMAND
2113
     #if HAS_M206_COMMAND
2826
     static void lcd_refresh_zprobe_zoffset() { refresh_zprobe_zoffset(); }
2870
     static void lcd_refresh_zprobe_zoffset() { refresh_zprobe_zoffset(); }
2827
   #endif
2871
   #endif
2828
 
2872
 
2829
-  // M203 / M205 Feedrates
2830
-  void lcd_control_motion_feedrate_menu() {
2873
+  // M203 / M205 Velocity options
2874
+  void lcd_control_motion_velocity_menu() {
2831
     START_MENU();
2875
     START_MENU();
2832
     MENU_BACK(MSG_MOTION);
2876
     MENU_BACK(MSG_MOTION);
2833
 
2877
 
2957
       MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
3001
       MENU_ITEM_EDIT_CALLBACK(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, Z_PROBE_OFFSET_RANGE_MIN, Z_PROBE_OFFSET_RANGE_MAX, lcd_refresh_zprobe_zoffset);
2958
     #endif
3002
     #endif
2959
 
3003
 
2960
-    // M203 / M205 Feedrate items
2961
-    MENU_ITEM(submenu, MSG_FEEDRATE, lcd_control_motion_feedrate_menu);
3004
+    // M203 / M205 - Feedrate items
3005
+    MENU_ITEM(submenu, MSG_VELOCITY, lcd_control_motion_velocity_menu);
2962
 
3006
 
2963
-    // M201 Acceleration items
3007
+    // M201 - Acceleration items
2964
     MENU_ITEM(submenu, MSG_ACCELERATION, lcd_control_motion_acceleration_menu);
3008
     MENU_ITEM(submenu, MSG_ACCELERATION, lcd_control_motion_acceleration_menu);
2965
 
3009
 
2966
-    // M205 Max Jerk
3010
+    // M205 - Max Jerk
2967
     MENU_ITEM(submenu, MSG_JERK, lcd_control_motion_jerk_menu);
3011
     MENU_ITEM(submenu, MSG_JERK, lcd_control_motion_jerk_menu);
2968
 
3012
 
2969
-    // M92 Steps Per mm
3013
+    // M92 - Steps Per mm
2970
     MENU_ITEM(submenu, MSG_STEPS_PER_MM, lcd_control_motion_steps_per_mm_menu);
3014
     MENU_ITEM(submenu, MSG_STEPS_PER_MM, lcd_control_motion_steps_per_mm_menu);
2971
 
3015
 
3016
+    // M540 S - Abort on endstop hit when SD printing
2972
     #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
3017
     #if ENABLED(ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED)
2973
       MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit);
3018
       MENU_ITEM_EDIT(bool, MSG_ENDSTOP_ABORT, &stepper.abort_on_endstop_hit);
2974
     #endif
3019
     #endif
4095
   lcd_finishstatus(persist);
4140
   lcd_finishstatus(persist);
4096
 }
4141
 }
4097
 
4142
 
4098
-void lcd_setstatuspgm(const char * const message, const uint8_t level) {
4143
+void lcd_setstatusPGM(const char * const message, int8_t level) {
4144
+  if (level < 0) level = lcd_status_message_level = 0;
4099
   if (level < lcd_status_message_level) return;
4145
   if (level < lcd_status_message_level) return;
4100
   lcd_status_message_level = level;
4146
   lcd_status_message_level = level;
4101
   strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
4147
   strncpy_P(lcd_status_message, message, 3 * (LCD_WIDTH));
4113
 }
4159
 }
4114
 
4160
 
4115
 void lcd_setalertstatuspgm(const char * const message) {
4161
 void lcd_setalertstatuspgm(const char * const message) {
4116
-  lcd_setstatuspgm(message, 1);
4162
+  lcd_setstatusPGM(message, 1);
4117
   #if ENABLED(ULTIPANEL)
4163
   #if ENABLED(ULTIPANEL)
4118
     lcd_return_to_status();
4164
     lcd_return_to_status();
4119
   #endif
4165
   #endif

+ 7
- 3
Marlin/ultralcd.h Прегледај датотеку

38
   void lcd_init();
38
   void lcd_init();
39
   bool lcd_hasstatus();
39
   bool lcd_hasstatus();
40
   void lcd_setstatus(const char* message, const bool persist=false);
40
   void lcd_setstatus(const char* message, const bool persist=false);
41
-  void lcd_setstatuspgm(const char* message, const uint8_t level=0);
41
+  void lcd_setstatusPGM(const char* message, const int8_t level=0);
42
   void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...);
42
   void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...);
43
   void lcd_setalertstatuspgm(const char* message);
43
   void lcd_setalertstatuspgm(const char* message);
44
   void lcd_reset_alert_level();
44
   void lcd_reset_alert_level();
46
   void kill_screen(const char* lcd_msg);
46
   void kill_screen(const char* lcd_msg);
47
   bool lcd_detected(void);
47
   bool lcd_detected(void);
48
 
48
 
49
+  extern uint8_t lcdDrawUpdate;
50
+  inline void lcd_refresh() { lcdDrawUpdate = LCDVIEW_CLEAR_CALL_REDRAW; }
51
+
49
   #if HAS_BUZZER
52
   #if HAS_BUZZER
50
     void lcd_buzz(long duration, uint16_t freq);
53
     void lcd_buzz(long duration, uint16_t freq);
51
   #endif
54
   #endif
61
     void bootscreen();
64
     void bootscreen();
62
   #endif
65
   #endif
63
 
66
 
64
-  #define LCD_MESSAGEPGM(x) lcd_setstatuspgm(PSTR(x))
67
+  #define LCD_MESSAGEPGM(x) lcd_setstatusPGM(PSTR(x))
65
   #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
68
   #define LCD_ALERTMESSAGEPGM(x) lcd_setalertstatuspgm(PSTR(x))
66
 
69
 
67
   #define LCD_UPDATE_INTERVAL 100
70
   #define LCD_UPDATE_INTERVAL 100
153
   inline void lcd_init() {}
156
   inline void lcd_init() {}
154
   inline bool lcd_hasstatus() { return false; }
157
   inline bool lcd_hasstatus() { return false; }
155
   inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
158
   inline void lcd_setstatus(const char* const message, const bool persist=false) { UNUSED(message); UNUSED(persist); }
156
-  inline void lcd_setstatuspgm(const char* const message, const uint8_t level=0) { UNUSED(message); UNUSED(level); }
159
+  inline void lcd_setstatusPGM(const char* const message, const int8_t level=0) { UNUSED(message); UNUSED(level); }
157
   inline void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); }
160
   inline void lcd_status_printf_P(const uint8_t level, const char * const fmt, ...) { UNUSED(level); UNUSED(fmt); }
158
   inline void lcd_buttons_update() {}
161
   inline void lcd_buttons_update() {}
159
   inline void lcd_reset_alert_level() {}
162
   inline void lcd_reset_alert_level() {}
160
   inline bool lcd_detected() { return true; }
163
   inline bool lcd_detected() { return true; }
164
+  inline void lcd_refresh() {}
161
 
165
 
162
   #define LCD_MESSAGEPGM(x) NOOP
166
   #define LCD_MESSAGEPGM(x) NOOP
163
   #define LCD_ALERTMESSAGEPGM(x) NOOP
167
   #define LCD_ALERTMESSAGEPGM(x) NOOP

+ 4
- 2
Marlin/ultralcd_impl_HD44780.h Прегледај датотеку

806
 
806
 
807
     // Draw the progress bar if the message has shown long enough
807
     // Draw the progress bar if the message has shown long enough
808
     // or if there is no message set.
808
     // or if there is no message set.
809
-    if (card.isFileOpen() && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0]))
810
-      return lcd_draw_progress_bar(card.percentDone());
809
+    if (card.isFileOpen() && (ELAPSED(millis(), progress_bar_ms + PROGRESS_BAR_MSG_TIME) || !lcd_status_message[0])) {
810
+      const uint8_t percent = card.percentDone();
811
+      if (percent) return lcd_draw_progress_bar(percent);
812
+    }
811
 
813
 
812
   #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
814
   #elif ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
813
 
815
 

Loading…
Откажи
Сачувај