Skip to content
Snippets Groups Projects
Commit 1f89a75f authored by schneider's avatar schneider
Browse files

fix(max30001): logging and inverting the data

parent fac9fe91
No related branches found
No related tags found
No related merge requests found
...@@ -154,11 +154,14 @@ static void max30001_handle_samples(int16_t *sensor_data, int16_t n) ...@@ -154,11 +154,14 @@ static void max30001_handle_samples(int16_t *sensor_data, int16_t n)
} }
while (n--) { while (n--) {
uint16_t data = -*sensor_data++;
if (xQueueSend( if (xQueueSend(
max30001_stream.queue, max30001_stream.queue,
sensor_data++, &data,
MAX30001_MUTEX_WAIT_MS) != pdTRUE) { MAX30001_MUTEX_WAIT_MS) != pdTRUE) {
// TODO; handle queue full LOG_WARN(
"max30001",
"queue full"); // TODO; handle queue full
} }
} }
api_interrupt_trigger(EPIC_INT_MAX30001_ECG); api_interrupt_trigger(EPIC_INT_MAX30001_ECG);
...@@ -336,9 +339,10 @@ static int max30001_fetch_fifo(void) ...@@ -336,9 +339,10 @@ static int max30001_fetch_fifo(void)
// Check if FIFO has overflowed // Check if FIFO has overflowed
if (ETAG[readECGSamples - 1] == FIFO_OVF_MASK) { if (ETAG[readECGSamples - 1] == FIFO_OVF_MASK) {
ecg_write_reg( ecg_write_reg(FIFO_RST, 0); // Reset FIFO
FIFO_RST, LOG_WARN(
0); // Reset FIFO TODO: report overflow "max30001",
"fifo overflow"); // TODO; handle fifo full
} }
max30001_handle_samples(ecgSample, readECGSamples); max30001_handle_samples(ecgSample, readECGSamples);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment