This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

XDATA structure with include file compiling problem

In this systemGlobals.c file I declare:

struct SMBusADCEntry_entry
{
unsigned short int SMBusADCBankNumber;
unsigned short int SMBusADCBankChannel;
};

xdata struct SMBusADCEntry_entry SMBusADC[] = {

{ (unsigned short int)0, (unsigned short int)0 },
{ (unsigned short int)0, (unsigned short int)1 }

};



Then in the systemGlobals.h file:

#ifndef __SYSTEM_GLOBALS_H__
#define __SYSTEM_GLOBALS_H__

extern struct SMBusADCEntry_entry SMBusADC[];

#endif



Then I include this systemGlobals.h file in my main.c file and access the data as

SMBusADC[0].channelLowerLimit_UI = 0x20;

The compiler complains on the xdata struct line with duplicate definition.

Additionally then with the above setting of data 0x20 the error SMBusADC undeclared identifier.

0