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;
|
pAsyncTxn pCmd = event->event.msg.cmd;
|
||||||
if (self->subState == 1) { /* Status Response */
|
if (self->subState == 1) { /* Status Response */
|
||||||
int iRet;
|
int iRet;
|
||||||
long lDelta, lprecision;
|
long lDelta;
|
||||||
float fprecision;
|
|
||||||
|
|
||||||
iRet = rspStatus(self, pCmd->inp_buf);
|
iRet = rspStatus(self, pCmd->inp_buf);
|
||||||
if (iRet == 0)
|
if (iRet == 0)
|
||||||
break;
|
break;
|
||||||
@@ -1759,16 +1757,11 @@ static void DMCState_Idle(pDMC2280Driv self, pEvtEvent event) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
/* if the motor moved, update any observers */
|
/* 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);
|
lDelta = fabs(self->currCounts - self->lastCounts);
|
||||||
lprecision = (long) (fprecision * self->cntsPerX + 0.5);
|
else
|
||||||
} else {
|
|
||||||
lDelta = fabs(self->currSteps - self->lastSteps);
|
lDelta = fabs(self->currSteps - self->lastSteps);
|
||||||
lprecision = (long) (fprecision * self->stepsPerX + 0.5);
|
if (lDelta > 10) {
|
||||||
}
|
|
||||||
|
|
||||||
if (lDelta > lprecision) {
|
|
||||||
set_lastMotion(self, self->currSteps, self->currCounts);
|
set_lastMotion(self, self->currSteps, self->currCounts);
|
||||||
report_motion(self);
|
report_motion(self);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user