Make the MOTEND reporting into a one-shot

r3600 | dcl | 2012-06-13 17:15:41 +1000 (Wed, 13 Jun 2012) | 1 line
This commit is contained in:
Douglas Clowes
2012-06-13 17:15:41 +10:00
parent 50e508d79b
commit 9fa9bcf4f9
2 changed files with 6 additions and 0 deletions

View File

@@ -260,6 +260,10 @@ void finishDriving(pMotor self, SConnection *pCon)
sCall.pName = self->name;
self->fPosition = sCall.fVal;
self->fPosition = sCall.fVal;
/* If the moving flag has been reset then skip the invokes */
if (self->moving == 0)
return;
self->moving = 0;
InvokeCallBack(self->pCall, MOTDRIVE, &sCall); /* send also very last position */
InvokeCallBack(self->pCall, MOTEND, &sCall);
}
@@ -791,6 +795,7 @@ extern void KillPiPiezo(void *pData);
self->posFaultCount = 0;
self->retryCount = 0;
self->stopped = 0;
self->moving = 1;
self->fTarget = fHard;
InvokeCallBack(self->pCall,HDBVAL,self);
self->posCount = 0;