paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Paparazzi-devel] possible bug in "dc.h" and some other functions


From: Pascal Brisset
Subject: Re: [Paparazzi-devel] possible bug in "dc.h" and some other functions
Date: Tue, 09 Jun 2009 10:53:33 +0200
User-agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103)

Hi Chris,

you are right; these macros have only been used from the setting file (dc.xml).
I've just commited a fixed version, using the "block as expression" syntax :

#define dc_Shutter(_) ({ dc_shutter(); 0; })
#define dc_Zoom(_) ({ dc_zoom(); 0; })
#define dc_Periodic(s) ({ dc_periodic_shutter = s; dc_shutter_timer = s; 0; })

so that it is correctly handled if called from the flight plan:

     <call fun="dc_Periodic(0)"/>
     <call fun="dc_Zoom(0)"/>
     <call fun="dc_Shutter(5)"/>


--Pascal

chris wrote:
Hi
I would like to ask your opinion on this Pascal.
I have being trying lately to accomodate a moving digital 10 MegaPixel camera
on board my primary experimental airplane and i encountered some problems
calling the digital camera and camera positioning functions.
In the file "dc.h" it is described that :
"dc_Periodic(s) activates a periodic call to dc_Shutter() every s seconds" Wel this does not work because i found that the flight plan expects a function to return 0
if everything went ok but a definition like the one inside "dc.h":
"#define dc_Periodic(s) { dc_periodic_shutter = s; dc_shutter_timer = s; }"
does not return anything and the flight plan halts.
What i did was to either set the two variables inside the flight plan using:
<set value="0" var="dc_periodic_shutter"/>
<set value="0" var="dc_shutter_timer"/>

I also tried another approach which i think is the correct one as i don't like
exposed variables and edited the "dc.h" file
in order to include a function rather than a definition of the "dc_Periodic(s)"

#define DC_Periodic(s) { _dc_Periodic(s); } //calls the static function _dc_Periodic()

static inline uint8_t  _dc_Periodic(uint8_t s)
{
dc_periodic_shutter = s;
dc_shutter_timer = s;

return(0);
}

What do you think, am i doing something wrong?
I have seen the same thing happening to other functions also so i guess that before i start editing the files i better ask you first.
Chris



_______________________________________________
Paparazzi-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel





reply via email to

[Prev in Thread] Current Thread [Next in Thread]