Sorry ... here is my actual code snippet (if you didn't like the
previous post). As you can see, the printf in the switch statement
and the printf out side the switch statement.
Thank you!
Eric
/* System related include files */
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dscsup.h"
typedef struct Reg Reg;
typedef struct Port Port;
/* Declare register info structure */
struct Reg
{
int isConn;
int cfgIdx;
int cfgOff;
int regOff;
int regNum;
int regDir;
};
static asynStatus create(void* ppvt,asynUser* pasynUser,const char*
drvInfo, const char** pptypeName,size_t* psize)
{
int addr;
Reg* preg;
Port* pport = (Port*)ppvt;
asynPrint(pasynUser,ASYN_TRACE_FLOW,"drvDio::create
%s:\n",pport->name);
if( pasynManager->getAddr(pasynUser,&addr) == asynSuccess )
preg = &pport->regs[addr];
else
{ asynPrint(pasynUser,ASYN_TRACE_ERROR,"drvDio::create %s:
getAddr failure\n",pport->name);
return( asynError ); }
asynPrint(pasynUser,ASYN_TRACEIO_FILTER,"drvDio::create %s: asyn -
0x%8.8X, addr - %d\n",pport->name,(int)pasynUser,(int)addr);
preg->cfgIdx = addr/COM_DIO_REGS;
switch( pport->type )
{
case DSC_ATHENA:
preg->cfgOff = ATH_OUTB_DIOCR;
if( addr == 0 ){
preg->regOff = ATH_OUTB_DPORT_A;
printf("preg->cfgOff=%d\n",preg->cfgOff);
printf("preg->regOff=%d\n",preg->regOff);}
else if( addr == 1 )
preg->regOff = ATH_OUTB_DPORT_B; else if( addr == 2 )
preg->regOff = ATH_OUTB_DPORT_C;
else
{
asynPrint(pasynUser,ASYN_TRACEIO_FILTER,"drvDio::create %s: invalid
register number %d\n",pport->name,addr); return( asynError
);
}
break;
}
printf("preg->cfgOff=%d\n",preg->cfgOff);
printf("preg->regOff=%d\n",preg->regOff);
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|