Correct initialisation order in devMotorAsyn.c to make sure autosaved values

get picked up as the initial motor position, val, dval, rbv, etc
Fix initialisation of motors on Linux with autosave (was trying to lock a
   previously-destroyed mutex)
This commit is contained in:
Peter Denison
2007-09-18 12:41:59 +00:00
parent 11908beb94
commit dd8934bbda
+10 -5
View File
@@ -11,9 +11,9 @@
* Notwithstanding the above, explicit permission is granted for APS to
* redistribute this software.
*
* Version: $Revision: 1.19 $
* Modified by: $Author: rivers $
* Last Modified: $Date: 2007-04-23 20:26:36 $
* Version: $Revision: 1.20 $
* Modified by: $Author: peterd $
* Last Modified: $Date: 2007-09-18 12:41:59 $
*
* Original Author: Peter Denison
* Current Author: Peter Denison
@@ -132,6 +132,7 @@ static void init_controller(struct motorRecord *pmr )
{
epicsEventMustWait(initEvent);
epicsEventDestroy(initEvent);
pPvt->initEvent = 0;
}
}
}
@@ -230,6 +231,12 @@ static long init_record(struct motorRecord * pmr )
pmr->name, pasynUser->errorMessage);
}
/* Once everything is set-up, we can do the initial setting of position.
This should be the first thing that pushes onto the Asyn queue.
It needs to be done before we get the initial values back from the
controller.*/
init_controller(pmr);
/* Initiate calls to get the initial motor parameters
Have to do it the long-winded way, because before iocInit, none of the
locks or scan queues are initialised, so calls to scanOnce(),
@@ -250,8 +257,6 @@ static long init_record(struct motorRecord * pmr )
pasynManager->freeAsynUser(pasynUser);
pPvt->needUpdate = 1;
init_controller(pmr);
return(0);
bad:
pmr->pact=1;