From 1b7f232adade672b532942ae324a48dafcdf083c Mon Sep 17 00:00:00 2001 From: Ron Sluiter Date: Mon, 16 Jun 2003 15:07:25 +0000 Subject: [PATCH] Merged with R3_13_Branch. --- acsApp/src/drvMCB4B.cc | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/acsApp/src/drvMCB4B.cc b/acsApp/src/drvMCB4B.cc index fe2b5bf..c35382c 100644 --- a/acsApp/src/drvMCB4B.cc +++ b/acsApp/src/drvMCB4B.cc @@ -232,11 +232,15 @@ STATIC int set_status(int card, int signal) if (motorData == motor_info->position) motor_info->no_motion_count++; else - { - motor_info->position = motorData; - motor_info->encoder_position = motorData; - motor_info->no_motion_count = 0; - } + { + if (motorData >= motor_info->position) + motor_info->status |= RA_DIRECTION; + else + motor_info->status &= ~RA_DIRECTION; + motor_info->position = motorData; + motor_info->encoder_position = motorData; + motor_info->no_motion_count = 0; + } /* Parse motor velocity? */ /* NEEDS WORK */