Hi Ken
Just looked at your code - happens to be very similar to an issue I have been sorting out with a colleague who has previously used a different compiler. Can I suggest the following change:
Here's part of the source:
/* IO DEFINITIONS FOR MCS912C32
* Copyright (c) 2003 by COSMIC Software
*/
#ifndef _BASE
#define _BASE 0
#endif <- MOVE THIS STATEMENT to the end of the file
#define _IO(x) @(_BASE)+(x)
typedef unsigned char __uchar;
typedef unsigned int __uint;
/* MEBI Module
*/
volatile __uchar PORTA _IO(0x00); /* port A */
volatile __uchar PORTB _IO(0x01); /* port B */
volatile __uchar DDRA _IO(0x02); /* data direction port A */
volatile __uchar DDRB _IO(0x03); /* data direction port B */
volatile __uchar PORTE _IO(0x08); /* port E */
volatile __uchar DDRE _IO(0x09); /* data direction port E */
.
.
.
#endif /* _BASE */ <- put the statement here
Now the first time the compiler goes through the file, it will define _BASE and process the rest of the header. The second time the compiler opens the header file, it sees _BASE is defined and skips everything else.
IMHO the CodeWarrior compiler is more strict (sensitive) about stuff like this.
Good luck with your coding
Steve