diff options
Diffstat (limited to 'libsensors_iio/software/core/mllite/results_holder.c')
-rw-r--r-- | libsensors_iio/software/core/mllite/results_holder.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/libsensors_iio/software/core/mllite/results_holder.c b/libsensors_iio/software/core/mllite/results_holder.c index 97ffdec..df58f40 100644 --- a/libsensors_iio/software/core/mllite/results_holder.c +++ b/libsensors_iio/software/core/mllite/results_holder.c @@ -13,13 +13,16 @@ * @file results_holder.c * @brief Results Holder for HAL. */ + +#include <string.h> + #include "results_holder.h" -#include "log.h" #include "ml_math_func.h" #include "mlmath.h" #include "start_manager.h" #include "data_builder.h" #include "message_layer.h" +#include "log.h" // These 2 status bits are used to control when the 9 axis quaternion is updated #define INV_COMPASS_CORRECTION_SET 1 @@ -34,6 +37,7 @@ struct results_t { long mag_scale[3]; /**< scale factor to apply to magnetic field reading */ long compass_correction[4]; /**< quaternion going from gyro,accel quaternion to 9 axis */ int acc_state; /**< Describes accel state */ + int got_accel_bias; /**< Flag describing if accel bias is known */ long compass_bias_error[3]; /**< Error Squared */ unsigned char motion_state; unsigned int motion_state_counter; /**< Incremented for each no motion event in a row */ @@ -318,6 +322,24 @@ inv_error_t inv_enable_results_holder() return result; } +/** Sets state of if we know the accel bias. + * @return return 1 if we know the accel bias, 0 if not. + * it is set with inv_set_accel_bias_found() + */ +int inv_got_accel_bias() +{ + return rh.got_accel_bias; +} + +/** Sets whether we know the accel bias + * @param[in] state Set to 1 if we know the accel bias. + * Can be retrieved with inv_got_accel_bias() + */ +void inv_set_accel_bias_found(int state) +{ + rh.got_accel_bias = state; +} + /** Sets state of if we know the compass bias. * @return return 1 if we know the compass bias, 0 if not. * it is set with inv_set_compass_bias_found() |