Added a debug variable to the example mySub routines,

making this settable from the ioc shell.
This commit is contained in:
Andrew Johnson
2003-07-16 21:20:45 +00:00
parent 44031b3e94
commit 10414b4429
5 changed files with 48 additions and 18 deletions
@@ -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);
}