Add a proper flag for ABL enabled

This commit is contained in:
Scott Lahteine
2016-09-22 18:57:04 -05:00
parent 666e944336
commit cbc158eb62
3 changed files with 64 additions and 15 deletions

View File

@@ -98,6 +98,10 @@ float Planner::min_feedrate_mm_s,
Planner::max_e_jerk,
Planner::min_travel_feedrate_mm_s;
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
bool Planner::abl_enabled = false; // Flag that auto bed leveling is enabled
#endif
#if ENABLED(AUTO_BED_LEVELING_LINEAR)
matrix_3x3 Planner::bed_level_matrix; // Transform to compensate for bed level
#endif
@@ -524,6 +528,11 @@ void Planner::check_axes_activity() {
#if PLANNER_LEVELING
void Planner::apply_leveling(float &lx, float &ly, float &lz) {
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
if (!abl_enabled) return;
#endif
#if ENABLED(MESH_BED_LEVELING)
if (mbl.active())
@@ -562,6 +571,11 @@ void Planner::check_axes_activity() {
}
void Planner::unapply_leveling(float &lx, float &ly, float &lz) {
#if ENABLED(AUTO_BED_LEVELING_FEATURE)
if (!abl_enabled) return;
#endif
#if ENABLED(MESH_BED_LEVELING)
if (mbl.active())
@@ -627,8 +641,7 @@ void Planner::buffer_line(ARG_X, ARG_Y, ARG_Z, const float &e, float fr_mm_s, co
dz = target[Z_AXIS] - position[Z_AXIS];
/*
SERIAL_ECHOPGM(" Planner ");
SERIAL_ECHOPAIR("FR:", fr_mm_s);
SERIAL_ECHOPAIR(" Planner FR:", fr_mm_s);
SERIAL_CHAR(' ');
#if IS_KINEMATIC
SERIAL_ECHOPAIR("A:", lx);