mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-17 07:00:36 +08:00
board_config: remove px4_board_pwr, use px4_shutdown_request instead
px4_board_pwr has become obsolete with the addition of board_shutdown
This commit is contained in:
@@ -208,7 +208,7 @@ typedef enum board_power_button_state_notification_e {
|
||||
PWR_BUTTON_REQUEST_SHUT_DOWN, /* Button went up after meeting shutdown button down time */
|
||||
|
||||
PWR_BUTTON_RESPONSE_SHUT_DOWN_PENDING, /* Response from call back board code does nothing the
|
||||
* expectation is that board_do_shutdown will be called.
|
||||
* expectation is that board_shutdown will be called.
|
||||
*/
|
||||
PWR_BUTTON_RESPONSE_SHUT_DOWN_NOW, /* Response from call back board code does shutdown now. */
|
||||
} board_power_button_state_notification_e;
|
||||
@@ -453,25 +453,16 @@ __EXPORT int board_mcu_version(char *rev, const char **revstr, const char **erra
|
||||
int board_register_power_state_notification_cb(power_button_state_notification_t cb);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_do_shutdown
|
||||
* Name: board_shutdown
|
||||
*
|
||||
* Description:
|
||||
* boards may provide a function to power off the board.
|
||||
*
|
||||
* return - none
|
||||
* return - OK, or -errno
|
||||
*/
|
||||
void board_shutdown(void);
|
||||
int board_shutdown(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: px4_board_pwr
|
||||
*
|
||||
* Description:
|
||||
* boards may provide a function control the power.
|
||||
*
|
||||
* return - none
|
||||
*/
|
||||
#else
|
||||
#define board_register_power_state_notification_cb(cb) (0)
|
||||
#define board_shutdown() { do {} while(0); }
|
||||
#define px4_board_pwr(switch_on) { do {} while(0); }
|
||||
static inline int board_register_power_state_notification_cb(power_button_state_notification_t cb) { return 0; }
|
||||
static inline int board_shutdown(void) { return -EINVAL; }
|
||||
#endif
|
||||
|
||||
@@ -342,16 +342,6 @@ void board_pwr_init(int stage);
|
||||
|
||||
bool board_pwr_button_down(void);
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_pwr
|
||||
*
|
||||
* Description:
|
||||
* Called to turn on or off the TAP
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
__EXPORT bool px4_board_pwr(bool on_not_off);
|
||||
|
||||
#include "../common/board_common.h"
|
||||
|
||||
#endif /* __ASSEMBLY__ */
|
||||
|
||||
@@ -176,24 +176,3 @@ bool board_pwr_button_down(void)
|
||||
{
|
||||
return 0 == stm32_gpioread(KEY_AD_GPIO);
|
||||
}
|
||||
|
||||
/****************************************************************************
|
||||
* Name: board_pwr
|
||||
*
|
||||
* Description:
|
||||
* Called to turn on or off the TAP
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
__EXPORT bool px4_board_pwr(bool on_not_off)
|
||||
{
|
||||
if (on_not_off) {
|
||||
stm32_configgpio(POWER_ON_GPIO);
|
||||
|
||||
} else {
|
||||
|
||||
stm32_configgpio(POWER_OFF_GPIO);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -442,11 +442,6 @@ extern "C" {
|
||||
return sim_delay;
|
||||
}
|
||||
|
||||
bool px4_board_pwr(bool on)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
const char *px4_get_device_names(unsigned int *handle)
|
||||
{
|
||||
return VDev::devList(handle);
|
||||
|
||||
Reference in New Issue
Block a user