Eric,
Are you using -mcpu=arm9 as part of your compiler options?
BTW, It makes a big difference that you're accessing hardware so the
answer to the question is completely different.... This may have
something to do with the TS board. As you probably now know, your
initial posting of code was completely misleading. Help us help you. ;)
HTH
----
Andy
--- In ts-7000%40yahoogroups.com">ts-7000
yahoogroups.com, "berryma4" <berryma4
...> wrote:
>
> 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 failuren",pport->name);
> return( asynError ); }
> asynPrint(pasynUser,ASYN_TRACEIO_FILTER,"drvDio::create %s: asyn -
> 0x%8.8X, addr - %dn",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=%dn",preg->cfgOff);
> printf("preg->regOff=%dn",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 %dn",pport->name,addr); return( asynError
> );
> }
> break;
> }
>
> printf("preg->cfgOff=%dn",preg->cfgOff);
> printf("preg->regOff=%dn",preg->regOff);
>
.