Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions bmi270.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ const struct bmi2_feature_config bmi270_feat_out[BMI270_MAX_FEAT_OUT] = {
};

/*! @name Global array that stores the feature interrupts of BMI270 */
struct bmi2_map_int bmi270_map_int[BMI270_MAX_INT_MAP] = {
const struct bmi2_map_int bmi270_map_int[BMI270_MAX_INT_MAP] = {
{ .type = BMI2_SIG_MOTION, .sens_map_int = BMI270_INT_SIG_MOT_MASK },
{ .type = BMI2_STEP_COUNTER, .sens_map_int = BMI270_INT_STEP_COUNTER_MASK },
{ .type = BMI2_STEP_DETECTOR, .sens_map_int = BMI270_INT_STEP_DETECTOR_MASK },
Expand All @@ -542,7 +542,15 @@ struct bmi2_map_int bmi270_map_int[BMI270_MAX_INT_MAP] = {
* @retval 0 -> Success
* @retval < 0 -> Fail
*/
#ifdef CONFIG_BMI270_CHECK_NULL_PTR
static int8_t null_ptr_check(const struct bmi2_dev *dev);
#else
static inline int8_t null_ptr_check(const struct bmi2_dev *dev)
{
return BMI2_OK;
}
#endif


/*!
* @brief This internal API enables the selected sensor/features.
Expand Down Expand Up @@ -1385,7 +1393,6 @@ int8_t bmi270_sensor_disable(const uint8_t *sens_list, uint8_t n_sens, struct bm
{
rslt = BMI2_E_NULL_PTR;
}

return rslt;
}

Expand Down Expand Up @@ -1913,6 +1920,7 @@ int8_t bmi270_map_feat_int(const struct bmi2_sens_int_config *sens_int, uint8_t
* @brief This internal API is used to validate the device structure pointer for
* null conditions.
*/
#ifdef CONFIG_BMI270_CHECK_NULL_PTR
static int8_t null_ptr_check(const struct bmi2_dev *dev)
{
/* Variable to define error */
Expand All @@ -1926,6 +1934,7 @@ static int8_t null_ptr_check(const struct bmi2_dev *dev)

return rslt;
}
#endif

/*!
* @brief This internal API selects the sensor/features to be enabled or
Expand Down
2 changes: 1 addition & 1 deletion bmi2_defs.h
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,7 @@ struct bmi2_dev
bmi2_tap_fptr_t set_tap_config;

/*! Array of feature interrupts configuration structure */
struct bmi2_map_int *map_int;
const struct bmi2_map_int *map_int;

/*! To define maximum number of interrupts */
uint8_t sens_int_map;
Expand Down