Fixed SICS-273: hnotify sends position updates for some stationary motors
Reverted change from rev 1.79 19-Aug-08 which was supposed to send IDLE state position updates if position change is greater than the precision. r2697 | ffr | 2008-09-18 16:00:52 +1000 (Thu, 18 Sep 2008) | 5 lines
This commit is contained in:
committed by
Douglas Clowes
parent
7919c7cd6a
commit
3afb9597f2
@@ -1746,9 +1746,7 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) {
|
||||
pAsyncTxn pCmd = event->event.msg.cmd;
|
||||
if (self->subState == 1) { /* Status Response */
|
||||
int iRet;
|
||||
long lDelta, lprecision;
|
||||
float fprecision;
|
||||
|
||||
long lDelta;
|
||||
iRet = rspStatus(self, pCmd->inp_buf);
|
||||
if (iRet == 0)
|
||||
break;
|
||||
@@ -1759,16 +1757,11 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) {
|
||||
return;
|
||||
}
|
||||
/* if the motor moved, update any observers */
|
||||
MotorGetPar(self->pMot, "precision", &fprecision);
|
||||
if (self->abs_encoder) {
|
||||
if (self->abs_encoder)
|
||||
lDelta = fabs(self->currCounts - self->lastCounts);
|
||||
lprecision = (long) (fprecision * self->cntsPerX + 0.5);
|
||||
} else {
|
||||
else
|
||||
lDelta = fabs(self->currSteps - self->lastSteps);
|
||||
lprecision = (long) (fprecision * self->stepsPerX + 0.5);
|
||||
}
|
||||
|
||||
if (lDelta > lprecision) {
|
||||
if (lDelta > 10) {
|
||||
set_lastMotion(self, self->currSteps, self->currCounts);
|
||||
report_motion(self);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user