Add ActionRoutine hook to motor object
r1728 | dcl | 2007-03-27 13:16:08 +1000 (Tue, 27 Mar 2007) | 2 lines
This commit is contained in:
8
motor.c
8
motor.c
@@ -407,7 +407,8 @@ static void handleMoveCallback(pMotor self, SConnection *pCon)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
memset(pM, 0, sizeof(Motor)); /* DFC init all to zero */
|
||||
pM->pActionRoutine = NULL; /* DFC belt and braces */
|
||||
|
||||
/* create and initialize parameters */
|
||||
pM->ParArray = ObParCreate(MOTOBPARLENGTH);
|
||||
@@ -1056,7 +1057,10 @@ extern MotorDriver *MakePiPiezo(Tcl_Interp *pTcl, char *pArray);
|
||||
}
|
||||
|
||||
/* create the interpreter command */
|
||||
iRet = AddCommand(pSics,argv[1],MotorAction,MotorKill,pNew);
|
||||
if (pNew->pActionRoutine)
|
||||
iRet = AddCommand(pSics,argv[1],pNew->pActionRoutine,MotorKill,pNew);
|
||||
else
|
||||
iRet = AddCommand(pSics,argv[1],MotorAction,MotorKill,pNew);
|
||||
if(!iRet)
|
||||
{
|
||||
sprintf(pBueffel,"ERROR: duplicate command %s not created",argv[1]);
|
||||
|
||||
Reference in New Issue
Block a user