Pages: [1]   Go Down
Author Topic: Arduino IDE 1.5.x - directives [ IDE Bug ?]  (Read 1332 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:


//#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
« Last Edit: April 09, 2013, 02:58:03 am by mzahor » Logged

SF Bay Area (USA)
Offline Offline
Tesla Member
***
Karma: 124
Posts: 6652
Strongly opinionated, but not official!
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
int dummyvariable;
//#define NO_EEPROM

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

Offline Offline
Newbie
*
Karma: 0
Posts: 8
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Perfect, I works :-)
Logged

Pages: [1]   Go Up
Jump to: