max30100: ISR recover attempt

Handle failure in ISR routine - attempt to read status and
FIFO registers and continue sampleing (vs exiting and turning
off continuous sampling).

Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
Noel Eck 2017-01-11 15:52:41 -08:00
parent bd47b9ed45
commit 6769d976a0

View File

@ -397,9 +397,15 @@ static void _internal_sample_rdy(void *arg)
* log an error in syslog and attempt to stop sampling * log an error in syslog and attempt to stop sampling
* Handle all failing cases here */ * Handle all failing cases here */
max30100_sample_rdy_fail: max30100_sample_rdy_fail:
syslog(LOG_CRIT, "%s: _internal_sample_rdy() failed, attempting to stop sampling...\n", syslog(LOG_CRIT,
"%s: _internal_sample_rdy() failed, attempting to restart sampling...\n",
__FUNCTION__); __FUNCTION__);
max30100_sample_stop(dev);
/* Read FIFO AND status register in a last attempt to continue
* sampling, ignore result */
max30100_read(dev, MAX30100_REG_FIFO_WR_PTR, &tmp);
max30100_read(dev, MAX30100_REG_INTERRUPT_STATUS, &tmp);
return; return;
} }