Go Down

Topic: Arduino IDE 1.5.x - directives [ IDE Bug ?] (Read 1 time) previous topic - next topic

mzahor

Apr 09, 2013, 09:53 am Last Edit: Apr 09, 2013, 09:58 am by mzahor Reason: 1
Hi,

this fragment produces weird compile errors if NO_EEPROM is NOT defined
If I comment out char EEPROM_BUFF[1024*4] = {0}; then everithing is OK


Code: [Select]



//#define NO_EEPROM

#ifdef NO_EEPROM
char EEPROM_BUFF[1024*4] = {0};
#else

#ifdef __SAM3X8E__
   //external EEPROM
#include "I2C_eeprom.h"
I2C_eeprom i2c_EEPROM(0x50);

#else
   //build-in EEPROM
#include <EEPROM.h>
#endif


#endif


westfw

The pre-pre-processor in the IDE has never liked pre-processor directives (other than #include) at the start of the program.
You can probably fix this by adding a dummy variable:

Code: [Select]
int dummyvariable;
//#define NO_EEPROM

#ifdef NO_EEPROM
char EEPROM_BUFF[1024*4] = {0};
#else


Go Up