mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-18 22:05:17 +03:00
SPRacingF3/Naze32 Rev 5 - Add support for MAG data ready EXTI handler.
This commit is contained in:
parent
4a22227b60
commit
80beb9c8d8
7 changed files with 128 additions and 5 deletions
|
@ -476,12 +476,26 @@ static void detectMag(magSensor_e magHardwareToUse)
|
|||
static const hmc5883Config_t nazeHmc5883Config_v1_v4 = {
|
||||
.gpioAPB2Peripherals = RCC_APB2Periph_GPIOB,
|
||||
.gpioPin = Pin_12,
|
||||
.gpioPort = GPIOB
|
||||
.gpioPort = GPIOB,
|
||||
|
||||
.exti_port_source = 0,
|
||||
.exti_pin_source = 0
|
||||
|
||||
/* 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
|
||||
*/
|
||||
};
|
||||
static const hmc5883Config_t nazeHmc5883Config_v5 = {
|
||||
.gpioAPB2Peripherals = RCC_APB2Periph_GPIOC,
|
||||
.gpioPin = Pin_14,
|
||||
.gpioPort = GPIOC
|
||||
.gpioPort = GPIOC,
|
||||
.exti_port_source = GPIO_PortSourceGPIOC,
|
||||
.exti_pin_source = GPIO_PinSource14,
|
||||
.exti_line = EXTI_Line14,
|
||||
.exti_irqn = EXTI15_10_IRQn
|
||||
};
|
||||
if (hardwareRevision < NAZE32_REV5) {
|
||||
hmc5883Config = &nazeHmc5883Config_v1_v4;
|
||||
|
@ -494,7 +508,11 @@ static void detectMag(magSensor_e magHardwareToUse)
|
|||
static const hmc5883Config_t spRacingF3Hmc5883Config = {
|
||||
.gpioAHBPeripherals = RCC_AHBPeriph_GPIOC,
|
||||
.gpioPin = Pin_14,
|
||||
.gpioPort = GPIOC
|
||||
.gpioPort = GPIOC,
|
||||
.exti_port_source = EXTI_PortSourceGPIOC,
|
||||
.exti_pin_source = EXTI_PinSource14,
|
||||
.exti_line = EXTI_Line14,
|
||||
.exti_irqn = EXTI15_10_IRQn
|
||||
};
|
||||
|
||||
hmc5883Config = &spRacingF3Hmc5883Config;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue