Export and use int64indset, set USE_TYPED_DSET
This commit is contained in:
@@ -28,6 +28,7 @@ dbRecStd_SRCS += devBoDbState.c
|
||||
dbRecStd_SRCS += devCalcoutSoft.c
|
||||
dbRecStd_SRCS += devEventSoft.c
|
||||
dbRecStd_SRCS += devHistogramSoft.c
|
||||
devI64inSoft_CFLAGS += -DUSE_TYPED_DSET
|
||||
dbRecStd_SRCS += devI64inSoft.c
|
||||
dbRecStd_SRCS += devI64outSoft.c
|
||||
dbRecStd_SRCS += devLiSoft.c
|
||||
@@ -54,6 +55,7 @@ dbRecStd_SRCS += devGeneralTime.c
|
||||
|
||||
dbRecStd_SRCS += devAiSoftCallback.c
|
||||
dbRecStd_SRCS += devBiSoftCallback.c
|
||||
devI64inSoftCallback_CFLAGS += -DUSE_TYPED_DSET
|
||||
dbRecStd_SRCS += devI64inSoftCallback.c
|
||||
dbRecStd_SRCS += devLiSoftCallback.c
|
||||
dbRecStd_SRCS += devMbbiDirectSoftCallback.c
|
||||
|
||||
@@ -24,29 +24,9 @@
|
||||
#include "int64inRecord.h"
|
||||
#include "epicsExport.h"
|
||||
|
||||
/* Create the dset for devI64inSoft */
|
||||
static long init_record(int64inRecord *prec);
|
||||
static long read_int64in(int64inRecord *prec);
|
||||
|
||||
struct {
|
||||
long number;
|
||||
DEVSUPFUN report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record;
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_int64in;
|
||||
} devI64inSoft = {
|
||||
5,
|
||||
NULL,
|
||||
NULL,
|
||||
init_record,
|
||||
NULL,
|
||||
read_int64in
|
||||
};
|
||||
epicsExportAddress(dset, devI64inSoft);
|
||||
|
||||
static long init_record(int64inRecord *prec)
|
||||
static long init_record(dbCommon *common)
|
||||
{
|
||||
int64inRecord *prec = (int64inRecord *)common;
|
||||
if (recGblInitConstantLink(&prec->inp, DBF_INT64, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
@@ -76,3 +56,11 @@ static long read_int64in(int64inRecord *prec)
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
/* Create the dset for devI64inSoft */
|
||||
|
||||
int64indset devI64inSoft = {
|
||||
{ 5, NULL, NULL, init_record, NULL }, read_int64in
|
||||
};
|
||||
epicsExportAddress(dset, devI64inSoft);
|
||||
|
||||
|
||||
@@ -151,8 +151,9 @@ static long init(int pass)
|
||||
return 0;
|
||||
}
|
||||
|
||||
static long init_record(int64inRecord *prec)
|
||||
static long init_record(dbCommon *common)
|
||||
{
|
||||
int64inRecord *prec = (int64inRecord *)common;
|
||||
if (recGblInitConstantLink(&prec->inp, DBR_INT64, &prec->val))
|
||||
prec->udf = FALSE;
|
||||
|
||||
@@ -204,11 +205,7 @@ static long read_int64in(int64inRecord *prec)
|
||||
}
|
||||
|
||||
/* Create the dset for devI64inSoftCallback */
|
||||
struct {
|
||||
dset common;
|
||||
DEVSUPFUN read_int64in;
|
||||
} devI64inSoftCallback = {
|
||||
{5, NULL, init, init_record, NULL},
|
||||
read_int64in
|
||||
int64indset devI64inSoftCallback = {
|
||||
{ 5, NULL, init, init_record, NULL }, read_int64in
|
||||
};
|
||||
epicsExportAddress(dset, devI64inSoftCallback);
|
||||
|
||||
@@ -25,6 +25,7 @@ stdRecords += dfanoutRecord
|
||||
stdRecords += eventRecord
|
||||
stdRecords += fanoutRecord
|
||||
stdRecords += histogramRecord
|
||||
int64inRecord_CFLAGS += -DUSE_TYPED_DSET
|
||||
stdRecords += int64inRecord
|
||||
stdRecords += int64outRecord
|
||||
stdRecords += longinRecord
|
||||
|
||||
@@ -83,14 +83,6 @@ rset int64inRSET={
|
||||
epicsExportAddress(rset,int64inRSET);
|
||||
|
||||
|
||||
struct int64indset { /* int64in input dset */
|
||||
long number;
|
||||
DEVSUPFUN dev_report;
|
||||
DEVSUPFUN init;
|
||||
DEVSUPFUN init_record; /*returns: (-1,0)=>(failure,success)*/
|
||||
DEVSUPFUN get_ioint_info;
|
||||
DEVSUPFUN read_int64in; /*returns: (-1,0)=>(failure,success)*/
|
||||
};
|
||||
static void checkAlarms(int64inRecord *prec, epicsTimeStamp *timeLast);
|
||||
static void monitor(int64inRecord *prec);
|
||||
static long readValue(int64inRecord *prec);
|
||||
@@ -113,12 +105,12 @@ static long init_record(dbCommon *pcommon, int pass)
|
||||
return(S_dev_noDSET);
|
||||
}
|
||||
/* must have read_int64in function defined */
|
||||
if( (pdset->number < 5) || (pdset->read_int64in == NULL) ) {
|
||||
if ((pdset->common.number < 5) || (pdset->read_int64in == NULL)) {
|
||||
recGblRecordError(S_dev_missingSup,(void *)prec,"int64in: init_record");
|
||||
return(S_dev_missingSup);
|
||||
}
|
||||
if( pdset->init_record ) {
|
||||
if((status=(*pdset->init_record)(prec))) return(status);
|
||||
if (pdset->common.init_record) {
|
||||
if ((status = pdset->common.init_record(pcommon))) return status;
|
||||
}
|
||||
prec->mlst = prec->val;
|
||||
prec->alst = prec->val;
|
||||
|
||||
@@ -111,6 +111,15 @@ monitoring deadband functionality.
|
||||
=cut
|
||||
|
||||
include "dbCommon.dbd"
|
||||
%#include "devSup.h"
|
||||
%
|
||||
%/* Declare Device Support Entry Table */
|
||||
%struct int64inRecord;
|
||||
%typedef struct int64indset {
|
||||
% dset common;
|
||||
% long (*read_int64in)(struct int64inRecord *prec);
|
||||
%} int64indset;
|
||||
%
|
||||
field(VAL,DBF_INT64) {
|
||||
prompt("Current value")
|
||||
promptgroup("40 - Input")
|
||||
|
||||
Reference in New Issue
Block a user