Hi All,

I have a problem which I think is in SDCC

I use the binary package SDCC version 'latest' downloadable from 
Sourceforge on Windows XP under Code::blocks version 8.02
I have Code::blocks setup for the PIC16F874.

This is what I want to do, To synthesize PORT and TRIS from a sinlge 
letter as # define LCD_DataPort D

Here is my code:

#include <PIC/PIC16F874.H>

#define LCD_DataPort             D
#define LCD_CtrlPort             E
#define LCD_RS                   0

#define LCD_PIN_OUT 0
#define LCD_LOW 0
#define LCD_PORT_WRITE 0

#define LCD_SetUp_Interface \
     LCD_Port_Pin_Dir(LCD_CtrlPort,LCD_RS,LCD_PIN_OUT); \
     LCD_Port_Bit(LCD_CtrlPort,LCD_RS, LCD_LOW); \
     LCD_Port_Dir(LCD_DataPort,LCD_PORT_WRITE);

#define LCD_Port_Pin_Dir_C(port,pin,state) \
     TRIS##port##pin = state
#define LCD_Port_Pin_Dir(port,pin,state) \
     LCD_Port_Pin_Dir_C(port,pin,state)

#define LCD_Port_Bit_C(port,pin,state) \
     R##port##pin = state
#define LCD_Port_Bit(port,pin,state) \
     LCD_Port_Bit_C(port,pin,state)

#define LCD_Port_Dir_C(port,state) \
     TRIS##port = state
#define LCD_Port_Dir(port,state) \
     LCD_Port_Dir_C(port,state)


// main body
void main(){
    LCD_SetUp_Interface;
  //   LCD_Port_Dir(LCD_DataPort,0);
  //   LCD_Port_Dir(D,0);
  //   TRISD = 0;
     }

On building the above code I get the error message Undefined identifier 
'TRISSSPSTAT_bits'
This error message is from the #define LCD_Port_Dir(port,state)

Why does the #define LCD_Port_Pin_Dir succeed?

What did I do wrong or forgot.?

Can someone help me through this?

Thanks,


Frans.

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Sdcc-user mailing list
Sdcc-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/sdcc-user

Reply via email to