mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-14 23:43:34 +08:00
board_common:Added new API point board_on_reset
This optionally provided function called on entry to board_system_reset. It should perform any house keeping prior to retunring to do the rest.
This commit is contained in:
committed by
Lorenz Meier
parent
33f2897f00
commit
e967c2b340
@@ -310,6 +310,24 @@ __EXPORT void board_rc_input(bool invert_on);
|
||||
# endif
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* 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
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(BOARD_HAS_NO_RESET) || !defined(BOARD_HAS_ON_RESET)
|
||||
# define board_on_reset(status)
|
||||
#else
|
||||
__EXPORT void board_on_reset(int status);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_reset
|
||||
*
|
||||
|
||||
@@ -69,6 +69,9 @@ int board_set_bootload_mode(board_reset_e mode)
|
||||
|
||||
void board_system_reset(int status)
|
||||
{
|
||||
#if defined(BOARD_HAS_ON_RESET)
|
||||
board_on_reset(status);
|
||||
#endif
|
||||
board_reset(status);
|
||||
|
||||
while (1);
|
||||
|
||||
Reference in New Issue
Block a user