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:
Douglas Clowes
2007-03-27 13:16:08 +10:00
parent 86c6d626d0
commit 3a5e8ed7e1
5 changed files with 56 additions and 3 deletions

View File

@@ -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]);