38 #if BMP3_COMPENSATION == BMP3_DOUBLE_PRECISION_COMPENSATION
43 #elif BMP3_COMPENSATION == BMP3_SINGLE_PRECISION_COMPENSATION
48 #elif BMP3_COMPENSATION == BMP3_INTEGER_COMPENSATION
53 #error "BMP3: Unknown compensation type"
187 #if BMP3_COMPENSATION == BMP3_DOUBLE_PRECISION_COMPENSATION
199 temp_var = 0.00390625;
204 temp_var = 1073741824.0;
208 temp_var = 281474976710656.0;
212 temp_var = 1048576.0;
216 temp_var = 536870912.0;
220 temp_var = 4294967296.0;
224 temp_var = 137438953472.0;
245 temp_var = 281474976710656.0;
249 temp_var = 281474976710656.0;
253 temp_var = 36893488147419103232.0;
264 double partial_data2 = (double)(partial_data1 * bmp->
quant_calib.par_t2);
267 bmp->
quant_calib.t_lin = partial_data2 + (partial_data1 * partial_data1)
286 double partial_data1;
287 double partial_data2;
288 double partial_data3;
289 double partial_data4;
296 partial_out1 = bmp->
quant_calib.par_p5 + partial_data1 + partial_data2 + partial_data3;
302 (bmp->
quant_calib.par_p1 + partial_data1 + partial_data2 + partial_data3);
306 partial_data3 = partial_data1 * partial_data2;
308 comp_press = partial_out1 + partial_out2 + partial_data4;
322 double pow_output = 1;
325 pow_output = base * pow_output;
332 #elif BMP3_COMPENSATION == BMP3_SINGLE_PRECISION_COMPENSATION
344 temp_var = 0.00390625f;
349 temp_var = 1073741824.0f;
353 temp_var = 281474976710656.0f;
357 temp_var = 1048576.0f;
361 temp_var = 536870912.0f;
365 temp_var = 4294967296.0f;
369 temp_var = 137438953472.0f;
390 temp_var = 281474976710656.0f;
394 temp_var = 281474976710656.0f;
398 temp_var = 36893488147419103232.0f;
409 float partial_data2 = (float)(partial_data1 * bmp->
quant_calib.par_t2);
412 bmp->
quant_calib.t_lin = partial_data2 + (partial_data1 * partial_data1)
441 partial_out1 = bmp->
quant_calib.par_p5 + partial_data1 + partial_data2 + partial_data3;
447 (bmp->
quant_calib.par_p1 + partial_data1 + partial_data2 + partial_data3);
451 partial_data3 = partial_data1 * partial_data2;
453 comp_press = partial_out1 + partial_out2 + partial_data4;
467 float pow_output = 1;
470 pow_output = base * pow_output;
477 #elif BMP3_COMPENSATION == BMP3_INTEGER_COMPENSATION
519 partial_data3 = partial_data1 * partial_data1;
521 partial_data5 = ((
int64_t)(partial_data2 * 262144) + partial_data4);
522 partial_data6 = partial_data5 / 4294967296;
525 comp_temp = (
int64_t)((partial_data6 * 25) / 16384);
550 partial_data2 = partial_data1 / 64;
551 partial_data3 = (partial_data2 * bmp->
calib.
t_lin) / 256;
552 partial_data4 = (bmp->
calib.
par_p8 * partial_data3) / 32;
553 partial_data5 = (bmp->
calib.
par_p7 * partial_data1) * 16;
555 offset = (bmp->
calib.
par_p5 * 140737488355328) + partial_data4 + partial_data5 + partial_data6;
557 partial_data2 = (bmp->
calib.
par_p4 * partial_data3) / 32;
558 partial_data4 = (bmp->
calib.
par_p3 * partial_data1) * 4;
560 sensitivity = ((bmp->
calib.
par_p1 - 16384) * 70368744177664) + partial_data2 + partial_data4 + partial_data5;
562 partial_data1 = (sensitivity / 16777216) * bmp->
raw_pressure;
564 partial_data3 = partial_data2 + (65536 * bmp->
calib.
par_p9);
565 partial_data4 = (partial_data3 * bmp->
raw_pressure) / 8192;
566 partial_data5 = (partial_data4 * bmp->
raw_pressure) / 512;
568 partial_data2 = (bmp->
calib.
par_p11 * partial_data6) / 65536;
569 partial_data3 = (partial_data2 * bmp->
raw_pressure) / 128;
570 partial_data4 = (
offset / 4) + partial_data1 + partial_data5 + partial_data3;
574 bmp->
pressure = ((float)comp_press) / 100.f;