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

Introduce per device pin pre-init

This commit is contained in:
jflyper 2018-12-10 04:42:41 +09:00
parent 2e81109be1
commit 9ea1428d11
44 changed files with 219 additions and 201 deletions

View file

@ -146,6 +146,15 @@ static int32_t baroGroundAltitude = 0;
static int32_t baroGroundPressure = 8*101325;
static uint32_t baroPressureSum = 0;
void baroPreInit(void)
{
#ifdef USE_SPI
if (barometerConfig()->baro_bustype == BUSTYPE_SPI) {
spiPreinitRegister(barometerConfig()->baro_spi_csn, IOCFG_IPU, 1);
}
#endif
}
bool baroDetect(baroDev_t *dev, baroSensor_e baroHardwareToUse)
{
// Detect what pressure sensors are available. baro->update() is set to sensor-specific update function