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

Macro guard not working

Hello everyone,
I am having problem with a multiple public definition:

ERROR L104: MULTIPLE PUBLIC DEFINITIONS
SYMBOL: currenpacketbeingsampled
MODULE: DataSampling.obj (DATASAMPLING)
DEFINED: Main.obj (MAIN)

The variable in question is defined only once in the header file, and only used in the associated C file. From my understanding a macro guard should prevent the error that i am getting. The header file code is shown below, can anyone see a reason why i would be getting the error???

Thanks.

#ifndef DS_H
#define DS_H

#include <stdio.h>
#include <stdlib.h>
#include "hal.h"
#include "cc1010eb.h"
#include "Reg1010.h"


#ifndef TRUE
    #define TRUE 1
#endif
#ifndef FALSE
    #define FALSE 0
#endif
#ifndef NULL
    #define NULL 0
#endif

#define AD0ECG                  1
#define AD1PULSE                2
#define AD2TEMPSENSOR   3
#define AD2RSSI                 4

void InitialiseDataSampling(byte xdata DataTypes);
void SampleData(bool xdata condition);
void SetupADC(char SetupType);

extern byte xdata ECGcount;                     //The destination element of the next ECG data in ECGsamples[]
extern byte xdata TEMPcount;            //The destination element of the next temperature data in TempData[]

char xdata currentpacketbeingsampled;
extern char xdata nextpackettosend;

extern byte xdata DataSampled;

extern short int ECGsamples[50];
extern int maximumvalue;

#endif //DS_H