Pages: [1]   Go Down
Author Topic: .pde preprocessor  (Read 573 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

« Last Edit: July 25, 2010, 11:52:12 am by imre » Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Or should that be:

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

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

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

0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Wuppertal/Germany
Offline Offline
God Member
*****
Karma: 1
Posts: 895
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

This might give you some more tips : http://code.google.com/p/arduino/wiki/BuildProcess
Eberhard
Logged

0
Offline Offline
Newbie
*
Karma: 1
Posts: 36
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you very much
Logged

Pages: [1]   Go Up
Jump to: