|
@@ -2243,7 +2243,13 @@ static void clean_up_after_endstop_or_probe_move() {
|
2243
|
2243
|
|
2244
|
2244
|
#elif HAS_ABL
|
2245
|
2245
|
|
2246
|
|
- if (enable != planner.abl_enabled) {
|
|
2246
|
+ #if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
|
2247
|
+ const bool can_change = (!enable || (bilinear_grid_spacing[0] && bilinear_grid_spacing[1]));
|
|
2248
|
+ #else
|
|
2249
|
+ constexpr bool can_change = true;
|
|
2250
|
+ #endif
|
|
2251
|
+
|
|
2252
|
+ if (can_change && enable != planner.abl_enabled) {
|
2247
|
2253
|
planner.abl_enabled = enable;
|
2248
|
2254
|
if (!enable)
|
2249
|
2255
|
set_current_from_steppers_for_axis(
|
|
@@ -7007,10 +7013,27 @@ void quickstop_stepper() {
|
7007
|
7013
|
* Z[height] Sets the Z fade height (0 or none to disable)
|
7008
|
7014
|
*/
|
7009
|
7015
|
inline void gcode_M420() {
|
7010
|
|
- if (code_seen('S')) set_bed_leveling_enabled(code_value_bool());
|
|
7016
|
+ bool to_enable = false;
|
|
7017
|
+
|
|
7018
|
+ if (code_seen('S')) {
|
|
7019
|
+ to_enable = code_value_bool();
|
|
7020
|
+ set_bed_leveling_enabled(to_enable);
|
|
7021
|
+ }
|
|
7022
|
+
|
7011
|
7023
|
#if ENABLED(ENABLE_LEVELING_FADE_HEIGHT)
|
7012
|
7024
|
if (code_seen('Z')) set_z_fade_height(code_value_linear_units());
|
7013
|
7025
|
#endif
|
|
7026
|
+
|
|
7027
|
+ if (to_enable && !(
|
|
7028
|
+ #if ENABLED(MESH_BED_LEVELING)
|
|
7029
|
+ mbl.active()
|
|
7030
|
+ #else
|
|
7031
|
+ planner.abl_enabled
|
|
7032
|
+ #endif
|
|
7033
|
+ ) ) {
|
|
7034
|
+ SERIAL_ERROR_START;
|
|
7035
|
+ SERIAL_ERRORLNPGM(MSG_ERR_M420_FAILED);
|
|
7036
|
+ }
|
7014
|
7037
|
}
|
7015
|
7038
|
#endif
|
7016
|
7039
|
|