|
@@ -2188,28 +2188,24 @@ void kill_screen(const char* lcd_msg) {
|
2188
|
2188
|
|
2189
|
2189
|
void _lcd_ubl_output_map_lcd() {
|
2190
|
2190
|
static int16_t step_scaler = 0;
|
2191
|
|
- int32_t signed_enc_pos;
|
2192
|
2191
|
|
2193
|
|
- defer_return_to_status = true;
|
2194
|
|
-
|
2195
|
|
- if (axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]) {
|
|
2192
|
+ if (!(axis_known_position[X_AXIS] && axis_known_position[Y_AXIS] && axis_known_position[Z_AXIS]))
|
|
2193
|
+ return lcd_goto_screen(_lcd_ubl_map_homing);
|
2196
|
2194
|
|
2197
|
|
- if (lcd_clicked) { return _lcd_ubl_map_lcd_edit_cmd(); }
|
|
2195
|
+ if (lcd_clicked) return _lcd_ubl_map_lcd_edit_cmd();
|
2198
|
2196
|
ENCODER_DIRECTION_NORMAL();
|
2199
|
2197
|
|
2200
|
2198
|
if (encoderPosition) {
|
2201
|
|
- signed_enc_pos = (int32_t)encoderPosition;
|
2202
|
|
- step_scaler += signed_enc_pos;
|
|
2199
|
+ step_scaler += (int32_t)encoderPosition;
|
2203
|
2200
|
x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM);
|
2204
|
2201
|
if (abs(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM)
|
2205
|
2202
|
step_scaler = 0;
|
2206
|
2203
|
refresh_cmd_timeout();
|
2207
|
2204
|
|
|
2205
|
+ encoderPosition = 0;
|
2208
|
2206
|
lcdDrawUpdate = LCDVIEW_REDRAW_NOW;
|
2209
|
2207
|
}
|
2210
|
2208
|
|
2211
|
|
- encoderPosition = 0;
|
2212
|
|
-
|
2213
|
2209
|
// Encoder to the right (++)
|
2214
|
2210
|
if (x_plot >= GRID_MAX_POINTS_X) { x_plot = 0; y_plot++; }
|
2215
|
2211
|
if (y_plot >= GRID_MAX_POINTS_Y) y_plot = 0;
|
|
@@ -2236,22 +2232,11 @@ void kill_screen(const char* lcd_msg) {
|
2236
|
2232
|
|
2237
|
2233
|
ubl_map_move_to_xy(); // Move to current location
|
2238
|
2234
|
|
2239
|
|
- if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move. There is a new location
|
2240
|
|
- #define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A)
|
2241
|
|
- #define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
|
2242
|
|
- DISABLE_STEPPER_DRIVER_INTERRUPT();
|
2243
|
|
- while (planner.blocks_queued()) planner.discard_current_block();
|
2244
|
|
- stepper.current_block = NULL;
|
2245
|
|
- planner.clear_block_buffer_runtime();
|
2246
|
|
- ENABLE_STEPPER_DRIVER_INTERRUPT();
|
2247
|
|
- set_current_from_steppers_for_axis(ALL_AXES);
|
2248
|
|
- sync_plan_position();
|
|
2235
|
+ if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move. There is a new location
|
|
2236
|
+ quickstop_stepper();
|
2249
|
2237
|
ubl_map_move_to_xy(); // Move to new location
|
2250
|
2238
|
}
|
2251
|
2239
|
}
|
2252
|
|
- safe_delay(10);
|
2253
|
|
- }
|
2254
|
|
- else lcd_goto_screen(_lcd_ubl_map_homing);
|
2255
|
2240
|
}
|
2256
|
2241
|
|
2257
|
2242
|
/**
|