diff --git a/sw/airborne/subsystems/ahrs.c b/sw/airborne/subsystems/ahrs.c index 8bc6c38203..f67191375c 100644 --- a/sw/airborne/subsystems/ahrs.c +++ b/sw/airborne/subsystems/ahrs.c @@ -29,3 +29,13 @@ struct Ahrs ahrs; +#define WEAK __attribute__((weak)) +// weak functions, used if not explicitly provided by implementation + +void WEAK ahrs_propagate(void) {} + +void WEAK ahrs_update_accel(void) {} + +void WEAK ahrs_update_mag(void) {} + +void WEAK ahrs_update_gps(void) {} diff --git a/sw/airborne/subsystems/ahrs.h b/sw/airborne/subsystems/ahrs.h index 5c49dcf710..15d39990d1 100644 --- a/sw/airborne/subsystems/ahrs.h +++ b/sw/airborne/subsystems/ahrs.h @@ -61,25 +61,25 @@ extern void ahrs_align(void); /** Propagation. Usually integrates the gyro rates to angles. * Reads the global #imu data struct. - * Needs to be implemented by each AHRS algorithm. + * Does nothing if not implemented by specific AHRS algorithm. */ extern void ahrs_propagate(void); /** Update AHRS state with accerleration measurements. * Reads the global #imu data struct. - * Needs to be implemented by each AHRS algorithm. + * Does nothing if not implemented by specific AHRS algorithm. */ extern void ahrs_update_accel(void); /** Update AHRS state with magnetometer measurements. * Reads the global #imu data struct. - * Needs to be implemented by each AHRS algorithm. + * Does nothing if not implemented by specific AHRS algorithm. */ extern void ahrs_update_mag(void); /** Update AHRS state with GPS measurements. * Reads the global #gps data struct. - * Needs to be implemented by each AHRS algorithm. + * Does nothing if not implemented by specific AHRS algorithm. */ extern void ahrs_update_gps(void); diff --git a/sw/airborne/subsystems/ahrs/ahrs_ardrone2.c b/sw/airborne/subsystems/ahrs/ahrs_ardrone2.c index 29fb02b165..3c6eb71a73 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_ardrone2.c +++ b/sw/airborne/subsystems/ahrs/ahrs_ardrone2.c @@ -195,22 +195,8 @@ void ahrs_propagate(void) { } } -void ahrs_update_accel(void) { - -} - -void ahrs_update_mag(void) { - -} - -void ahrs_update_gps(void) { - -} - void ahrs_aligner_init(void) { - } void ahrs_aligner_run(void) { - } diff --git a/sw/airborne/subsystems/ahrs/ahrs_float_mlkf.c b/sw/airborne/subsystems/ahrs/ahrs_float_mlkf.c index 1ae27fc631..33ed755eaa 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_float_mlkf.c +++ b/sw/airborne/subsystems/ahrs/ahrs_float_mlkf.c @@ -125,9 +125,6 @@ void ahrs_propagate(void) { set_body_state_from_quat(); } -void ahrs_update_gps(void) { -} - void ahrs_update_accel(void) { struct FloatVect3 imu_g; ACCELS_FLOAT_OF_BFP(imu_g, imu.accel); diff --git a/sw/airborne/subsystems/ahrs/ahrs_gx3.c b/sw/airborne/subsystems/ahrs/ahrs_gx3.c index cb8f1681f3..052018a9b2 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_gx3.c +++ b/sw/airborne/subsystems/ahrs/ahrs_gx3.c @@ -347,14 +347,3 @@ void ahrs_aligner_run(void) { void ahrs_aligner_init(void) { } -void ahrs_propagate(void) { -} - -void ahrs_update_accel(void) { -} - -void ahrs_update_mag(void) { -} - -void ahrs_update_gps(void) { -} diff --git a/sw/airborne/subsystems/ahrs/ahrs_infrared.c b/sw/airborne/subsystems/ahrs/ahrs_infrared.c index 267b2245d3..991718b743 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_infrared.c +++ b/sw/airborne/subsystems/ahrs/ahrs_infrared.c @@ -87,11 +87,6 @@ void ahrs_propagate(void) { stateSetBodyRates_f(&body_rate); } -void ahrs_update_accel(void) { -} - -void ahrs_update_mag(void) { -} void ahrs_update_gps(void) { diff --git a/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_euler.c b/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_euler.c index 2becf1456b..c676cb16fd 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_euler.c +++ b/sw/airborne/subsystems/ahrs/ahrs_int_cmpl_euler.c @@ -278,10 +278,6 @@ void ahrs_update_mag(void) { } -void ahrs_update_gps(void) { - -} - /* measures phi and theta assuming no dynamic acceleration ?!! */ __attribute__ ((always_inline)) static inline void get_phi_theta_measurement_fom_accel(int32_t* phi_meas, int32_t* theta_meas, struct Int32Vect3 accel) { diff --git a/sw/airborne/subsystems/ahrs/ahrs_sim.c b/sw/airborne/subsystems/ahrs/ahrs_sim.c index b5f6bc11cf..5c1d5c726f 100644 --- a/sw/airborne/subsystems/ahrs/ahrs_sim.c +++ b/sw/airborne/subsystems/ahrs/ahrs_sim.c @@ -94,13 +94,3 @@ void ahrs_propagate(void) { } } -void ahrs_update_accel(void) { -} - -void ahrs_update_mag(void) { -} - -void ahrs_update_gps(void) { - -} -