Pages: [1]   Go Down
Author Topic: knowing from where .h was included  (Read 303 times)
0 Members and 1 Guest are viewing this topic.
France
Offline Offline
Newbie
*
Karma: 0
Posts: 29
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,
I try to figure out how I could declare thinks in a library .h only if included from .ino (or scketch file) and not from .cpp inside of the library.
Does anyone know a pre defined think that I could check.

Thank you
MGTH
Logged

Mgth : ArduixPL http://www.mgth.fr

UK
Offline Offline
Faraday Member
**
Karma: 92
Posts: 3969
Where is your SSCCE?!?!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Code:
[code]I doubt there's anything predefined, but there's nothing to stop you putting a #define immediately before the #include in your sketch and checking for that.

sketch:
[code]
#define USE_EXTRA_STUFF
#include <myLibrary.h>

myLibrary.h:
[/code]
#ifdef USE_EXTRA_STUFF
...
#endif
[/code]
Logged

Why not visit my eBay shop? http://stores.ebay.co.uk/Majenko-Technologies
Replacement for the Arduino IDE: UECIDE - Proper serial terminal, graphing facilities, plugins, overhauled internals.
Java isn't bad in itself, but it has enabled morons to write programs.

Pages: [1]   Go Up
Jump to: