03-06-2019 10:36 PM
We have experienced the BMI160 driver (https://github.com/BoschSensortec/BMI160_driver/) calling read() with a length of 0. What should the read() function we supply return in these cases? BMI160_OK?
Solved! Go to Solution.
03-19-2019 01:58 PM
one more comment:
maybe it is better to add a judgement in function :
static int8_t get_fifo_byte_counter(uint16_t *bytes_to_read, struct bmi160_dev const *dev)
{
..................
*bytes_to_read = (((uint16_t)data[1] << 😎 | ((uint16_t)data[0]));
// add judgement here:
if(0 !=*bytes_to_read )
rslt = BMI160_OK;
else
rslt = BMI160_E_INVALID_INPUT;
return rslt;
}
03-19-2019 07:30 PM
Yes, your final proposal seems to make sense.
On a related note: We do occasionally get 0 in the fifo byte counter, even though we expect there to be a lot of data in the FIFO. Any particular situation this could happen? Any specific spot we should start debugging you could point to?
03-19-2019 11:46 PM