Reverse compare operator to correct report rate logic
r3613 | dcl | 2012-06-20 14:57:37 +1000 (Wed, 20 Jun 2012) | 1 line
This commit is contained in:
6
motor.c
6
motor.c
@@ -76,6 +76,7 @@
|
||||
#define IGNOREFAULT 10
|
||||
#define MOVECOUNT 11
|
||||
|
||||
extern double DoubleTime(void);
|
||||
|
||||
/*-------------------------------------------------------------------------*/
|
||||
static void *MotorGetInterface(void *pData, int iID)
|
||||
@@ -369,10 +370,10 @@ static int evaluateStatus(pMotor self, SConnection *pCon)
|
||||
static void handleMoveCallback(pMotor self, SConnection *pCon)
|
||||
{
|
||||
#if 1
|
||||
double current_time, skip_time, DoubleTime(void);
|
||||
double current_time, skip_time;
|
||||
current_time = DoubleTime();
|
||||
skip_time = 0.001 * ObVal(self->ParArray,MOVECOUNT);
|
||||
if(self->last_report_time + skip_time >= current_time)
|
||||
if(self->last_report_time + skip_time <= current_time)
|
||||
#else
|
||||
self->posCount++;
|
||||
if(self->posCount >= ObVal(self->ParArray,MOVECOUNT))
|
||||
@@ -808,6 +809,7 @@ extern void KillPiPiezo(void *pData);
|
||||
self->moving = 1;
|
||||
self->fTarget = fHard;
|
||||
InvokeCallBack(self->pCall,HDBVAL,self);
|
||||
self->last_report_time = 0.0;
|
||||
self->posCount = 0;
|
||||
iRet = self->pDriver->RunTo(self->pDriver,fHard);
|
||||
if(iRet != OKOK)
|
||||
|
||||
Reference in New Issue
Block a user