BMI323_SensorAPI
BMI323_SensorAPI copied to clipboard
FIFO code is incorrect when only the GYRO or ACCEL is enabled.
In bmi3_extract_accel and bmi3_extract_gyro, the block that runs if there isn't a partial read causes the data_index to update twice if only the accelerometer or gyroscope are enabled. This is due to the presence of
if (fifo->available_fifo_sens == BMI3_FIFO_HEAD_LESS_ACC_FRM){
data_index = data_index + BMI3_LENGTH_FIFO_ACC;
}
This causes the data_index to update if only the accelerometer is enabled. However the data index is already updated in unpack_fifo_data_frame with the update_data_index call.
This causes two blocks of data to be read instead of one. Deleting the
if (fifo->available_fifo_sens == BMI3_FIFO_HEAD_LESS_ACC_FRM){
data_index = data_index + BMI3_LENGTH_FIFO_ACC;
}
should resolve the issue