From 40e1042cdac46eee83d25af09bd0137e9beb66dd Mon Sep 17 00:00:00 2001 From: Douglas Clowes Date: Mon, 16 Apr 2007 10:46:55 +1000 Subject: [PATCH] reverse comparison operators r1856 | dcl | 2007-04-16 10:46:55 +1000 (Mon, 16 Apr 2007) | 2 lines --- site_ansto/motor_dmc2280.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/site_ansto/motor_dmc2280.c b/site_ansto/motor_dmc2280.c index 31a66f13..7494d4a3 100644 --- a/site_ansto/motor_dmc2280.c +++ b/site_ansto/motor_dmc2280.c @@ -712,15 +712,19 @@ static int DMC2280RunCommon(pDMC2280Driv self,float fValue){ snprintf(BGx, CMDLEN, "BG%c", axis); target = fValue - self->home; - if (self->backlash_offset > FLT_EPSILON && target < self->lastPosition) { - target += self->backlash_offset; - if (target > self->fUpper) - target = self->fUpper; + if (self->backlash_offset > FLT_EPSILON) { + if (target > self->lastPosition) { + target += self->backlash_offset; + if (target > self->fUpper) + target = self->fUpper; + } } - if (self->backlash_offset < -FLT_EPSILON && target > self->lastPosition) { - target += self->backlash_offset; - if (target < self->fLower) - target = self->fLower; + else if (self->backlash_offset < -FLT_EPSILON) { + if (target < self->lastPosition) { + target += self->backlash_offset; + if (target < self->fLower) + target = self->fLower; + } } if (1 == self->abs_endcoder) {