I'm periodically polling a TWI sensor with a blocking call, as in
ret_code_t err_code;
m_xfer_done = false;
err_code = nrf_drv_twi_tx(&i2c, address, subAddress, 1, true);
APP_ERROR_CHECK(err_code);
while (m_xfer_done == false) {};
if (err_code == NRF_SUCCESS) {
m_xfer_done = false;
err_code = nrf_drv_twi_rx(&i2c, address, dest, count);
APP_ERROR_CHECK(err_code);
while (m_xfer_done == false) {};
};
This works fine about 3000 times, and then comes to grinding halt. I'm reading 8 bytes per nrf_drv_twi_rx. My first guess is running out of memory, but why? I'm just sampling the bus and updating the values of a static unit8_t dest[8].