From 25d699eb73ef9b404df49c1dcb3a4be0e2112f99 Mon Sep 17 00:00:00 2001 From: MarkRivers Date: Mon, 23 Apr 2007 20:32:04 +0000 Subject: [PATCH] Removed status argument from interrupt callbacks --- motorApp/MotorSrc/devMotorAsyn.c | 10 ++++------ motorApp/MotorSrc/drvMotorAsyn.c | 19 +++++++------------ motorApp/NewportSrc/drvXPSAsynAux.c | 7 ++----- 3 files changed, 13 insertions(+), 23 deletions(-) diff --git a/motorApp/MotorSrc/devMotorAsyn.c b/motorApp/MotorSrc/devMotorAsyn.c index 843e88c8..66610a95 100644 --- a/motorApp/MotorSrc/devMotorAsyn.c +++ b/motorApp/MotorSrc/devMotorAsyn.c @@ -11,9 +11,9 @@ * Notwithstanding the above, explicit permission is granted for APS to * redistribute this software. * - * Version: $Revision: 1.18 $ + * Version: $Revision: 1.19 $ * Modified by: $Author: rivers $ - * Last Modified: $Date: 2007-04-17 21:05:42 $ + * Last Modified: $Date: 2007-04-23 20:26:36 $ * * Original Author: Peter Denison * Current Author: Peter Denison @@ -54,7 +54,7 @@ static long start_trans(struct motorRecord *); static RTN_STATUS build_trans( motor_cmnd, double *, struct motorRecord *); static RTN_STATUS end_trans(struct motorRecord *); static void asynCallback(asynUser *); -static void statusCallback(void *, asynUser *, struct MotorStatus *, asynStatus status); +static void statusCallback(void *, asynUser *, struct MotorStatus *); typedef enum {int32Type, float64Type, float64ArrayType} interfaceType; @@ -512,13 +512,11 @@ static void asynCallback(asynUser *pasynUser) * True callback to notify that controller status has changed. */ static void statusCallback(void *drvPvt, asynUser *pasynUser, - struct MotorStatus *value, asynStatus status) + struct MotorStatus *value) { motorAsynPvt *pPvt = (motorAsynPvt *)drvPvt; motorRecord *pmr = pPvt->pmr; - /* We should probably do something sensible if status != asynSuccess !! */ - asynPrint(pasynUser, ASYN_TRACEIO_DEVICE, "%s devMotorAsyn::statusCallback new value=[p:%f,e:%f,s:%x] %c%c\n", pmr->name, value->position, value->encoder_posn, value->status, diff --git a/motorApp/MotorSrc/drvMotorAsyn.c b/motorApp/MotorSrc/drvMotorAsyn.c index fb8548c3..eb6ac8a4 100644 --- a/motorApp/MotorSrc/drvMotorAsyn.c +++ b/motorApp/MotorSrc/drvMotorAsyn.c @@ -19,9 +19,9 @@ * of this distribution. * ************************************************************************ * - * Version: $Revision: 1.15 $ + * Version: $Revision: 1.16 $ * Modified by: $Author: rivers $ - * Last Modified: $Date: 2007-04-17 21:05:13 $ + * Last Modified: $Date: 2007-04-23 20:29:20 $ * * Original Author: Peter Denison * Current Author: Peter Denison @@ -711,11 +711,10 @@ static void intCallback(void *axisPvt, unsigned int nChanged, if (addr == pAxis->num) { for (i = 0; i < nChanged; i++) { if (changed[i] == reason) { - /* Do we need to pass status!=asynSuccess sometimes? */ (*pPvt->drvset->getDouble)(pAxis->axis, changed[i], &dvalue); pfloat64Interrupt->callback(pfloat64Interrupt->userPvt, pfloat64Interrupt->pasynUser, - dvalue, asynSuccess); + dvalue); } } } @@ -731,10 +730,9 @@ static void intCallback(void *axisPvt, unsigned int nChanged, addr = pmotorStatusInterrupt->addr; reason = pmotorStatusInterrupt->pasynUser->reason; if (addr == pAxis->num) { - /* Do we need to pass status!=asynSuccess sometimes? */ pmotorStatusInterrupt->callback(pmotorStatusInterrupt->userPvt, pmotorStatusInterrupt->pasynUser, - &pAxis->status, asynSuccess); + &pAxis->status); } pnode = (interruptNode *)ellNext(&pnode->node); } @@ -753,25 +751,22 @@ static void intCallback(void *axisPvt, unsigned int nChanged, if (BIT_ISSET(reason - motorStatusDirection, 1, &changedmask)) { (*pPvt->drvset->getInteger)(pAxis->axis, reason, &ivalue); - /* Do we need to pass status!=asynSuccess sometimes? */ pint32Interrupt->callback(pint32Interrupt->userPvt, pint32Interrupt->pasynUser, - ivalue, asynSuccess); + ivalue); } } /* If we've subscribed to the aggregate status */ else if (reason == motorStatus) { - /* Do we need to pass status!=asynSuccess sometimes? */ pint32Interrupt->callback(pint32Interrupt->userPvt, pint32Interrupt->pasynUser, - pAxis->status.status, asynSuccess); + pAxis->status.status); } else { (*pPvt->drvset->getInteger)(pAxis->axis, reason, &ivalue); - /* Do we need to pass status!=asynSuccess sometimes? */ pint32Interrupt->callback(pint32Interrupt->userPvt, pint32Interrupt->pasynUser, - ivalue, asynSuccess); + ivalue); } } pnode = (interruptNode *)ellNext(&pnode->node); diff --git a/motorApp/NewportSrc/drvXPSAsynAux.c b/motorApp/NewportSrc/drvXPSAsynAux.c index 84be929d..4e314415 100644 --- a/motorApp/NewportSrc/drvXPSAsynAux.c +++ b/motorApp/NewportSrc/drvXPSAsynAux.c @@ -473,7 +473,6 @@ static void XPSAuxPoller(drvXPSAsynAuxPvt *pPvt) int firstTime = 1; int i; int status; - asynStatus ioStatus = asynSuccess; asynUser *pasynUser; int addr, reason, mask, changedBits; @@ -489,14 +488,12 @@ static void XPSAuxPoller(drvXPSAsynAuxPvt *pPvt) if (status) { asynPrint(pPvt->pasynUser, ASYN_TRACE_ERROR, "drvXPSAsynAux::XPSAuxPoller error calling GPIOAnalogGet=%d\n", status); - ioStatus = asynError; } for (i=0; isocketID, digitalInputNames[i], &digitalValues[i]); if (status) { asynPrint(pPvt->pasynUser, ASYN_TRACE_ERROR, "drvXPSAsynAux::XPSAuxPoller error calling GPIODigitalGet=%d\n", status); - ioStatus = asynError; } } @@ -513,7 +510,7 @@ static void XPSAuxPoller(drvXPSAsynAuxPvt *pPvt) if (firstTime) changedBits = 0xffff; if ((mask & changedBits) && (reason == binaryInput)) { pUInt32DigitalInterrupt->callback(pUInt32DigitalInterrupt->userPvt, pasynUser, - mask & digitalValues[addr], ioStatus); + mask & digitalValues[addr]); } pnode = (interruptNode *)ellNext(&pnode->node); } @@ -532,7 +529,7 @@ static void XPSAuxPoller(drvXPSAsynAuxPvt *pPvt) if (reason == analogInput) { pfloat64Interrupt->callback(pfloat64Interrupt->userPvt, pfloat64Interrupt->pasynUser, - analogValues[addr], ioStatus); + analogValues[addr]); } pnode = (interruptNode *)ellNext(&pnode->node); }