mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-19 06:15:16 +03:00
Remove lazy init
This commit is contained in:
parent
46b3a7c9b0
commit
eefa2a8e88
2 changed files with 0 additions and 13 deletions
|
@ -53,7 +53,6 @@ typedef struct bmp280_calib_param_s {
|
|||
} bmp280_calib_param_t;
|
||||
|
||||
static uint8_t bmp280_chip_id = 0;
|
||||
static bool bmp280InitDone = false;
|
||||
STATIC_UNIT_TESTED bmp280_calib_param_t bmp280_cal;
|
||||
// uncompensated pressure and temperature
|
||||
int32_t bmp280_up = 0;
|
||||
|
@ -125,9 +124,6 @@ void bmp280BusDeinit(busDevice_t *pBusdev)
|
|||
|
||||
bool bmp280Detect(baroDev_t *baro)
|
||||
{
|
||||
if (bmp280InitDone)
|
||||
return true;
|
||||
|
||||
delay(20);
|
||||
|
||||
busDevice_t *pBusdev = &baro->busdev;
|
||||
|
@ -157,8 +153,6 @@ bool bmp280Detect(baroDev_t *baro)
|
|||
baro->up_delay = ((T_INIT_MAX + T_MEASURE_PER_OSRS_MAX * (((1 << BMP280_TEMPERATURE_OSR) >> 1) + ((1 << BMP280_PRESSURE_OSR) >> 1)) + (BMP280_PRESSURE_OSR ? T_SETUP_PRESSURE_MAX : 0) + 15) / 16) * 1000;
|
||||
baro->calculate = bmp280_calculate;
|
||||
|
||||
bmp280InitDone = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
@ -60,7 +60,6 @@ STATIC_UNIT_TESTED uint32_t ms5611_ut; // static result of temperature measurem
|
|||
STATIC_UNIT_TESTED uint32_t ms5611_up; // static result of pressure measurement
|
||||
STATIC_UNIT_TESTED uint16_t ms5611_c[PROM_NB]; // on-chip ROM
|
||||
static uint8_t ms5611_osr = CMD_ADC_4096;
|
||||
static bool ms5611InitDone = false;
|
||||
|
||||
bool ms5611ReadCommand(busDevice_t *pBusdev, uint8_t cmd, uint8_t len, uint8_t *data)
|
||||
{
|
||||
|
@ -124,10 +123,6 @@ bool ms5611Detect(baroDev_t *baro)
|
|||
uint8_t sig;
|
||||
int i;
|
||||
|
||||
if (ms5611InitDone) {
|
||||
return true;
|
||||
}
|
||||
|
||||
delay(10); // No idea how long the chip takes to power-up, but let's make it 10ms
|
||||
|
||||
busDevice_t *pBusdev = &baro->busdev;
|
||||
|
@ -160,8 +155,6 @@ bool ms5611Detect(baroDev_t *baro)
|
|||
baro->get_up = ms5611_get_up;
|
||||
baro->calculate = ms5611_calculate;
|
||||
|
||||
ms5611InitDone = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue