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

fix(max86150): Disable ECG for the moment to keep PPG at 100 sps

parent 822d07ae
No related branches found
No related tags found
No related merge requests found
Pipeline #4757 failed
......@@ -535,7 +535,11 @@ void max86150_setup(const uint8_t ppg_sample_rate)
max86150_fifo_enable_slot(1, MAX86150_SLOT_RED_LED);
max86150_fifo_enable_slot(2, MAX86150_SLOT_IR_LED);
max86150_fifo_enable_slot(3, MAX86150_SLOT_ECG);
// ECG is disabled for now as the FIFO code does not
// manage the increased FIFO rate correctly.
// E.g. instead of providging PPG data at 100 sps, the
// code provides PPG data at 200 sps
//max86150_fifo_enable_slot(3, MAX86150_SLOT_ECG);
//max86150_fifo_enable_slot(4, MAX86150_SLOT_NONE);
max86150_set_ppg_adc_range(MAX86150_ADCRANGE_16384);
......@@ -662,14 +666,15 @@ uint8_t max86150_get_sample(uint32_t *red, uint32_t *ir, int32_t *ecg)
MXC_I2C1_BUS0,
MAX86150_ADDRESS << 1,
data,
3 * 3,
3 * 2,
0
);
// According to datasheet MS bits of PPG have to be masked
*red = ((data[0] << 16) | (data[1] << 8) | (data[2])) & 0x7FFFF;
*ir = ((data[3] << 16) | (data[4] << 8) | (data[5])) & 0x7FFFF;
*ecg = (data[6] << 16) | (data[7] << 8) | (data[8]);
//*ecg = (data[6] << 16) | (data[7] << 8) | (data[8]);
*ecg = 0;
}
} //End readPtr != writePtr
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment