Some cleanups for ubl lcd mesh map

This commit is contained in:
Scott Lahteine 2017-07-01 18:34:52 -05:00
parent f17bae1f70
commit abd6ba62b4
3 changed files with 17 additions and 26 deletions

View File

@ -273,6 +273,12 @@
#define LCD_FEEDRATE_CHAR 0x06
#define LCD_CLOCK_CHAR 0x07
#define LCD_STR_ARROW_RIGHT ">" /* from the default character set */
#if ENABLED(AUTO_BED_LEVELING_UBL)
#define LCD_UBL_BOXTOP_CHAR 0x01
#define LCD_UBL_BOXBOT_CHAR 0x02
#endif
#endif
/**

View File

@ -2188,28 +2188,24 @@ void kill_screen(const char* lcd_msg) {
void _lcd_ubl_output_map_lcd() {
static int16_t step_scaler = 0;
int32_t signed_enc_pos;
defer_return_to_status = true;
if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
return lcd_goto_screen(_lcd_ubl_map_homing);
if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
if (lcd_clicked) { return _lcd_ubl_map_lcd_edit_cmd(); }
if (lcd_clicked) return _lcd_ubl_map_lcd_edit_cmd();
ENCODER_DIRECTION_NORMAL();
if (encoderPosition) {
signed_enc_pos = (int32_t)encoderPosition;
step_scaler += signed_enc_pos;
step_scaler += (int32_t)encoderPosition;
x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM);
if (abs(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM)
step_scaler = 0;
refresh_cmd_timeout();
encoderPosition = 0;
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
}
encoderPosition = 0;
// Encoder to the right (++)
if (x_plot >= GRID_MAX_POINTS_X) { x_plot = 0; y_plot++; }
if (y_plot >= GRID_MAX_POINTS_Y) y_plot = 0;
@ -2236,22 +2232,11 @@ void kill_screen(const char* lcd_msg) {
ubl_map_move_to_xy(); // Move to current location
if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move. There is a new location
#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A)
#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
DISABLE_STEPPER_DRIVER_INTERRUPT();
while (planner.blocks_queued()) planner.discard_current_block();
stepper.current_block = NULL;
planner.clear_block_buffer_runtime();
ENABLE_STEPPER_DRIVER_INTERRUPT();
set_current_from_steppers_for_axis(ALL_AXES);
sync_plan_position();
if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move. There is a new location
quickstop_stepper();
ubl_map_move_to_xy(); // Move to new location
}
}
safe_delay(10);
}
else lcd_goto_screen(_lcd_ubl_map_homing);
}
/**

View File

@ -1134,8 +1134,8 @@ static void lcd_implementation_status_screen() {
B00000,
B11111
};
createChar_P(1, _lcd_box_top);
createChar_P(2, _lcd_box_bottom);
createChar_P(LCD_UBL_BOXTOP_CHAR, _lcd_box_top);
createChar_P(LCD_UBL_BOXBOT_CHAR, _lcd_box_bottom);
#endif
}
@ -1178,8 +1178,8 @@ static void lcd_implementation_status_screen() {
* Draw the Mesh Map Box
*/
uint8_t m;
lcd.setCursor(_MAP_X, 0); for (m = 0; m < 5; m++) lcd.write(1); // Top
lcd.setCursor(_MAP_X, 3); for (m = 0; m < 5; m++) lcd.write(2); // Bottom
lcd.setCursor(_MAP_X, 0); for (m = 0; m < 5; m++) lcd.write(LCD_UBL_BOXTOP_CHAR); // Top
lcd.setCursor(_MAP_X, 3); for (m = 0; m < 5; m++) lcd.write(LCD_UBL_BOXBOT_CHAR); // Bottom
for (m = 0; m <= 3; m++) {
lcd.setCursor(2, m); lcd.write('|'); // Left
lcd.setCursor(8, m); lcd.write('|'); // Right