Przeglądaj źródła

🩹 Fix Mesh Leveling + Debug compile (#24297)

tombrazier 3 lat temu
rodzic
commit
f6e123430f
No account linked to committer's email address
1 zmienionych plików z 5 dodań i 4 usunięć
  1. 5
    4
      Marlin/src/core/utility.cpp

+ 5
- 4
Marlin/src/core/utility.cpp Wyświetl plik

132
         #else
132
         #else
133
           #if ENABLED(AUTO_BED_LEVELING_UBL)
133
           #if ENABLED(AUTO_BED_LEVELING_UBL)
134
             SERIAL_ECHOPGM("UBL Adjustment Z");
134
             SERIAL_ECHOPGM("UBL Adjustment Z");
135
-            const float rz = bedlevel.get_z_correction(current_position);
136
           #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
135
           #elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
137
             SERIAL_ECHOPGM("ABL Adjustment Z");
136
             SERIAL_ECHOPGM("ABL Adjustment Z");
138
-            const float rz = bedlevel.get_z_correction(current_position);
139
           #endif
137
           #endif
138
+          const float rz = bedlevel.get_z_correction(current_position);
140
           SERIAL_ECHO(ftostr43sign(rz, '+'));
139
           SERIAL_ECHO(ftostr43sign(rz, '+'));
141
           #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
140
           #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
142
             if (planner.z_fade_height) {
141
             if (planner.z_fade_height) {
156
       SERIAL_ECHOPGM("Mesh Bed Leveling");
155
       SERIAL_ECHOPGM("Mesh Bed Leveling");
157
       if (planner.leveling_active) {
156
       if (planner.leveling_active) {
158
         SERIAL_ECHOLNPGM(" (enabled)");
157
         SERIAL_ECHOLNPGM(" (enabled)");
159
-        SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(bedlevel.get_z(current_position), '+'));
158
+        const float z_offset = bedlevel.get_z_offset(),
159
+                    z_correction = bedlevel.get_z_correction(current_position);
160
+        SERIAL_ECHOPGM("MBL Adjustment Z", ftostr43sign(z_offset + z_correction, '+'));
160
         #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
161
         #if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
161
           if (planner.z_fade_height) {
162
           if (planner.z_fade_height) {
162
             SERIAL_ECHOPGM(" (", ftostr43sign(
163
             SERIAL_ECHOPGM(" (", ftostr43sign(
163
-              bedlevel.get_z(current_position, planner.fade_scaling_factor_for_z(current_position.z)), '+'
164
+              z_offset + z_correction * planner.fade_scaling_factor_for_z(current_position.z), '+'
164
             ));
165
             ));
165
             SERIAL_CHAR(')');
166
             SERIAL_CHAR(')');
166
           }
167
           }

Ładowanie…
Anuluj
Zapisz