Save 28b PROGMEM in ultralcd.cpp (line_to_current)

This commit is contained in:
Scott Lahteine 2017-06-06 02:30:39 -05:00
parent e6d10f6ddd
commit 2a41f0ff84

View File

@ -686,8 +686,13 @@ void kill_screen(const char* lcd_msg) {
else lcd_buzz(20, 440); else lcd_buzz(20, 440);
} }
inline void line_to_current(AxisEnum axis) { inline void line_to_current_z() {
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[axis]), active_extruder); planner.buffer_line_kinematic(current_position, MMM_TO_MMS(manual_feedrate_mm_m[Z_AXIS]), active_extruder);
}
inline void line_to_z(const float &z) {
current_position[Z_AXIS] = z;
line_to_current_z();
} }
#if ENABLED(SDSUPPORT) #if ENABLED(SDSUPPORT)
@ -1521,8 +1526,7 @@ void kill_screen(const char* lcd_msg) {
// //
void _lcd_after_probing() { void _lcd_after_probing() {
#if MANUAL_PROBE_HEIGHT > 0 #if MANUAL_PROBE_HEIGHT > 0
current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT; line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
line_to_current(Z_AXIS);
#endif #endif
// Display "Done" screen and wait for moves to complete // Display "Done" screen and wait for moves to complete
#if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING) #if MANUAL_PROBE_HEIGHT > 0 || ENABLED(MESH_BED_LEVELING)
@ -1539,15 +1543,13 @@ void kill_screen(const char* lcd_msg) {
// Utility to go to the next mesh point // Utility to go to the next mesh point
inline void _manual_probe_goto_xy(float x, float y) { inline void _manual_probe_goto_xy(float x, float y) {
#if MANUAL_PROBE_HEIGHT > 0 #if MANUAL_PROBE_HEIGHT > 0
current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT; line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS) + MANUAL_PROBE_HEIGHT);
line_to_current(Z_AXIS);
#endif #endif
current_position[X_AXIS] = LOGICAL_X_POSITION(x); current_position[X_AXIS] = LOGICAL_X_POSITION(x);
current_position[Y_AXIS] = LOGICAL_Y_POSITION(y); current_position[Y_AXIS] = LOGICAL_Y_POSITION(y);
planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder); planner.buffer_line_kinematic(current_position, MMM_TO_MMS(XY_PROBE_SPEED), active_extruder);
#if MANUAL_PROBE_HEIGHT > 0 #if MANUAL_PROBE_HEIGHT > 0
current_position[Z_AXIS] = LOGICAL_Z_POSITION(Z_MIN_POS); line_to_z(LOGICAL_Z_POSITION(Z_MIN_POS));
line_to_current(Z_AXIS);
#endif #endif
lcd_synchronize(); lcd_synchronize();
} }
@ -1629,10 +1631,8 @@ void kill_screen(const char* lcd_msg) {
// //
if (encoderPosition) { if (encoderPosition) {
refresh_cmd_timeout(); refresh_cmd_timeout();
current_position[Z_AXIS] += float((int32_t)encoderPosition) * (MBL_Z_STEP); const float z = current_position[Z_AXIS] + float((int32_t)encoderPosition) * (MBL_Z_STEP);
NOLESS(current_position[Z_AXIS], -(LCD_PROBE_Z_RANGE) * 0.5); line_to_z(constrain(z, -(LCD_PROBE_Z_RANGE) * 0.5, (LCD_PROBE_Z_RANGE) * 0.5));
NOMORE(current_position[Z_AXIS], (LCD_PROBE_Z_RANGE) * 0.5);
line_to_current(Z_AXIS);
lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT; lcdDrawUpdate = LCDVIEW_CALL_REDRAW_NEXT;
encoderPosition = 0; encoderPosition = 0;
} }
@ -2299,15 +2299,13 @@ void kill_screen(const char* lcd_msg) {
reset_bed_level(); // After calibration bed-level data is no longer valid reset_bed_level(); // After calibration bed-level data is no longer valid
#endif #endif
current_position[Z_AXIS] = max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5; line_to_z(max(Z_HOMING_HEIGHT, Z_CLEARANCE_BETWEEN_PROBES) + (DELTA_PRINTABLE_RADIUS) / 5);
line_to_current(Z_AXIS);
current_position[X_AXIS] = a < 0 ? LOGICAL_X_POSITION(X_HOME_POS) : cos(RADIANS(a)) * delta_calibration_radius; current_position[X_AXIS] = a < 0 ? LOGICAL_X_POSITION(X_HOME_POS) : cos(RADIANS(a)) * delta_calibration_radius;
current_position[Y_AXIS] = a < 0 ? LOGICAL_Y_POSITION(Y_HOME_POS) : sin(RADIANS(a)) * delta_calibration_radius; current_position[Y_AXIS] = a < 0 ? LOGICAL_Y_POSITION(Y_HOME_POS) : sin(RADIANS(a)) * delta_calibration_radius;
line_to_current(Z_AXIS); line_to_current_z();
current_position[Z_AXIS] = 4.0; line_to_z(4.0);
line_to_current(Z_AXIS);
lcd_synchronize(); lcd_synchronize();
@ -2536,8 +2534,7 @@ void kill_screen(const char* lcd_msg) {
#if ENABLED(DELTA) #if ENABLED(DELTA)
#define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height) #define _MOVE_XY_ALLOWED (current_position[Z_AXIS] <= delta_clip_start_height)
void lcd_lower_z_to_clip_height() { void lcd_lower_z_to_clip_height() {
current_position[Z_AXIS] = delta_clip_start_height; line_to_z(delta_clip_start_height);
line_to_current(Z_AXIS);
lcd_synchronize(); lcd_synchronize();
} }
#else #else