Skip to content

Conversation

@disq
Copy link

@disq disq commented Jan 18, 2024

This PR adds skip_reset option to bmi270_init. Useful when waking up from sleep and the IMU has already initialized. Preventing the soft reset lets us read IMU regs to get activity data (such as step count) while we were asleep.

* @retval < 0 -> Fail
*/
int8_t bmi270_init(struct bmi2_dev *dev);
int8_t bmi270_init(struct bmi2_dev *dev, uint8_t skip_reset);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMO you shouldn't modify the API, it will break all examples, and also all applications already using it, and just updating the driver.

Instead add a new API, bmi270_init_opt or smth else then:

int8_t bmi270_init(struct bmi2_dev *dev)
{
 return bmi270_init_opt(dev, false);
}

int8_t bmi270_init_opt(struct bmi2_dev *dev, uint8_t skip_reset) {
....
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants