Skip to content

Commit

Permalink
[fixedwing] print used ahrs freqs, pass configure options on...
Browse files Browse the repository at this point in the history
  • Loading branch information
flixr committed Feb 11, 2013
1 parent 84e4b23 commit 174ace9
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 8 additions & 0 deletions conf/firmwares/subsystems/fixedwing/autopilot.makefile
Expand Up @@ -174,6 +174,14 @@ else ifeq ($(BOARD), lisa_l)
ap_CFLAGS += -DUSE_I2C2
endif

# ahrs frequencies if configured
ifdef AHRS_PROPAGATE_FREQUENCY
ap_CFLAGS += -DAHRS_PROPAGATE_FREQUENCY=$(AHRS_PROPAGATE_FREQUENCY)
endif
ifdef AHRS_CORRECT_FREQUENCY
ap_CFLAGS += -DAHRS_CORRECT_FREQUENCY=$(AHRS_CORRECT_FREQUENCY)
endif


######################################################################
##
Expand Down
2 changes: 2 additions & 0 deletions conf/firmwares/subsystems/shared/imu_umarim.makefile
Expand Up @@ -16,7 +16,9 @@ IMU_UMARIM_SRCS += peripherals/adxl345_i2c.c
# with default UMARIM_GYRO_SMPLRT_DIV (gyro output 50Hz)
# the AHRS_PROPAGATE_FREQUENCY needs to be adjusted accordingly
AHRS_PROPAGATE_FREQUENCY ?= 50
AHRS_CORRECT_FREQUENCY ?= 50
ap.CFLAGS += -DAHRS_PROPAGATE_FREQUENCY=$(AHRS_PROPAGATE_FREQUENCY)
ap.CFLAGS += -DAHRS_CORRECT_FREQUENCY=$(AHRS_CORRECT_FREQUENCY)

ap.CFLAGS += $(IMU_UMARIM_CFLAGS)
ap.srcs += $(IMU_UMARIM_SRCS)
Expand Down
11 changes: 7 additions & 4 deletions sw/airborne/firmwares/fixedwing/main_ap.c
Expand Up @@ -86,20 +86,23 @@
#include "led.h"


#if USE_AHRS
#if USE_IMU
#if USE_AHRS && USE_IMU

#ifndef AHRS_PROPAGATE_FREQUENCY
#define AHRS_PROPAGATE_FREQUENCY PERIODIC_FREQUENCY
#endif
PRINT_CONFIG_VAR(AHRS_PROPAGATE_FREQUENCY)
#ifndef AHRS_CORRECT_FREQUENCY
#define AHRS_CORRECT_FREQUENCY PERIODIC_FREQUENCY
#endif
PRINT_CONFIG_VAR(AHRS_CORRECT_FREQUENCY)

static inline void on_gyro_event( void );
static inline void on_accel_event( void );
static inline void on_mag_event( void );
volatile uint8_t ahrs_timeout_counter = 0;
#endif // USE_IMU
#endif // USE_AHRS

#endif // USE_AHRS && USE_IMU

#if USE_GPS
static inline void on_gps_solution( void );
Expand Down

0 comments on commit 174ace9

Please sign in to comment.