Option to bypass "Processing -> C++" pre-processor

For completeness, I should post a link to Martin Oldfield's web page:

there are also appear to be a few forks from this to check out if interested e.g.

as well as the one by Sudar mentioned above (neither of which I've played with yet.)

Latest cool thing I've discovered: If you want to use your own main.cpp rather than the default "core" version supplied in the IDE distro, easy peasy: Just create a source file in your sketch directory named main.cpp, and will be used to build main.o rather than the use the "core" source file. If main.cpp isn't found, the default one will be used instead. Not sure if this is intended behaviour or just a fortunate side-effect of the order in which the make recipes are executed, but cool nonetheless.

The only thing that has to be in your main.cpp if you want to use the wiring libs is #include <WProgram.h> (or <Arduino.h>), and call init() before calling setup() (or however you decide to organise your main() function.)

Of course, also include any prototypes if you are calling anything beside init(), setup() and loop(), e,g.:

#include <WProgram.h>

void setup2();

int main(void)
{
	init();

	setup2();
    
	for (;;)
		loop();
        
	return 0;
}

(this was my test alternative main.cpp to see if it all works as expected.)

Anyway, this is all too great. Using my own editor and the makefiles, there isn't any need to even fire up the IDE at all (unless I feel the need for a quick and dirty in "Processing" I suppose. But since I usually have emacs running anyway, I can't see this happening very often, somehow...)

Woot!