|
@@ -2094,11 +2094,11 @@ void kill_screen(const char* lcd_msg) {
|
2094
|
2094
|
/*********************************************************/
|
2095
|
2095
|
/************ Scale the box pixels appropriately *********/
|
2096
|
2096
|
/*********************************************************/
|
2097
|
|
- x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / GRID_MAX_POINTS_X) * GRID_MAX_POINTS_X;
|
2098
|
|
- y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / GRID_MAX_POINTS_Y) * GRID_MAX_POINTS_Y;
|
|
2097
|
+ x_map_pixels = ((MAP_MAX_PIXELS_X - 4) / (GRID_MAX_POINTS_X)) * (GRID_MAX_POINTS_X);
|
|
2098
|
+ y_map_pixels = ((MAP_MAX_PIXELS_Y - 4) / (GRID_MAX_POINTS_Y)) * (GRID_MAX_POINTS_Y);
|
2099
|
2099
|
|
2100
|
|
- pixels_per_X_mesh_pnt = x_map_pixels / GRID_MAX_POINTS_X;
|
2101
|
|
- pixels_per_Y_mesh_pnt = y_map_pixels / GRID_MAX_POINTS_Y;
|
|
2100
|
+ pixels_per_X_mesh_pnt = x_map_pixels / (GRID_MAX_POINTS_X);
|
|
2101
|
+ pixels_per_Y_mesh_pnt = y_map_pixels / (GRID_MAX_POINTS_Y);
|
2102
|
2102
|
|
2103
|
2103
|
x_offset = MAP_UPPER_LEFT_CORNER_X + 1 + (MAP_MAX_PIXELS_X - x_map_pixels - 2) / 2;
|
2104
|
2104
|
y_offset = MAP_UPPER_LEFT_CORNER_Y + 1 + (MAP_MAX_PIXELS_Y - y_map_pixels - 2) / 2;
|
|
@@ -2184,7 +2184,7 @@ void kill_screen(const char* lcd_msg) {
|
2184
|
2184
|
void sync_plan_position();
|
2185
|
2185
|
|
2186
|
2186
|
void _lcd_ubl_output_map_lcd() {
|
2187
|
|
- static int step_scaler=0;
|
|
2187
|
+ static int16_t step_scaler = 0;
|
2188
|
2188
|
int32_t signed_enc_pos;
|
2189
|
2189
|
|
2190
|
2190
|
defer_return_to_status = true;
|
|
@@ -2194,11 +2194,10 @@ void kill_screen(const char* lcd_msg) {
|
2194
|
2194
|
if (lcd_clicked) { return _lcd_ubl_map_lcd_edit_cmd(); }
|
2195
|
2195
|
ENCODER_DIRECTION_NORMAL();
|
2196
|
2196
|
|
2197
|
|
- if (encoderPosition != 0) {
|
|
2197
|
+ if (encoderPosition) {
|
2198
|
2198
|
signed_enc_pos = (int32_t)encoderPosition;
|
2199
|
2199
|
step_scaler += signed_enc_pos;
|
2200
|
|
- x_plot = (x_plot + step_scaler / ENCODER_STEPS_PER_MENU_ITEM);
|
2201
|
|
-
|
|
2200
|
+ x_plot += step_scaler / (ENCODER_STEPS_PER_MENU_ITEM);
|
2202
|
2201
|
if (abs(step_scaler) >= ENCODER_STEPS_PER_MENU_ITEM)
|
2203
|
2202
|
step_scaler = 0;
|
2204
|
2203
|
refresh_cmd_timeout();
|
|
@@ -2240,7 +2239,7 @@ void kill_screen(const char* lcd_msg) {
|
2240
|
2239
|
|
2241
|
2240
|
ubl_map_move_to_xy(); // Move to current location
|
2242
|
2241
|
|
2243
|
|
- if (planner.movesplanned()>1) { // if the nozzle is moving, cancel the move. There is a new location
|
|
2242
|
+ if (planner.movesplanned() > 1) { // if the nozzle is moving, cancel the move. There is a new location
|
2244
|
2243
|
#define ENABLE_STEPPER_DRIVER_INTERRUPT() SBI(TIMSK1, OCIE1A)
|
2245
|
2244
|
#define DISABLE_STEPPER_DRIVER_INTERRUPT() CBI(TIMSK1, OCIE1A)
|
2246
|
2245
|
DISABLE_STEPPER_DRIVER_INTERRUPT();
|