|
@@ -2471,18 +2471,6 @@ static void clean_up_after_endstop_or_probe_move() {
|
2471
|
2471
|
;
|
2472
|
2472
|
}
|
2473
|
2473
|
|
2474
|
|
- bool leveling_is_active() {
|
2475
|
|
- return
|
2476
|
|
- #if ENABLED(MESH_BED_LEVELING)
|
2477
|
|
- mbl.active()
|
2478
|
|
- #elif ENABLED(AUTO_BED_LEVELING_UBL)
|
2479
|
|
- ubl.state.active
|
2480
|
|
- #else
|
2481
|
|
- planner.abl_enabled
|
2482
|
|
- #endif
|
2483
|
|
- ;
|
2484
|
|
- }
|
2485
|
|
-
|
2486
|
2474
|
/**
|
2487
|
2475
|
* Turn bed leveling on or off, fixing the current
|
2488
|
2476
|
* position as-needed.
|
|
@@ -2498,7 +2486,7 @@ static void clean_up_after_endstop_or_probe_move() {
|
2498
|
2486
|
constexpr bool can_change = true;
|
2499
|
2487
|
#endif
|
2500
|
2488
|
|
2501
|
|
- if (can_change && enable != leveling_is_active()) {
|
|
2489
|
+ if (can_change && enable != LEVELING_IS_ACTIVE()) {
|
2502
|
2490
|
|
2503
|
2491
|
#if ENABLED(MESH_BED_LEVELING)
|
2504
|
2492
|
|
|
@@ -2559,7 +2547,7 @@ static void clean_up_after_endstop_or_probe_move() {
|
2559
|
2547
|
|
2560
|
2548
|
void set_z_fade_height(const float zfh) {
|
2561
|
2549
|
|
2562
|
|
- const bool level_active = leveling_is_active();
|
|
2550
|
+ const bool level_active = LEVELING_IS_ACTIVE();
|
2563
|
2551
|
|
2564
|
2552
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
2565
|
2553
|
|
|
@@ -3771,7 +3759,7 @@ inline void gcode_G4() {
|
3771
|
3759
|
#elif ENABLED(AUTO_BED_LEVELING_UBL)
|
3772
|
3760
|
SERIAL_ECHOPGM("UBL");
|
3773
|
3761
|
#endif
|
3774
|
|
- if (leveling_is_active()) {
|
|
3762
|
+ if (LEVELING_IS_ACTIVE()) {
|
3775
|
3763
|
SERIAL_ECHOLNPGM(" (enabled)");
|
3776
|
3764
|
#if ABL_PLANAR
|
3777
|
3765
|
const float diff[XYZ] = {
|
|
@@ -3802,7 +3790,7 @@ inline void gcode_G4() {
|
3802
|
3790
|
#elif ENABLED(MESH_BED_LEVELING)
|
3803
|
3791
|
|
3804
|
3792
|
SERIAL_ECHOPGM("Mesh Bed Leveling");
|
3805
|
|
- if (leveling_is_active()) {
|
|
3793
|
+ if (LEVELING_IS_ACTIVE()) {
|
3806
|
3794
|
float lz = current_position[Z_AXIS];
|
3807
|
3795
|
planner.apply_leveling(current_position[X_AXIS], current_position[Y_AXIS], lz);
|
3808
|
3796
|
SERIAL_ECHOLNPGM(" (enabled)");
|
|
@@ -3971,7 +3959,7 @@ inline void gcode_G28(const bool always_home_all) {
|
3971
|
3959
|
// Disable the leveling matrix before homing
|
3972
|
3960
|
#if HAS_LEVELING
|
3973
|
3961
|
#if ENABLED(AUTO_BED_LEVELING_UBL)
|
3974
|
|
- const bool ubl_state_at_entry = leveling_is_active();
|
|
3962
|
+ const bool ubl_state_at_entry = LEVELING_IS_ACTIVE();
|
3975
|
3963
|
#endif
|
3976
|
3964
|
set_bed_leveling_enabled(false);
|
3977
|
3965
|
#endif
|
|
@@ -4261,7 +4249,7 @@ void home_all_axes() { gcode_G28(true); }
|
4261
|
4249
|
switch (state) {
|
4262
|
4250
|
case MeshReport:
|
4263
|
4251
|
if (leveling_is_valid()) {
|
4264
|
|
- SERIAL_PROTOCOLLNPAIR("State: ", leveling_is_active() ? MSG_ON : MSG_OFF);
|
|
4252
|
+ SERIAL_PROTOCOLLNPAIR("State: ", LEVELING_IS_ACTIVE() ? MSG_ON : MSG_OFF);
|
4265
|
4253
|
mbl_mesh_report();
|
4266
|
4254
|
}
|
4267
|
4255
|
else
|
|
@@ -4580,7 +4568,7 @@ void home_all_axes() { gcode_G28(true); }
|
4580
|
4568
|
abl_probe_index = -1;
|
4581
|
4569
|
#endif
|
4582
|
4570
|
|
4583
|
|
- abl_should_enable = leveling_is_active();
|
|
4571
|
+ abl_should_enable = LEVELING_IS_ACTIVE();
|
4584
|
4572
|
|
4585
|
4573
|
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
|
4586
|
4574
|
|
|
@@ -7077,7 +7065,7 @@ inline void gcode_M42() {
|
7077
|
7065
|
// Disable bed level correction in M48 because we want the raw data when we probe
|
7078
|
7066
|
|
7079
|
7067
|
#if HAS_LEVELING
|
7080
|
|
- const bool was_enabled = leveling_is_active();
|
|
7068
|
+ const bool was_enabled = LEVELING_IS_ACTIVE();
|
7081
|
7069
|
set_bed_leveling_enabled(false);
|
7082
|
7070
|
#endif
|
7083
|
7071
|
|
|
@@ -9413,7 +9401,7 @@ void quickstop_stepper() {
|
9413
|
9401
|
if (parser.seen('Z')) set_z_fade_height(parser.value_linear_units());
|
9414
|
9402
|
#endif
|
9415
|
9403
|
|
9416
|
|
- const bool new_status = leveling_is_active();
|
|
9404
|
+ const bool new_status = LEVELING_IS_ACTIVE();
|
9417
|
9405
|
|
9418
|
9406
|
if (to_enable && !new_status) {
|
9419
|
9407
|
SERIAL_ERROR_START();
|
|
@@ -9644,7 +9632,7 @@ inline void gcode_M502() {
|
9644
|
9632
|
#endif
|
9645
|
9633
|
|
9646
|
9634
|
#if ENABLED(BABYSTEP_ZPROBE_OFFSET)
|
9647
|
|
- if (!no_babystep && leveling_is_active())
|
|
9635
|
+ if (!no_babystep && LEVELING_IS_ACTIVE())
|
9648
|
9636
|
thermalManager.babystep_axis(Z_AXIS, -LROUND(diff * planner.axis_steps_per_mm[Z_AXIS]));
|
9649
|
9637
|
#else
|
9650
|
9638
|
UNUSED(no_babystep);
|
|
@@ -10691,7 +10679,7 @@ void tool_change(const uint8_t tmp_extruder, const float fr_mm_s/*=0.0*/, bool n
|
10691
|
10679
|
|
10692
|
10680
|
#if ENABLED(MESH_BED_LEVELING)
|
10693
|
10681
|
|
10694
|
|
- if (leveling_is_active()) {
|
|
10682
|
+ if (LEVELING_IS_ACTIVE()) {
|
10695
|
10683
|
#if ENABLED(DEBUG_LEVELING_FEATURE)
|
10696
|
10684
|
if (DEBUGGING(LEVELING)) SERIAL_ECHOPAIR("Z before MBL: ", current_position[Z_AXIS]);
|
10697
|
10685
|
#endif
|