Skip to content

Commit

Permalink
[config] better warning message and update example airframe
Browse files Browse the repository at this point in the history
  • Loading branch information
gautierhattenberger committed Nov 12, 2013
1 parent 0c7c09c commit a0fcc68
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 1 addition & 0 deletions conf/airframes/ENAC/fixed-wing/apogee.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<!--define name="LOITER_TRIM"/-->
<!--define name="PITCH_TRIM"/-->
<define name="USE_GYRO_PITCH_RATE"/>
<configure name="PERIODIC_FREQUENCY" value="100"/>

<target name="sim" board="pc"/>
<target name="ap" board="apogee_1.0"/>
Expand Down
10 changes: 4 additions & 6 deletions sw/airborne/firmwares/fixedwing/main_ap.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,16 +127,14 @@ PRINT_CONFIG_VAR(MODULES_FREQUENCY)
#define AHRS_PROPAGATE_FREQUENCY PERIODIC_FREQUENCY
#endif
PRINT_CONFIG_VAR(AHRS_PROPAGATE_FREQUENCY)
#if AHRS_PROPAGATE_FREQUENCY > PERIODIC_FREQUENCY
#warning PERIODIC_FREQUENCY should be >= AHRS_PROPAGATE_FREQUENCY
#endif

#ifndef AHRS_CORRECT_FREQUENCY
#define AHRS_CORRECT_FREQUENCY PERIODIC_FREQUENCY
#endif
PRINT_CONFIG_VAR(AHRS_CORRECT_FREQUENCY)
#if AHRS_CORRECT_FREQUENCY > PERIODIC_FREQUENCY
#warning PERIODIC_FREQUENCY should be >= AHRS_CORRECT_FREQUENCY

#if (AHRS_PROPAGATE_FREQUENCY > PERIODIC_FREQUENCY)
#warning "PERIODIC_FREQUENCY should be least equal or greater than AHRS_PROPAGATE_FREQUENCY"
INFO_VALUE("it is recommended to configure in your airframe PERIODIC_FREQUENCY to at least ",AHRS_PROPAGATE_FREQUENCY)
#endif

static inline void on_gyro_event( void );
Expand Down
6 changes: 6 additions & 0 deletions sw/airborne/firmwares/rotorcraft/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,12 @@ PRINT_CONFIG_VAR(MODULES_FREQUENCY)
#endif
PRINT_CONFIG_VAR(BARO_PERIODIC_FREQUENCY)

#if USE_AHRS && USE_IMU && (defined AHRS_PROPAGATE_FREQUENCY)
#if (AHRS_PROPAGATE_FREQUENCY > PERIODIC_FREQUENCY)
#warning "PERIODIC_FREQUENCY should be least equal or greater than AHRS_PROPAGATE_FREQUENCY"
INFO_VALUE("it is recommended to configure in your airframe PERIODIC_FREQUENCY to at least ",AHRS_PROPAGATE_FREQUENCY)
#endif
#endif

static inline void on_gyro_event( void );
static inline void on_accel_event( void );
Expand Down

0 comments on commit a0fcc68

Please sign in to comment.