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

added EXTI_StructInit and replaced tabs with 4 spaces

This commit is contained in:
Steveis 2015-05-05 12:17:15 +01:00
parent 3fdbe68ee1
commit 4615f1a70d

View file

@ -192,29 +192,29 @@ bool bmp085Detect(const bmp085Config_t *config, baro_t *baro)
ack = i2cRead(BMP085_I2C_ADDR, BMP085_CHIP_ID__REG, 1, &data); /* read Chip Id */ ack = i2cRead(BMP085_I2C_ADDR, BMP085_CHIP_ID__REG, 1, &data); /* read Chip Id */
if (ack) { if (ack) {
bmp085.chip_id = BMP085_GET_BITSLICE(data, BMP085_CHIP_ID); bmp085.chip_id = BMP085_GET_BITSLICE(data, BMP085_CHIP_ID);
bmp085.oversampling_setting = 3; bmp085.oversampling_setting = 3;
if (bmp085.chip_id == BMP085_CHIP_ID) { /* get bitslice */ if (bmp085.chip_id == BMP085_CHIP_ID) { /* get bitslice */
i2cRead(BMP085_I2C_ADDR, BMP085_VERSION_REG, 1, &data); /* read Version reg */ i2cRead(BMP085_I2C_ADDR, BMP085_VERSION_REG, 1, &data); /* read Version reg */
bmp085.ml_version = BMP085_GET_BITSLICE(data, BMP085_ML_VERSION); /* get ML Version */ bmp085.ml_version = BMP085_GET_BITSLICE(data, BMP085_ML_VERSION); /* get ML Version */
bmp085.al_version = BMP085_GET_BITSLICE(data, BMP085_AL_VERSION); /* get AL Version */ bmp085.al_version = BMP085_GET_BITSLICE(data, BMP085_AL_VERSION); /* get AL Version */
bmp085_get_cal_param(); /* readout bmp085 calibparam structure */ bmp085_get_cal_param(); /* readout bmp085 calibparam structure */
bmp085InitDone = true; bmp085InitDone = true;
baro->ut_delay = 6000; // 1.5ms margin according to the spec (4.5ms T conversion time) baro->ut_delay = 6000; // 1.5ms margin according to the spec (4.5ms T conversion time)
baro->up_delay = 27000; // 6000+21000=27000 1.5ms margin according to the spec (25.5ms P conversion time with OSS=3) baro->up_delay = 27000; // 6000+21000=27000 1.5ms margin according to the spec (25.5ms P conversion time with OSS=3)
baro->start_ut = bmp085_start_ut; baro->start_ut = bmp085_start_ut;
baro->get_ut = bmp085_get_ut; baro->get_ut = bmp085_get_ut;
baro->start_up = bmp085_start_up; baro->start_up = bmp085_start_up;
baro->get_up = bmp085_get_up; baro->get_up = bmp085_get_up;
baro->calculate = bmp085_calculate; baro->calculate = bmp085_calculate;
return true; return true;
} }
} }
#ifdef BARO_EOC_GPIO #ifdef BARO_EOC_GPIO
EXTI_InitTypeDef EXTI_InitStructure; EXTI_InitTypeDef EXTI_InitStructure;
// Disable EXTI interrupt for barometer EOC EXTI_StructInit(&EXTI_InitStructure);
EXTI_InitStructure.EXTI_Line = EXTI_Line14; EXTI_InitStructure.EXTI_Line = EXTI_Line14;
EXTI_InitStructure.EXTI_LineCmd = DISABLE; EXTI_InitStructure.EXTI_LineCmd = DISABLE;
EXTI_Init(&EXTI_InitStructure); EXTI_Init(&EXTI_InitStructure);