mirror of
https://github.com/MarlinFirmware/Marlin.git
synced 2024-11-27 13:56:24 +00:00
One fewer compare in _lcd_move_xyz
This commit is contained in:
parent
e05c825a05
commit
e4acd2c40e
@ -2931,14 +2931,16 @@ void kill_screen(const char* lcd_msg) {
|
|||||||
const float diff = float((int32_t)encoderPosition) * move_menu_scale;
|
const float diff = float((int32_t)encoderPosition) * move_menu_scale;
|
||||||
#if IS_KINEMATIC
|
#if IS_KINEMATIC
|
||||||
manual_move_offset += diff;
|
manual_move_offset += diff;
|
||||||
// Limit only when trying to move towards the limit
|
if ((int32_t)encoderPosition < 0)
|
||||||
if ((int32_t)encoderPosition < 0) NOLESS(manual_move_offset, min - current_position[axis]);
|
NOLESS(manual_move_offset, min - current_position[axis]);
|
||||||
if ((int32_t)encoderPosition > 0) NOMORE(manual_move_offset, max - current_position[axis]);
|
else
|
||||||
|
NOMORE(manual_move_offset, max - current_position[axis]);
|
||||||
#else
|
#else
|
||||||
current_position[axis] += diff;
|
current_position[axis] += diff;
|
||||||
// Limit only when trying to move towards the limit
|
if ((int32_t)encoderPosition < 0)
|
||||||
if ((int32_t)encoderPosition < 0) NOLESS(current_position[axis], min);
|
NOLESS(current_position[axis], min);
|
||||||
if ((int32_t)encoderPosition > 0) NOMORE(current_position[axis], max);
|
else
|
||||||
|
NOMORE(current_position[axis], max);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
manual_move_to_current(axis);
|
manual_move_to_current(axis);
|
||||||
|
Loading…
Reference in New Issue
Block a user