mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-20 14:55:21 +03:00
Update hmc5883l to use new IO
This commit is contained in:
parent
9843d7ce2f
commit
5a10e75551
5 changed files with 31 additions and 109 deletions
|
@ -484,27 +484,12 @@ static void detectMag(magSensor_e magHardwareToUse)
|
|||
#ifdef USE_MAG_HMC5883
|
||||
const hmc5883Config_t *hmc5883Config = 0;
|
||||
|
||||
#ifdef NAZE
|
||||
#ifdef NAZE // TODO remove this target specific define
|
||||
static const hmc5883Config_t nazeHmc5883Config_v1_v4 = {
|
||||
.gpioAPB2Peripherals = RCC_APB2Periph_GPIOB,
|
||||
.gpioPin = Pin_12,
|
||||
.gpioPort = GPIOB,
|
||||
|
||||
/* Disabled for v4 needs more work.
|
||||
.exti_port_source = GPIO_PortSourceGPIOB,
|
||||
.exti_pin_source = GPIO_PinSource12,
|
||||
.exti_line = EXTI_Line12,
|
||||
.exti_irqn = EXTI15_10_IRQn
|
||||
*/
|
||||
.intTag = IO_TAG(PB12) /* perhaps disabled? */
|
||||
};
|
||||
static const hmc5883Config_t nazeHmc5883Config_v5 = {
|
||||
.gpioAPB2Peripherals = RCC_APB2Periph_GPIOC,
|
||||
.gpioPin = Pin_14,
|
||||
.gpioPort = GPIOC,
|
||||
.exti_port_source = GPIO_PortSourceGPIOC,
|
||||
.exti_line = EXTI_Line14,
|
||||
.exti_pin_source = GPIO_PinSource14,
|
||||
.exti_irqn = EXTI15_10_IRQn
|
||||
.intTag = IO_TAG(MAG_INT_EXTI)
|
||||
};
|
||||
if (hardwareRevision < NAZE32_REV5) {
|
||||
hmc5883Config = &nazeHmc5883Config_v1_v4;
|
||||
|
@ -513,15 +498,9 @@ static void detectMag(magSensor_e magHardwareToUse)
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef SPRACINGF3
|
||||
#ifdef MAG_INT_EXTI
|
||||
static const hmc5883Config_t spRacingF3Hmc5883Config = {
|
||||
.gpioAHBPeripherals = RCC_AHBPeriph_GPIOC,
|
||||
.gpioPin = Pin_14,
|
||||
.gpioPort = GPIOC,
|
||||
.exti_port_source = EXTI_PortSourceGPIOC,
|
||||
.exti_pin_source = EXTI_PinSource14,
|
||||
.exti_line = EXTI_Line14,
|
||||
.exti_irqn = EXTI15_10_IRQn
|
||||
.intTag = IO_TAG(MAG_INT_EXTI)
|
||||
};
|
||||
|
||||
hmc5883Config = &spRacingF3Hmc5883Config;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue