Added a debug variable to the example mySub routines,
making this settable from the ioc shell.
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
include "base.dbd"
|
||||
include "xxxSupport.dbd"
|
||||
registrar(mySubRegistrar)
|
||||
variable(mySubDebug)
|
||||
|
||||
@@ -5,19 +5,24 @@
|
||||
#include <subRecord.h>
|
||||
#include <epicsExport.h>
|
||||
|
||||
int mySubDebug;
|
||||
epicsExportAddress(int, mySubDebug);
|
||||
|
||||
typedef long (*processMethod)(subRecord *precord);
|
||||
|
||||
static long mySubInit(subRecord *precord,processMethod process)
|
||||
{
|
||||
printf("Record %s called mySubInit(%p, %p)\n",
|
||||
precord->name, (void*) precord, (void*) process);
|
||||
if (mySubDebug)
|
||||
printf("Record %s called mySubInit(%p, %p)\n",
|
||||
precord->name, (void*) precord, (void*) process);
|
||||
return(0);
|
||||
}
|
||||
|
||||
static long mySubProcess(subRecord *precord)
|
||||
{
|
||||
printf("Record %s called mySubProcess(%p)\n",
|
||||
precord->name, (void*) precord);
|
||||
if (mySubDebug)
|
||||
printf("Record %s called mySubProcess(%p)\n",
|
||||
precord->name, (void*) precord);
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user