Browse Source

Merge pull request #7071 from thinkyhead/bf_cleanups_fixes

Fix status message, apply #7058
Scott Lahteine 8 years ago
parent
commit
43a95ae5ad
32 changed files with 66 additions and 39 deletions
  1. 2
    1
      .travis.yml
  2. 1
    0
      Marlin/Configuration_adv.h
  3. 8
    8
      Marlin/Marlin_main.cpp
  4. 2
    0
      Marlin/SanityCheck.h
  5. 1
    0
      Marlin/example_configurations/Cartesio/Configuration_adv.h
  6. 1
    0
      Marlin/example_configurations/Felix/Configuration_adv.h
  7. 1
    0
      Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h
  8. 1
    0
      Marlin/example_configurations/Hephestos/Configuration_adv.h
  9. 1
    0
      Marlin/example_configurations/Hephestos_2/Configuration_adv.h
  10. 1
    0
      Marlin/example_configurations/K8200/Configuration_adv.h
  11. 1
    0
      Marlin/example_configurations/K8400/Configuration_adv.h
  12. 1
    0
      Marlin/example_configurations/M150/Configuration_adv.h
  13. 1
    0
      Marlin/example_configurations/RigidBot/Configuration_adv.h
  14. 1
    0
      Marlin/example_configurations/SCARA/Configuration_adv.h
  15. 1
    0
      Marlin/example_configurations/TAZ4/Configuration_adv.h
  16. 1
    0
      Marlin/example_configurations/TinyBoy2/Configuration_adv.h
  17. 1
    0
      Marlin/example_configurations/WITBOX/Configuration_adv.h
  18. 1
    0
      Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h
  19. 1
    0
      Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h
  20. 1
    0
      Marlin/example_configurations/delta/generic/Configuration_adv.h
  21. 1
    0
      Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h
  22. 1
    0
      Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h
  23. 1
    0
      Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h
  24. 1
    0
      Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h
  25. 1
    0
      Marlin/example_configurations/makibox/Configuration_adv.h
  26. 1
    0
      Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h
  27. 1
    0
      Marlin/example_configurations/wt150/Configuration_adv.h
  28. 3
    3
      Marlin/language_en.h
  29. 13
    12
      Marlin/ubl.cpp
  30. 1
    1
      Marlin/ubl_G29.cpp
  31. 10
    11
      Marlin/ultralcd.cpp
  32. 3
    3
      Marlin/ultralcd_impl_DOGM.h

+ 2
- 1
.travis.yml View File

@@ -245,10 +245,11 @@ script:
245 245
   - opt_set_adv SDSORT_CACHE_NAMES true
246 246
   - build_marlin
247 247
   #
248
-  # REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
248
+  # REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER with SDCARD_SORT_ALPHA and STATUS_MESSAGE_SCROLLING
249 249
   #
250 250
   - restore_configs
251 251
   - opt_enable REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER SDSUPPORT
252
+  - opt_enable_adv SDCARD_SORT_ALPHA STATUS_MESSAGE_SCROLLING
252 253
   - build_marlin
253 254
   #
254 255
   # REPRAPWORLD_KEYPAD

+ 1
- 0
Marlin/Configuration_adv.h View File

@@ -807,6 +807,7 @@
807 807
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
808 808
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
809 809
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
810
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
810 811
 #endif
811 812
 
812 813
 // @section tmc

+ 8
- 8
Marlin/Marlin_main.cpp View File

@@ -9265,10 +9265,10 @@ inline void gcode_M503() {
9265 9265
    */
9266 9266
   inline void gcode_M600() {
9267 9267
 
9268
-    // Don't allow filament change without homing first
9269
-    if (axis_unhomed_error()) {
9270
-        home_all_axes();
9271
-    }
9268
+    #if ENABLED(HOME_BEFORE_FILAMENT_CHANGE)
9269
+      // Don't allow filament change without homing first
9270
+      if (axis_unhomed_error()) home_all_axes();
9271
+    #endif
9272 9272
 
9273 9273
     // Initial retract before move to filament change position
9274 9274
     const float retract = parser.seen('E') ? parser.value_axis_units(E_AXIS) : 0
@@ -12702,10 +12702,10 @@ void setup() {
12702 12702
 
12703 12703
   // Check startup - does nothing if bootloader sets MCUSR to 0
12704 12704
   byte mcu = MCUSR;
12705
-  if (mcu & 1) SERIAL_ECHOLNPGM(MSG_POWERUP);
12706
-  if (mcu & 2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET);
12707
-  if (mcu & 4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET);
12708
-  if (mcu & 8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET);
12705
+  if (mcu &  1) SERIAL_ECHOLNPGM(MSG_POWERUP);
12706
+  if (mcu &  2) SERIAL_ECHOLNPGM(MSG_EXTERNAL_RESET);
12707
+  if (mcu &  4) SERIAL_ECHOLNPGM(MSG_BROWNOUT_RESET);
12708
+  if (mcu &  8) SERIAL_ECHOLNPGM(MSG_WATCHDOG_RESET);
12709 12709
   if (mcu & 32) SERIAL_ECHOLNPGM(MSG_SOFTWARE_RESET);
12710 12710
   MCUSR = 0;
12711 12711
 

+ 2
- 0
Marlin/SanityCheck.h View File

@@ -321,6 +321,8 @@
321 321
     #error "EXTRUDER_RUNOUT_PREVENT is incompatible with ADVANCED_PAUSE_FEATURE."
322 322
   #elif ENABLED(PARK_HEAD_ON_PAUSE) && DISABLED(SDSUPPORT) && DISABLED(NEWPANEL) && DISABLED(EMERGENCY_PARSER)
323 323
     #error "PARK_HEAD_ON_PAUSE requires SDSUPPORT, EMERGENCY_PARSER, or an LCD controller."
324
+  #elif ENABLED(HOME_BEFORE_FILAMENT_CHANGE) && DISABLED(PAUSE_PARK_NO_STEPPER_TIMEOUT)
325
+    #error "HOME_BEFORE_FILAMENT_CHANGE requires PAUSE_PARK_NO_STEPPER_TIMEOUT"
324 326
   #endif
325 327
 #endif
326 328
 

+ 1
- 0
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/FolgerTech-i3-2020/Configuration_adv.h View File

@@ -809,6 +809,7 @@
809 809
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
810 810
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
811 811
   #define PARK_HEAD_ON_PAUSE                  // Go to filament change position on pause, return to print position on resume
812
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
812 813
 #endif
813 814
 
814 815
 // @section tmc

+ 1
- 0
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -783,6 +783,7 @@
783 783
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
784 784
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
785 785
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
786
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
786 787
 #endif
787 788
 
788 789
 // @section tmc

+ 1
- 0
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -813,6 +813,7 @@
813 813
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
814 814
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
815 815
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
816
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
816 817
 #endif
817 818
 
818 819
 // @section tmc

+ 1
- 0
Marlin/example_configurations/K8400/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/M150/Configuration_adv.h View File

@@ -807,6 +807,7 @@
807 807
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
808 808
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
809 809
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
810
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
810 811
 #endif
811 812
 
812 813
 // @section tmc

+ 1
- 0
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/TinyBoy2/Configuration_adv.h View File

@@ -803,6 +803,7 @@
803 803
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
804 804
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
805 805
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
806
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
806 807
 #endif
807 808
 
808 809
 // @section tmc

+ 1
- 0
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration_adv.h View File

@@ -805,6 +805,7 @@
805 805
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
806 806
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
807 807
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
808
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
808 809
 #endif
809 810
 
810 811
 // @section tmc

+ 1
- 0
Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration_adv.h View File

@@ -804,6 +804,7 @@
804 804
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
805 805
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
806 806
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
807
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
807 808
 #endif
808 809
 
809 810
 // @section tmc

+ 1
- 0
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -802,6 +802,7 @@
802 802
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
803 803
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
804 804
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
805
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
805 806
 #endif
806 807
 
807 808
 // @section tmc

+ 1
- 0
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -802,6 +802,7 @@
802 802
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
803 803
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
804 804
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
805
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
805 806
 #endif
806 807
 
807 808
 // @section tmc

+ 1
- 0
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -807,6 +807,7 @@
807 807
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
808 808
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
809 809
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
810
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
810 811
 #endif
811 812
 
812 813
 // @section tmc

+ 1
- 0
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -802,6 +802,7 @@
802 802
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
803 803
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
804 804
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
805
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
805 806
 #endif
806 807
 
807 808
 // @section tmc

+ 1
- 0
Marlin/example_configurations/gCreate_gMax1.5+/Configuration_adv.h View File

@@ -809,6 +809,7 @@
809 809
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
810 810
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
811 811
   #define PARK_HEAD_ON_PAUSE                  // Go to filament change position on pause, return to print position on resume
812
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
812 813
 #endif
813 814
 
814 815
 // @section tmc

+ 1
- 0
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -800,6 +800,7 @@
800 800
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
801 801
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
802 802
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
803
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
803 804
 #endif
804 805
 
805 806
 // @section tmc

+ 1
- 0
Marlin/example_configurations/wt150/Configuration_adv.h View File

@@ -803,6 +803,7 @@
803 803
   #define PAUSE_PARK_NO_STEPPER_TIMEOUT       // Enable to have stepper motors hold position during filament change
804 804
                                               // even if it takes longer than DEFAULT_STEPPER_DEACTIVE_TIME.
805 805
   //#define PARK_HEAD_ON_PAUSE                // Go to filament change position on pause, return to print position on resume
806
+  //#define HOME_BEFORE_FILAMENT_CHANGE       // Ensure homing has been completed prior to parking for filament change
806 807
 #endif
807 808
 
808 809
 // @section tmc

+ 3
- 3
Marlin/language_en.h View File

@@ -280,9 +280,9 @@
280 280
 #ifndef MSG_UBL_OUTPUT_MAP_CSV
281 281
   #define MSG_UBL_OUTPUT_MAP_CSV              _UxGT("Output for CSV")
282 282
 #endif
283
-  #ifndef MSG_UBL_OUTPUT_MAP_BACKUP
284
-    #define MSG_UBL_OUTPUT_MAP_BACKUP         _UxGT("Off Printer Backup")
285
-  #endif
283
+#ifndef MSG_UBL_OUTPUT_MAP_BACKUP
284
+  #define MSG_UBL_OUTPUT_MAP_BACKUP           _UxGT("Off Printer Backup")
285
+#endif
286 286
 #ifndef MSG_UBL_INFO_UBL
287 287
   #define MSG_UBL_INFO_UBL                    _UxGT("Output UBL Info")
288 288
 #endif

+ 13
- 12
Marlin/ubl.cpp View File

@@ -115,8 +115,9 @@
115 115
   void unified_bed_leveling::display_map(const int map_type) {
116 116
     constexpr uint8_t spaces = 8 * (GRID_MAX_POINTS_X - 2);
117 117
 
118
+    SERIAL_PROTOCOLPGM("\nBed Topography Report");
118 119
     if (map_type == 0) {
119
-      SERIAL_PROTOCOLLNPGM("\nBed Topography Report:\n");
120
+      SERIAL_PROTOCOLPGM(":\n\n");
120 121
       serial_echo_xy(0, GRID_MAX_POINTS_Y - 1);
121 122
       SERIAL_ECHO_SP(spaces + 3);
122 123
       serial_echo_xy(GRID_MAX_POINTS_X - 1, GRID_MAX_POINTS_Y - 1);
@@ -126,9 +127,10 @@
126 127
       serial_echo_xy(UBL_MESH_MAX_X, UBL_MESH_MAX_Y);
127 128
       SERIAL_EOL();
128 129
     }
129
-
130
-    if (map_type == 1) { SERIAL_PROTOCOLLNPGM("\nBed Topography Report for CSV:"); SERIAL_EOL(); }
131
-    if (map_type == 2) { SERIAL_PROTOCOLLNPGM("\nBed Topography Report for LCD:"); SERIAL_EOL(); }
130
+    else {
131
+      SERIAL_PROTOCOLPGM(" for ");
132
+      serialprintPGM(map_type == 1 ? PSTR("CSV:\n\n") : PSTR("LCD:\n\n"));
133
+    }
132 134
 
133 135
     const float current_xi = get_cell_index_x(current_position[X_AXIS] + (MESH_X_DIST) / 2.0),
134 136
                 current_yi = get_cell_index_y(current_position[Y_AXIS] + (MESH_Y_DIST) / 2.0);
@@ -142,14 +144,14 @@
142 144
 
143 145
         const float f = z_values[i][j];
144 146
         if (isnan(f)) {
145
-          serialprintPGM((map_type == 0) ? PSTR("    .   ") : PSTR("NAN"));
147
+          serialprintPGM(map_type == 0 ? PSTR("    .   ") : PSTR("NAN"));
146 148
         }
147
-        else {
149
+        else if (map_type <= 1) {
148 150
           // if we don't do this, the columns won't line up nicely
149
-          if ((map_type == 0) && f >= 0.0) SERIAL_CHAR(' ');
150
-          if (map_type <= 1) SERIAL_PROTOCOL_F(f, 3);
151
-          idle();
151
+          if (map_type == 0 && f >= 0.0) SERIAL_CHAR(' ');
152
+          SERIAL_PROTOCOL_F(f, 3);
152 153
         }
154
+        idle();
153 155
         if (map_type == 1 && i < GRID_MAX_POINTS_X - 1) SERIAL_CHAR(',');
154 156
 
155 157
         #if TX_BUFFER_SIZE > 0
@@ -162,7 +164,7 @@
162 164
         }
163 165
       }
164 166
       SERIAL_EOL();
165
-      if (j && (map_type == 0)) { // we want the (0,0) up tight against the block of numbers
167
+      if (j && map_type == 0) { // we want the (0,0) up tight against the block of numbers
166 168
         SERIAL_CHAR(' ');
167 169
         SERIAL_EOL();
168 170
       }
@@ -183,8 +185,7 @@
183 185
   bool unified_bed_leveling::sanity_check() {
184 186
     uint8_t error_flag = 0;
185 187
 
186
-    const int a = settings.calc_num_meshes();
187
-    if (a < 1) {
188
+    if (settings.calc_num_meshes() < 1) {
188 189
       SERIAL_PROTOCOLLNPGM("?Insufficient EEPROM storage for a mesh of this size.");
189 190
       error_flag++;
190 191
     }

+ 1
- 1
Marlin/ubl_G29.cpp View File

@@ -1576,7 +1576,7 @@
1576 1576
 
1577 1577
       if (ubl_lcd_map_control) {
1578 1578
         #if ENABLED(DOGLCD)
1579
-        lcd_goto_screen(_lcd_ubl_output_map_lcd);
1579
+          lcd_goto_screen(_lcd_ubl_output_map_lcd);
1580 1580
         #endif
1581 1581
       }
1582 1582
       else lcd_return_to_status();

+ 10
- 11
Marlin/ultralcd.cpp View File

@@ -2094,11 +2094,11 @@ void kill_screen(const char* lcd_msg) {
2094 2094
       /*********************************************************/
2095 2095
       /************ Scale the box pixels appropriately *********/
2096 2096
       /*********************************************************/
2097
-      x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / GRID_MAX_POINTS_X) * GRID_MAX_POINTS_X;
2098
-      y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / GRID_MAX_POINTS_Y) * GRID_MAX_POINTS_Y;
2097
+      x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X);
2098
+      y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y);
2099 2099
 
2100
-      pixels_per_X_mesh_pnt = x_map_pixels / GRID_MAX_POINTS_X;
2101
-      pixels_per_Y_mesh_pnt = y_map_pixels / GRID_MAX_POINTS_Y;
2100
+      pixels_per_X_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X);
2101
+      pixels_per_Y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y);
2102 2102
 
2103 2103
       x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2;
2104 2104
       y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2;
@@ -2184,7 +2184,7 @@ void kill_screen(const char* lcd_msg) {
2184 2184
     void sync_plan_position();
2185 2185
 
2186 2186
     void _lcd_ubl_output_map_lcd() {
2187
-      static int step_scaler=0;
2187
+      static int16_t step_scaler = 0;
2188 2188
       int32_t signed_enc_pos;
2189 2189
 
2190 2190
       defer_return_to_status = true;
@@ -2194,11 +2194,10 @@ void kill_screen(const char* lcd_msg) {
2194 2194
         if (lcd_clicked) { return _lcd_ubl_map_lcd_edit_cmd(); }
2195 2195
         ENCODER_DIRECTION_NORMAL();
2196 2196
 
2197
-        if (encoderPosition != 0) {
2197
+        if (encoderPosition) {
2198 2198
           signed_enc_pos = (int32_t)encoderPosition;
2199 2199
           step_scaler += signed_enc_pos;
2200
-          x_plot = (x_plot + step_scaler / ENCODER_STEPS_PER_MENU_ITEM);
2201
-
2200
+          x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM);
2202 2201
           if (abs(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM)
2203 2202
             step_scaler = 0;
2204 2203
           refresh_cmd_timeout();
@@ -2240,7 +2239,7 @@ void kill_screen(const char* lcd_msg) {
2240 2239
 
2241 2240
           ubl_map_move_to_xy(); // Move to current location
2242 2241
 
2243
-          if (planner.movesplanned()>1) { // if the nozzle is moving, cancel the move.  There is a new location
2242
+          if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move.  There is a new location
2244 2243
             #define ENABLE_STEPPER_DRIVER_INTERRUPT()  SBI(TIMSK1, OCIE1A)
2245 2244
             #define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
2246 2245
             DISABLE_STEPPER_DRIVER_INTERRUPT();
@@ -4393,11 +4392,11 @@ void pad_message_string() {
4393 4392
     // pad with spaces to fill up the line
4394 4393
     while (j++ < LCD_WIDTH) lcd_status_message[i++] = ' ';
4395 4394
     // chop off at the edge
4396
-    lcd_status_message[--i] = '\0';
4395
+    lcd_status_message[i] = '\0';
4397 4396
   }
4398 4397
 }
4399 4398
 
4400
-void lcd_finishstatus(bool persist=false) {
4399
+void lcd_finishstatus(const bool persist=false) {
4401 4400
 
4402 4401
   pad_message_string();
4403 4402
 

+ 3
- 3
Marlin/ultralcd_impl_DOGM.h View File

@@ -408,7 +408,7 @@ FORCE_INLINE void _draw_axis_label(const AxisEnum axis, const char* const pstr,
408 408
   }
409 409
 }
410 410
 
411
-inline void lcd_implementation_status_message() {
411
+inline void lcd_implementation_status_message(const bool blink) {
412 412
   #if ENABLED(STATUS_MESSAGE_SCROLLING)
413 413
     static bool last_blink = false;
414 414
     const uint8_t slen = lcd_strlen(lcd_status_message);
@@ -693,7 +693,7 @@ static void lcd_implementation_status_screen() {
693 693
 
694 694
     #if ENABLED(FILAMENT_LCD_DISPLAY) && ENABLED(SDSUPPORT)
695 695
       if (PENDING(millis(), previous_lcd_status_ms + 5000UL)) {  //Display both Status message line and Filament display on the last line
696
-        lcd_implementation_status_message();
696
+        lcd_implementation_status_message(blink);
697 697
       }
698 698
       else {
699 699
         lcd_printPGM(PSTR(LCD_STR_FILAM_DIA));
@@ -705,7 +705,7 @@ static void lcd_implementation_status_screen() {
705 705
         u8g.print('%');
706 706
       }
707 707
     #else
708
-      lcd_implementation_status_message();
708
+      lcd_implementation_status_message(blink);
709 709
     #endif
710 710
   }
711 711
 }

Loading…
Cancel
Save