Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bmi3_extract_temperature and bmi3_extract_gyro bad operation ordering #8

Open
AustinJ755 opened this issue Oct 29, 2024 · 0 comments
Open

Comments

@AustinJ755
Copy link

In bmi3_extract_temperature and bmi3_extract_gyro the data_index is first updated conditionally and then the index is checked using check_data_index. This is incorrect as check_data_index also updates the data_index for it's check causing it to fail even when there is a frame the code is capable of reading.

Therefore the following

if (fifo->available_fifo_sens & BMI3_FIFO_HEAD_LESS_ACC_FRM)
{
    data_index = data_index + BMI3_LENGTH_FIFO_ACC;
}
rslt = check_data_index(data_index, fifo);

should change to

rslt = check_data_index(data_index, fifo);
if (fifo->available_fifo_sens & BMI3_FIFO_HEAD_LESS_ACC_FRM)
{
    data_index = data_index + BMI3_LENGTH_FIFO_ACC;
}
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

No branches or pull requests

1 participant