Cleanups for leveling-related code

This commit is contained in:
Scott Lahteine 2018-11-03 02:13:10 -05:00
parent cc2bc67440
commit 44fa7fb18c
9 changed files with 30 additions and 40 deletions

View File

@ -25,6 +25,7 @@
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
#include "abl.h"
#include "../bedlevel.h"
#include "../../../module/motion.h"

View File

@ -21,11 +21,7 @@
*/
#pragma once
#include "../../../inc/MarlinConfig.h"
#if ENABLED(AUTO_BED_LEVELING_BILINEAR)
#include "../bedlevel.h"
#include "../../../inc/MarlinConfigPre.h"
extern int bilinear_grid_spacing[2], bilinear_start[2];
extern float bilinear_grid_factor[2],
@ -44,4 +40,4 @@
void bilinear_line_to_destination(const float fr_mm_s, uint16_t x_splits=0xFFFF, uint16_t y_splits=0xFFFF);
#endif
#endif // AUTO_BED_LEVELING_BILINEAR
#define Z_VALUES(X,Y) z_values[X][Y]

View File

@ -80,6 +80,6 @@ void reset_bed_level();
#include "mbl/mesh_bed_leveling.h"
#elif ENABLED(AUTO_BED_LEVELING_UBL)
#include "ubl/ubl.h"
#elif HAS_ABL
#elif ENABLED(AUTO_BED_LEVELING_BILINEAR)
#include "abl/abl.h"
#endif

View File

@ -118,3 +118,5 @@ public:
};
extern mesh_bed_leveling mbl;
#define Z_VALUES(X,Y) mbl.z_values[X][Y]

View File

@ -370,3 +370,5 @@ class unified_bed_leveling {
}; // class unified_bed_leveling
extern unified_bed_leveling ubl;
#define Z_VALUES(X,Y) ubl.z_values[X][Y]

View File

@ -105,12 +105,6 @@ void GcodeSuite::M420() {
#if HAS_MESH
#if ENABLED(MESH_BED_LEVELING)
#define Z_VALUES(X,Y) mbl.z_values[X][Y]
#else
#define Z_VALUES(X,Y) z_values[X][Y]
#endif
// Subtract the given value or the mean from all mesh values
if (leveling_is_valid() && parser.seen('C')) {
const float cval = parser.value_float();

View File

@ -19,15 +19,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
*/
#pragma once
/**
* Conditionals_LCD.h
* Conditionals that need to be set before Configuration_adv.h or pins.h
*/
#ifndef CONDITIONALS_LCD_H // Get the LCD defines which are needed first
#define CONDITIONALS_LCD_H
#define LCD_HAS_DIRECTIONAL_BUTTONS (BUTTON_EXISTS(UP) || BUTTON_EXISTS(DWN) || BUTTON_EXISTS(LFT) || BUTTON_EXISTS(RT))
#if ENABLED(CARTESIO_UI)
@ -557,6 +555,10 @@
#define HOMING_Z_WITH_PROBE (HAS_BED_PROBE && Z_HOME_DIR < 0 && ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN))
#ifdef GRID_MAX_POINTS_X
#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
#endif
#define HAS_SOFTWARE_ENDSTOPS (ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS))
#define HAS_RESUME_CONTINUE (ENABLED(EXTENSIBLE_UI) || ENABLED(NEWPANEL) || ENABLED(EMERGENCY_PARSER))
#define HAS_COLOR_LEDS (ENABLED(BLINKM) || ENABLED(RGB_LED) || ENABLED(RGBW_LED) || ENABLED(PCA9632) || ENABLED(NEOPIXEL_LED))
@ -566,4 +568,6 @@
#define Z_MULTI_STEPPER_DRIVERS (ENABLED(Z_DUAL_STEPPER_DRIVERS) || ENABLED(Z_TRIPLE_STEPPER_DRIVERS))
#define Z_MULTI_ENDSTOPS (ENABLED(Z_DUAL_ENDSTOPS) || ENABLED(Z_TRIPLE_ENDSTOPS))
#endif // CONDITIONALS_LCD_H
#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
#define IS_CARTESIAN !IS_KINEMATIC

View File

@ -43,10 +43,6 @@
#define NOT_A_PIN 0 // For PINS_DEBUGGING
#endif
#define IS_SCARA (ENABLED(MORGAN_SCARA) || ENABLED(MAKERARM_SCARA))
#define IS_KINEMATIC (ENABLED(DELTA) || IS_SCARA)
#define IS_CARTESIAN !IS_KINEMATIC
#define HAS_CLASSIC_JERK (IS_KINEMATIC || DISABLED(JUNCTION_DEVIATION))
/**
@ -1538,9 +1534,6 @@
#define LCD_TIMEOUT_TO_STATUS 15000
#endif
// Shorthand
#define GRID_MAX_POINTS ((GRID_MAX_POINTS_X) * (GRID_MAX_POINTS_Y))
// Add commands that need sub-codes to this list
#define USE_GCODE_SUBCODES ENABLED(G38_PROBE_TARGET) || ENABLED(CNC_COORDINATE_SYSTEMS) || ENABLED(POWER_LOSS_RECOVERY)

View File

@ -320,8 +320,6 @@
#if ENABLED(AUTO_BED_LEVELING_UBL)
void lcd_mesh_edit_setup(const float &initial);
float lcd_mesh_edit();
void lcd_z_offset_edit_setup(const float &initial);
float lcd_z_offset_edit();
#endif
#if ENABLED(SCROLL_LONG_FILENAMES)