mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-05 00:11:35 +08:00
FMU: Fix peripheral reset
This commit is contained in:
@@ -1383,12 +1383,12 @@ PX4FMU::peripheral_reset(int ms)
|
|||||||
#if defined(CONFIG_ARCH_BOARD_PX4FMU_V2)
|
#if defined(CONFIG_ARCH_BOARD_PX4FMU_V2)
|
||||||
|
|
||||||
if (ms < 1) {
|
if (ms < 1) {
|
||||||
ms = 1;
|
ms = 10;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* set the peripheral rails off */
|
/* set the peripheral rails off */
|
||||||
stm32_configgpio(GPIO_VDD_5V_PERIPH_EN);
|
stm32_configgpio(GPIO_VDD_5V_PERIPH_EN);
|
||||||
stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 0);
|
stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1);
|
||||||
|
|
||||||
/* wait for the peripheral rail to reach GND */
|
/* wait for the peripheral rail to reach GND */
|
||||||
usleep(ms * 1000);
|
usleep(ms * 1000);
|
||||||
@@ -1397,7 +1397,7 @@ PX4FMU::peripheral_reset(int ms)
|
|||||||
/* re-enable power */
|
/* re-enable power */
|
||||||
|
|
||||||
/* switch the peripheral rail back on */
|
/* switch the peripheral rail back on */
|
||||||
stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 1);
|
stm32_gpiowrite(GPIO_VDD_5V_PERIPH_EN, 0);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user