Commit 61f05b17 authored by schneider's avatar schneider
Browse files

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

parent 588cff38
...@@ -535,7 +535,11 @@ void max86150_setup(const uint8_t ppg_sample_rate) ...@@ -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(1, MAX86150_SLOT_RED_LED);
max86150_fifo_enable_slot(2, MAX86150_SLOT_IR_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_fifo_enable_slot(4, MAX86150_SLOT_NONE);
max86150_set_ppg_adc_range(MAX86150_ADCRANGE_16384); 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) ...@@ -662,14 +666,15 @@ uint8_t max86150_get_sample(uint32_t *red, uint32_t *ir, int32_t *ecg)
MXC_I2C1_BUS0, MXC_I2C1_BUS0,
MAX86150_ADDRESS << 1, MAX86150_ADDRESS << 1,
data, data,
3 * 3, 3 * 2,
0 0
); );
// According to datasheet MS bits of PPG have to be masked // According to datasheet MS bits of PPG have to be masked
*red = ((data[0] << 16) | (data[1] << 8) | (data[2])) & 0x7FFFF; *red = ((data[0] << 16) | (data[1] << 8) | (data[2])) & 0x7FFFF;
*ir = ((data[3] << 16) | (data[4] << 8) | (data[5])) & 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 } //End readPtr != writePtr
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment