[fixedwing] removed AhrsEvent

This commit is contained in:
Felix Ruess
2012-06-04 23:19:56 +02:00
parent 828d5b653b
commit 93a8dbeae3
4 changed files with 10 additions and 28 deletions
+2 -15
View File
@@ -93,8 +93,6 @@ static inline void on_gyro_event( void );
static inline void on_accel_event( void ); static inline void on_accel_event( void );
static inline void on_mag_event( void ); static inline void on_mag_event( void );
volatile uint8_t ahrs_timeout_counter = 0; volatile uint8_t ahrs_timeout_counter = 0;
#else
static inline void on_ahrs_event(void);
#endif // USE_IMU #endif // USE_IMU
#endif // USE_AHRS #endif // USE_AHRS
@@ -587,13 +585,9 @@ void event_task_ap( void ) {
i2c_event(); i2c_event();
#endif #endif
#if USE_AHRS #if USE_AHRS && USE_IMU
#if USE_IMU
ImuEvent(on_gyro_event, on_accel_event, on_mag_event); ImuEvent(on_gyro_event, on_accel_event, on_mag_event);
#else #endif
AhrsEvent(on_ahrs_event);
#endif // USE_IMU
#endif // USE_AHRS
#if USE_GPS #if USE_GPS
GpsEvent(on_gps_solution); GpsEvent(on_gps_solution);
@@ -725,13 +719,6 @@ static inline void on_mag_event(void)
#endif #endif
} }
#else // USE_IMU not defined
static inline void on_ahrs_event(void)
{
#ifdef AHRS_UPDATE_FW_ESTIMATOR
ahrs_update_fw_estimator();
#endif
}
#endif // USE_IMU #endif // USE_IMU
#endif // USE_AHRS #endif // USE_AHRS
@@ -36,7 +36,4 @@ extern void ahrs_update_infrared(void);
// TODO copy ahrs to state instead of estimator // TODO copy ahrs to state instead of estimator
extern void ahrs_update_fw_estimator(void); extern void ahrs_update_fw_estimator(void);
#define AhrsEvent(_available_callback) { \
}
#endif /* AHRS_INFRARED_H */ #endif /* AHRS_INFRARED_H */
+8
View File
@@ -53,6 +53,10 @@ void update_ahrs_from_sim(void) {
FLOAT_RMAT_OF_EULERS(ahrs_float.ltp_to_imu_rmat, ahrs_float.ltp_to_imu_euler); FLOAT_RMAT_OF_EULERS(ahrs_float.ltp_to_imu_rmat, ahrs_float.ltp_to_imu_euler);
compute_body_orientation_and_rates(); compute_body_orientation_and_rates();
#ifdef AHRS_UPDATE_FW_ESTIMATOR
ahrs_update_fw_estimator();
#endif
} }
@@ -92,6 +96,10 @@ void ahrs_align(void)
void ahrs_propagate(void) { void ahrs_propagate(void) {
if (ahrs_sim_available) {
update_ahrs_from_sim();
ahrs_sim_available = FALSE;
}
} }
void ahrs_update_accel(void) { void ahrs_update_accel(void) {
-10
View File
@@ -37,14 +37,4 @@ extern float ins_pitch_neutral;
extern void update_ahrs_from_sim(void); extern void update_ahrs_from_sim(void);
#define AhrsEvent(_available_callback) { \
if (ahrs_sim_available) { \
update_ahrs_from_sim(); \
_available_callback(); \
ahrs_sim_available = FALSE; \
} \
}
#endif /* AHRS_SIM_H */ #endif /* AHRS_SIM_H */