diff --git a/src/drivers/boards/px4fmu-v5/board_config.h b/src/drivers/boards/px4fmu-v5/board_config.h index 48630457d2..11a52a8b55 100644 --- a/src/drivers/boards/px4fmu-v5/board_config.h +++ b/src/drivers/boards/px4fmu-v5/board_config.h @@ -515,6 +515,10 @@ __BEGIN_DECLS #define BOARD_DMA_ALLOC_POOL_SIZE 5120 +/* This boar provides the board_on_reset interface */ + +#define BOARD_HAS_ON_RESET 1 + /* The list of GPIO that will be initialized */ #define PX4_GPIO_PWM_INIT_LIST { \ diff --git a/src/drivers/boards/px4fmu-v5/px4fmu_init.c b/src/drivers/boards/px4fmu-v5/px4fmu_init.c index 082a89a437..940310f6be 100644 --- a/src/drivers/boards/px4fmu-v5/px4fmu_init.c +++ b/src/drivers/boards/px4fmu-v5/px4fmu_init.c @@ -192,6 +192,30 @@ __EXPORT void board_peripheral_reset(int ms) } +/************************************************************************************ + * Name: board_on_reset + * + * Description: + * Optionally provided function called on entry to board_system_reset + * It should perform any house keeping prior to the rest. + * + * status - 1 if resetting to boot loader + * 0 if just resetting + * + ************************************************************************************/ +__EXPORT void board_on_reset(int status) +{ + /* configure the GPIO pins to outputs and keep them low */ + + const uint32_t gpio[] = PX4_GPIO_PWM_INIT_LIST; + board_gpio_init(gpio, arraySize(gpio)); + + if (status >= 0) { + up_mdelay(6); + } +} + + /************************************************************************************ * Name: stm32_boardinitialize *