WIP. Adding bed leveling code.
This commit is contained in:
@ -58,6 +58,10 @@
|
||||
#include "ultralcd.h"
|
||||
#include "language.h"
|
||||
|
||||
#if defined(MESH_BED_LEVELING)
|
||||
#include "mesh_bed_leveling.h"
|
||||
#endif // MESH_BED_LEVELING
|
||||
|
||||
//===========================================================================
|
||||
//============================= public variables ============================
|
||||
//===========================================================================
|
||||
@ -530,7 +534,7 @@ float junction_deviation = 0.1;
|
||||
// Add a new linear movement to the buffer. steps_x, _y and _z is the absolute position in
|
||||
// mm. Microseconds specify how many microseconds the move should take to perform. To aid acceleration
|
||||
// calculation the caller must also provide the physical length of the line in millimeters.
|
||||
#ifdef ENABLE_AUTO_BED_LEVELING
|
||||
#if defined(ENABLE_AUTO_BED_LEVELING) || defined(MESH_BED_LEVELING)
|
||||
void plan_buffer_line(float x, float y, float z, const float &e, float feed_rate, const uint8_t &extruder)
|
||||
#else
|
||||
void plan_buffer_line(const float &x, const float &y, const float &z, const float &e, float feed_rate, const uint8_t &extruder)
|
||||
@ -548,6 +552,10 @@ void plan_buffer_line(const float &x, const float &y, const float &z, const floa
|
||||
lcd_update();
|
||||
}
|
||||
|
||||
#if defined(MESH_BED_LEVELING)
|
||||
z += mbl.get_z(x, y);
|
||||
#endif // MESH_BED_LEVELING
|
||||
|
||||
#ifdef ENABLE_AUTO_BED_LEVELING
|
||||
apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
|
||||
#endif // ENABLE_AUTO_BED_LEVELING
|
||||
@ -1078,14 +1086,17 @@ vector_3 plan_get_position() {
|
||||
}
|
||||
#endif // ENABLE_AUTO_BED_LEVELING
|
||||
|
||||
#ifdef ENABLE_AUTO_BED_LEVELING
|
||||
#if defined(ENABLE_AUTO_BED_LEVELING) || defined(MESH_BED_LEVELING)
|
||||
void plan_set_position(float x, float y, float z, const float &e)
|
||||
{
|
||||
apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
|
||||
#else
|
||||
void plan_set_position(const float &x, const float &y, const float &z, const float &e)
|
||||
#endif // ENABLE_AUTO_BED_LEVELING || MESH_BED_LEVELING
|
||||
{
|
||||
#endif // ENABLE_AUTO_BED_LEVELING
|
||||
#if defined(ENABLE_AUTO_BED_LEVELING)
|
||||
apply_rotation_xyz(plan_bed_level_matrix, x, y, z);
|
||||
#elif defined(MESH_BED_LEVELING)
|
||||
z += mbl.get_z(x, y);
|
||||
#endif // ENABLE_AUTO_BED_LEVELING
|
||||
|
||||
position[X_AXIS] = lround(x*axis_steps_per_unit[X_AXIS]);
|
||||
position[Y_AXIS] = lround(y*axis_steps_per_unit[Y_AXIS]);
|
||||
|
Reference in New Issue
Block a user