diff --git a/src/emc/motion/axis.c b/src/emc/motion/axis.c index f6dd8d4aef0..4aa4a26ba13 100644 --- a/src/emc/motion/axis.c +++ b/src/emc/motion/axis.c @@ -447,7 +447,7 @@ void axis_handle_jogwheels(bool motion_teleop_flag, bool motion_enable_flag, boo aaccel_limit = ajog_accel_fraction * axis->acc_limit; } - new_ajog_counts = hal_get_si32(axis_data->ajog_counts); + new_ajog_counts = hal_get_sint(axis_data->ajog_counts); delta = new_ajog_counts - axis->old_ajog_counts; axis->old_ajog_counts = new_ajog_counts; if ( first_pass ) { continue; } diff --git a/tests/motion/jogwheel-axis/test-ui.py b/tests/motion/jogwheel-axis/test-ui.py index 052a8e2a6f8..dc3adba12bb 100755 --- a/tests/motion/jogwheel-axis/test-ui.py +++ b/tests/motion/jogwheel-axis/test-ui.py @@ -53,6 +53,23 @@ def jog_axis(axis_letter, counts=1, scale=0.001): sys.exit(1) +def preset_counts(axis_letter, counts): + # with jog-enable off motion takes the new counts without moving + h['axis-%c-jog-enable' % axis_letter] = 0 + h['axis-%c-jog-counts' % axis_letter] = counts + + timeout = 5.0 + start_time = time.time() + s.poll() + start_beat = s.heartbeat + while s.heartbeat - start_beat < 2: + if time.time() - start_time > timeout: + print("motion heartbeat did not advance") + sys.exit(1) + time.sleep(0.010) + s.poll() + + # # set up pins # shell out to halcmd to make nets to halui and motion @@ -115,5 +132,9 @@ def jog_axis(axis_letter, counts=1, scale=0.001): jog_axis('y', counts=10, scale=-0.025) jog_axis('z', counts=-100, scale=0.100) +# counts crossing 2^31 jog by the count difference +preset_counts('x', 2**31 - 2) +jog_axis('x', counts=4, scale=0.001) + sys.exit(0)