paparazzi-devel
[Top][All Lists]
Advanced

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

Re: [Paparazzi-devel] unified/simplified parameter definitions for modul


From: Christophe De Wagter
Subject: Re: [Paparazzi-devel] unified/simplified parameter definitions for modules and subsystems
Date: Fri, 24 Dec 2010 08:53:42 +0100

Summary + Extra:

OLD SITUATION:

-in module.xml
    <define name"YYY"> = makefile variable (YYY can not be used in your code)
    <flag> = define
    <param> = define
-in airframe.xml module <load> section
    <define> = makefile variable
    <flag> = define
-in airframe.xml <subsystem> section
    <param> = makefile variable
    <define> = define

NEW SITUATION

-anywhere
    <define> = define according to the C-definition: so you can use #ifdef XXX of myvar = XXX in your code for instance
    <configure> = paparazzi makefile variable: so the subsystem/module makefiles can configure many other things with it: e.g. <configure name="MODEM_PORT"> -> is used to enable UART, set the MODEM_UART, set its baudrate, and e.g. <configure name="GENERIC_ADC1" value="ADC_3"> not only configures the channel but also enables the USE_ADC, the USE_ADC_3, USE_AD0 (Bank) many of which you needed to do by hand in the old makefile time.

------------------------------------
Extra info:

There are however still 2 types of defines in the airframe.xml:

<section><define> ---> go to the airframe.h. This is the preferred place to put a lot of gains, calibrations, options etc... (only known to includers of airframe.h)
<firmware/subsystem/module><define> ---> are global using compile line arguments gcc -DXXX=YYY. Too many defines here make real long compile lines, slows compiling and can make debugging a little harder etc... 



<modules>
  <load name="airspeed_adc.xml">
    <configure name="ADC_AIRSPEED" value="ADC_4"/>
    <define name="AIRSPEED_SCALE" value="1"/>
    <define name="AIRSPEED_BIAS" value="0"/>
  </load>
</modules>

can also be written as

<section name="AIRSPEED_MODULE" prefix="AIRSPEED_" >
    <define name="SCALE" value="1"/>
    <define name="BIAS" value="0"/>
</section>

<modules>
  <load name="airspeed_adc.xml">
    <configure name="ADC_AIRSPEED" value="ADC_4"/>
  </load>
</modules>


-Christophe 




On Thu, Dec 23, 2010 at 11:38 PM, Felix Ruess <address@hidden> wrote:
Hi,

I just merged and pushed Gautier's branch that unifies and simplifies the configuration of modules and subsystems in the airframe file.

Now every "parameter" that ends up as a C preprocessor define uses the keyword define. This means that you have to change both flag and param in modules to define. For subsystems define stays define.

When you want to define a makefile variable you have to use the keyword configure now. Meaning you have to change define in modules to configure and for subsystems you have to change the old param to configure.

Here are some examples:

Formerly if you used param in a subsystem, e.g. to configure the baud rate:
 <subsystem name="telemetry"     type="xbee_api">
     <param name="MODEM_BAUD"         value="B9600"/>
 </subsystem>

This becomes:
 <subsystem name="telemetry"     type="xbee_api">
     <configure name="MODEM_BAUD"         value="B9600"/>
 </subsystem>


And in modules something like
 <modules>
   <load name="airspeed_adc.xml">
     <define name="ADC_AIRSPEED" value="ADC_4"/>
     <flag name="AIRSPEED_SCALE" value="1"/>
     <flag name="AIRSPEED_BIAS" value="0"/>
   </load>
 </modules>

becomes
 <modules>
   <load name="airspeed_adc.xml">
     <configure name="ADC_AIRSPEED" value="ADC_4"/>
     <define name="AIRSPEED_SCALE" value="1"/>
     <define name="AIRSPEED_BIAS" value="0"/>
   </load>
 </modules>

This makes the definition of these parameters consistent and easier to understand.

There is one thing to be aware of: If your airframe files still uses some old parameter keywords (like flag and param) the targets list in the paparazzi center will not be populated because it is not a valid xml document according to the DTD anymore.

Merry Christmas!

Cheers, Felix

_______________________________________________
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]