Go Down

Topic: .pde preprocessor (Read 720 times) previous topic - next topic

imre

Jul 25, 2010, 06:47 pm Last Edit: Jul 25, 2010, 06:52 pm by imre Reason: 1
I was looking how to make a wizzard to turn a .pde file into a  .cpp files that can be debuged using a debugger. In such a way that you don't see a (lot of) difference with the original .pde file.

I ascertained that you use the following to turn a .pde into a .cpp:

----------------------------------

#include "Wprogram.h"

<-- prototypes

Sketch code

contents of main.cxx

----------------------------------

And all prototypes of all the functions are extracted automatically and put between #include "WProgram.h" and "Sketch code".

Did I forget something?

For debugging I would also like to change main.cxx in a seperate .o file. And put all prototypes in WProgram.h (only for debugging).


So you just get:

------------------------------

#include "WProgram.h"

sketch code
------------------------------

And #include "WProgram.h" can be treated as white space by the sketch developper.


imre

Or should that be:

----------------------------
code from main.cxx

sketch
-----------------------------

As i notice that #include <WProgram.h> is already in main.cpp

imre

Never mind the .elf that is generated by the arduino IDE is good enough.

You have to shift-click on verify and then in the log of the screen see where arduino has put the elf file, eg.

C:\Users\me\AppData\Local\Temp\build7518619718015838656.tmp\AnalogInOutSerial.cpp.elf

And load that in insight.

Which is very interesting in itself, because if you then go and look at the files, you can see all files that are part of your arduino project.


imre


Go Up