Commit f81154d5 authored by schneider's avatar schneider
Browse files

fix(max86150): Mask MS bits of PPG data

parent 6cc393ed
......@@ -667,8 +667,9 @@ uint8_t max86150_get_sample(uint32_t *red, uint32_t *ir, int32_t *ecg)
0
);
*red = (data[0] << 16) | (data[1] << 8) | (data[2]);
*ir = (data[3] << 16) | (data[4] << 8) | (data[5]);
// 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]);
}
......
Supports Markdown
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