Consider following header file,
// filename : packet_types.h
#ifndef _PACKET_TYPES_
#define _PACKET_TYPES_
struct Packet {
enum Type {
typ_ONE,
typ_TWO,
typ_THREE,
};
static const char * STRINGS[] = {
"ONE",
"TWO",
"THREE"
};
const char * getText( int enum ) {
return STRINGS[enum];
}
};
#endif
As Arduino has limited memory, I don't want to include this portion of code when I include this file, packet_types.h,
static const char * STRINGS[] = {
"ONE",
"TWO",
"THREE"
};
const char * getText( int enum ) {
return STRINGS[enum];
}
But for my GUI application, I want the complete file. I want to use same file for both Arduino and GUI, but how can I add compiler directive #define,#ifdef, #ifndef... to do this job, when I include this file from some other file(main.cpp). Thanks.