forked from Archive/PX4-Autopilot
px4fmu-v5:Added board_on_reset api to reset PWM
This commit is contained in:
parent
54bd0a9f2a
commit
ebc8b47fad
|
@ -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 { \
|
||||
|
|
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue