1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-20 06:45:16 +03:00

Baro fixes 1 (#7711)

Baro fixes 1
This commit is contained in:
Michael Keller 2019-06-05 01:07:24 +12:00 committed by GitHub
commit 32416c7972
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 97 additions and 87 deletions

View file

@ -27,6 +27,7 @@ void bmp280_calculate(int32_t *pressure, int32_t *temperature);
extern uint32_t bmp280_up;
extern uint32_t bmp280_ut;
extern int32_t t_fine; /* calibration t_fine data */
typedef struct bmp280_calib_param_s {
uint16_t dig_T1; /* calibration T1 data */
@ -41,8 +42,7 @@ typedef struct bmp280_calib_param_s {
int16_t dig_P7; /* calibration P7 data */
int16_t dig_P8; /* calibration P8 data */
int16_t dig_P9; /* calibration P9 data */
int32_t t_fine; /* calibration t_fine data */
} bmp280_calib_param_t;
} __attribute__((packed)) bmp280_calib_param_t; // packed as we read directly from the device into this structure.
bmp280_calib_param_t bmp280_cal;
}
@ -58,6 +58,7 @@ TEST(baroBmp280Test, TestBmp280Calculate)
int32_t pressure, temperature;
bmp280_up = 415148; // Digital pressure value
bmp280_ut = 519888; // Digital temperature value
t_fine = 0;
// and
bmp280_cal.dig_T1 = 27504;
@ -87,6 +88,7 @@ TEST(baroBmp280Test, TestBmp280CalculateHighP)
int32_t pressure, temperature;
bmp280_up = 215148; // Digital pressure value
bmp280_ut = 519888; // Digital temperature value
t_fine = 0;
// and
bmp280_cal.dig_T1 = 27504;
@ -116,6 +118,7 @@ TEST(baroBmp280Test, TestBmp280CalculateZeroP)
int32_t pressure, temperature;
bmp280_up = 415148; // Digital pressure value
bmp280_ut = 519888; // Digital temperature value
t_fine = 0;
// and
bmp280_cal.dig_T1 = 27504;