Changes for driver cleanup
This commit is contained in:
@@ -101,9 +101,9 @@ static long init_record(pai)
|
||||
|
||||
/* call driver so that it configures card */
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
if(status=ai_driver(pvmeio->card,pvmeio->signal,DVX2502,&value)) {
|
||||
if(status=dvx_driver(pvmeio->card,pvmeio->signal,&value)) {
|
||||
strcpy(message,pai->name);
|
||||
strcat(message,": devAiDvx2502 (init_record) ai_driver error");
|
||||
strcat(message,": devAiDvx2502 (init_record) dvx_driver error");
|
||||
errMessage(status,message);
|
||||
return(status);
|
||||
}
|
||||
@@ -134,7 +134,7 @@ static long read_ai(pai)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
if(status=ai_driver(pvmeio->card,pvmeio->signal,DVX2502,&value))
|
||||
if(status=dvx_driver(pvmeio->card,pvmeio->signal,&value))
|
||||
return(status);
|
||||
*((unsigned short*)(&pai->rval))=value;
|
||||
if(status==0 || status==-2) pai->rval = value;
|
||||
|
||||
@@ -97,9 +97,9 @@ static long init_record(pai)
|
||||
|
||||
/* call driver so that it configures card */
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
if(status=ai_driver(pvmeio->card,pvmeio->signal,XY566DI,&value)) {
|
||||
if(status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566DI,&value)) {
|
||||
strcpy(message,pai->name);
|
||||
strcat(message,": devAiXy566Di (init_record) ai_driver error");
|
||||
strcat(message,": devAiXy566Di (init_record) ai_xy566_driver error");
|
||||
errMessage(status,message);
|
||||
return(status);
|
||||
}
|
||||
@@ -115,7 +115,7 @@ static long read_ai(pai)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
status=ai_driver(pvmeio->card,pvmeio->signal,XY566DI,&value);
|
||||
status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566DI,&value);
|
||||
if(status==-1) {
|
||||
status = 2; /* don't convert*/
|
||||
recGblSetSevr(pai,READ_ALARM,VALID_ALARM);
|
||||
@@ -125,11 +125,6 @@ static long read_ai(pai)
|
||||
recGblSetSevr(pai,HW_LIMIT_ALARM,VALID_ALARM);
|
||||
}
|
||||
if(status!=0) return(status);
|
||||
/*read into hardware as -0x7ff to +0x7ff */
|
||||
/* normalize to 0 - 0xfff */
|
||||
value = value + 0x800;
|
||||
/* remove the sign bit */
|
||||
value &= 0xfff;
|
||||
pai->rval = value;
|
||||
return(status);
|
||||
}
|
||||
|
||||
@@ -96,9 +96,9 @@ static long init_record(pai)
|
||||
|
||||
/* call driver so that it configures card */
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
if(status=ai_driver(pvmeio->card,pvmeio->signal,XY566SE,&value)) {
|
||||
if(status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566SE,&value)) {
|
||||
strcpy(message,pai->name);
|
||||
strcat(message,": devAiXy566Se (init_record) ai_driver error");
|
||||
strcat(message,": devAiXy566Se (init_record) ai_xy566_driver error");
|
||||
errMessage(status,message);
|
||||
return(status);
|
||||
}
|
||||
@@ -114,7 +114,7 @@ static long read_ai(pai)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pai->inp.value);
|
||||
status=ai_driver(pvmeio->card,pvmeio->signal,XY566SE,&value);
|
||||
status=ai_xy566_driver(pvmeio->card,pvmeio->signal,XY566SE,&value);
|
||||
if(status==-1) {
|
||||
status = 2; /*don't convert*/
|
||||
recGblSetSevr(pai,READ_ALARM,VALID_ALARM);
|
||||
|
||||
@@ -112,7 +112,7 @@ static long write_ao(pao)
|
||||
|
||||
pvmeio = (struct vmeio *)&(pao->out.value);
|
||||
value = pao->rval;
|
||||
status = ao_driver(pvmeio->card,pvmeio->signal,VMI4100,&value,&rbvalue);
|
||||
status = vmi4100_driver(pvmeio->card,pvmeio->signal,&value,&rbvalue);
|
||||
if(status==0 || status==-2) pao->rbv = rbvalue;
|
||||
if(status==-1) {
|
||||
recGblSetSevr(pao,WRITE_ALARM,VALID_ALARM);
|
||||
@@ -142,7 +142,7 @@ struct aoRecord *pao;
|
||||
struct vmeio *pvmeio = &pao->out.value.vmeio;
|
||||
|
||||
/* get the value from the ao driver */
|
||||
ao_read(pvmeio->card,pvmeio->signal,VMI4100,&value);
|
||||
vmi4100_read(pvmeio->card,pvmeio->signal,&value);
|
||||
pao->rbv = pao->rval = value;
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -100,7 +100,7 @@ static long read_bi(pbi)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbi->inp.value);
|
||||
status = bi_driver(pvmeio->card,pbi->mask,BB910,&value);
|
||||
status = bb910_driver(pvmeio->card,pbi->mask,&value);
|
||||
if(status==0) {
|
||||
pbi->rval = value;
|
||||
return(0);
|
||||
|
||||
@@ -100,7 +100,7 @@ static long read_bi(pbi)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbi->inp.value);
|
||||
status = bi_driver(pvmeio->card,pbi->mask,XY210,&value);
|
||||
status = xy210_driver(pvmeio->card,pbi->mask,&value);
|
||||
if(status==0) {
|
||||
pbi->rval = value;
|
||||
return(0);
|
||||
|
||||
@@ -83,7 +83,7 @@ static long init_record(pbo)
|
||||
pbo->mask = 1;
|
||||
pbo->mask <<= pvmeio->signal;
|
||||
/* read the value via bo driver */
|
||||
status = bo_read(pvmeio->card,pbo->mask,&value,BB902);
|
||||
status = bb902_read(pvmeio->card,pbo->mask,&value);
|
||||
if(status == 0) {
|
||||
pbo->rval = value;
|
||||
} else if(status == -1) {
|
||||
@@ -115,7 +115,7 @@ static long write_bo(pbo)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbo->out.value);
|
||||
status = bo_driver(pvmeio->card,pbo->rval,pbo->mask,BB902);
|
||||
status = bb902_driver(pvmeio->card,pbo->rval,pbo->mask);
|
||||
if(status!=0) {
|
||||
recGblSetSevr(pbo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ static long init_record(pbo)
|
||||
pvmeio = (struct vmeio *)&(pbo->out.value);
|
||||
pbo->mask = 1;
|
||||
pbo->mask <<= pvmeio->signal;
|
||||
status = bo_read(pvmeio->card,pbo->mask,&value,XY220);
|
||||
status = xy220_read(pvmeio->card,pbo->mask,&value);
|
||||
if(status == 0) {
|
||||
pbo->rval = value;
|
||||
} else if(status == -1) {
|
||||
@@ -115,7 +115,7 @@ static long write_bo(pbo)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pbo->out.value);
|
||||
status = bo_driver(pvmeio->card,pbo->rval,pbo->mask,XY220);
|
||||
status = xy220_driver(pvmeio->card,pbo->rval,pbo->mask);
|
||||
if(status!=0) {
|
||||
recGblSetSevr(pbo,WRITE_ALARM,VALID_ALARM);
|
||||
}
|
||||
|
||||
@@ -67,12 +67,14 @@ struct {
|
||||
read_event,
|
||||
NULL};
|
||||
|
||||
IOSCANPVT ioscanpvt;
|
||||
static IOSCANPVT ioscanpvt;
|
||||
WDOG_ID wd_id=NULL;
|
||||
|
||||
|
||||
static long init()
|
||||
static long init(after)
|
||||
int after;
|
||||
{
|
||||
if(after) return(0);
|
||||
scanIoInit(&ioscanpvt);
|
||||
return(0);
|
||||
}
|
||||
|
||||
@@ -99,7 +99,7 @@ static long read_mbbi(pmbbi)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pmbbi->inp.value);
|
||||
status = bi_driver(pvmeio->card,pmbbi->mask,BB910,&value);
|
||||
status = bb910_driver(pvmeio->card,pmbbi->mask,&value);
|
||||
if(status==0) {
|
||||
pmbbi->rval = value;
|
||||
} else {
|
||||
|
||||
@@ -99,7 +99,7 @@ static long read_mbbi(pmbbi)
|
||||
|
||||
|
||||
pvmeio = (struct vmeio *)&(pmbbi->inp.value);
|
||||
status = bi_driver(pvmeio->card,pmbbi->mask,XY210,&value);
|
||||
status = xy210_driver(pvmeio->card,pmbbi->mask,&value);
|
||||
if(status==0) {
|
||||
pmbbi->rval = value;
|
||||
} else {
|
||||
|
||||
@@ -84,7 +84,7 @@ static long init_record(pmbbo)
|
||||
pvmeio = &(pmbbo->out.value.vmeio);
|
||||
pmbbo->shft = pvmeio->signal;
|
||||
pmbbo->mask <<= pmbbo->shft;
|
||||
status = bo_read(pvmeio->card,pmbbo->mask,&value,BB902);
|
||||
status = bb902_read(pvmeio->card,pmbbo->mask,&value);
|
||||
if(status==0) pmbbo->rbv = pmbbo->rval = value;
|
||||
break;
|
||||
default :
|
||||
@@ -106,9 +106,9 @@ static long write_mbbo(pmbbo)
|
||||
|
||||
pvmeio = &(pmbbo->out.value.vmeio);
|
||||
|
||||
status = bo_driver(pvmeio->card,pmbbo->rval,pmbbo->mask,BB902);
|
||||
status = bb902_driver(pvmeio->card,pmbbo->rval,pmbbo->mask);
|
||||
if(status==0) {
|
||||
status = bo_read(pvmeio->card,pmbbo->mask,&value,BB902);
|
||||
status = bb902_read(pvmeio->card,pmbbo->mask,&value);
|
||||
if(status==0) pmbbo->rbv = value;
|
||||
else recGblSetSevr(pmbbo,READ_ALARM,VALID_ALARM);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user