1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-26 09:45:37 +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

@ -116,6 +116,15 @@ void pgResetFn_compassConfig(compassConfig_t *compassConfig)
static int16_t magADCRaw[XYZ_AXIS_COUNT];
static uint8_t magInit = 0;
void compassPreInit(void)
{
#ifdef USE_SPI
if (compassConfig()->mag_bustype == BUSTYPE_SPI) {
spiPreinitRegister(compassConfig()->mag_spi_csn, IOCFG_IPU, 1);
}
#endif
}
#if !defined(SIMULATOR_BUILD)
bool compassDetect(magDev_t *dev)
{