Line 19... |
Line 19... |
19 |
float b1; |
19 |
float b1; |
20 |
float b2; |
20 |
float b2; |
21 |
float c12; |
21 |
float c12; |
22 |
|
22 |
|
23 |
|
23 |
|
24 |
void MPL_init() |
24 |
int1 MPL_init() |
25 |
{ |
25 |
{ |
26 |
unsigned int8 a0_MSB, a0_LSB; |
26 |
unsigned int8 a0_MSB, a0_LSB; |
27 |
unsigned int8 b1_MSB, b1_LSB; |
27 |
unsigned int8 b1_MSB, b1_LSB; |
28 |
unsigned int8 b2_MSB, b2_LSB; |
28 |
unsigned int8 b2_MSB, b2_LSB; |
29 |
unsigned int8 c12_MSB, c12_LSB; |
29 |
unsigned int8 c12_MSB, c12_LSB; |
Line 57... |
Line 57... |
57 |
|
57 |
|
58 |
a0 = ((unsigned int16) a0_MSB << 5) + (a0_LSB >> 3) + (a0_LSB & 0x07)/8.0; |
58 |
a0 = ((unsigned int16) a0_MSB << 5) + (a0_LSB >> 3) + (a0_LSB & 0x07)/8.0; |
59 |
b1 = ((((b1_MSB & 0x1F) * 0x100) + b1_LSB) / 8192.0) - 3; |
59 |
b1 = ((((b1_MSB & 0x1F) * 0x100) + b1_LSB) / 8192.0) - 3; |
60 |
b2 = ((((unsigned int16) (b2_MSB - 0x80) << 8) + b2_LSB)/ 16384.0) - 2; |
60 |
b2 = ((((unsigned int16) (b2_MSB - 0x80) << 8) + b2_LSB)/ 16384.0) - 2; |
61 |
c12 =(((c12_MSB * 0x100) + c12_LSB)/16777216.0); |
61 |
c12 =(((c12_MSB * 0x100) + c12_LSB)/16777216.0); |
- |
|
62 |
|
- |
|
63 |
if((a0_MSB | a0_LSB | b1_MSB | b1_LSB | b2_MSB | b2_LSB |c12_MSB | c12_LSB) == 0xFF) |
- |
|
64 |
return (TRUE); |
- |
|
65 |
else return (FALSE); |
62 |
} |
66 |
} |
63 |
|
67 |
|
64 |
float MPL_get_pressure() |
68 |
float MPL_get_pressure() |
65 |
{ |
69 |
{ |
66 |
unsigned int8 LSB_data, MSB_data; |
70 |
unsigned int8 LSB_data, MSB_data; |