mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 19:33:33 +08:00
board_ctrl: Clean up usage of VBUS, nARMED from user/kernelspace
Move logic implemented in the header files to source files, this way it will be simpler to define which is compiled to kernel space and which to user space Also allows to remove some headers that pull in half the universe from the board definitions (which should just be pin definitions and no functionality)
This commit is contained in:
@@ -509,18 +509,7 @@ static inline bool board_rc_invert_input(const char *device, bool invert) { retu
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
#if defined(__PX4_NUTTX) && !defined(CONFIG_BUILD_FLAT)
|
||||
inline static int board_read_VBUS_state(void)
|
||||
{
|
||||
platformiocvbusstate_t state = {false};
|
||||
boardctl(PLATFORMIOCVBUSSTATE, (uintptr_t)&state);
|
||||
return state.ret;
|
||||
}
|
||||
#elif defined(GPIO_OTGFS_VBUS)
|
||||
# define board_read_VBUS_state() (px4_arch_gpioread(GPIO_OTGFS_VBUS) ? 0 : 1)
|
||||
#else
|
||||
int board_read_VBUS_state(void);
|
||||
#endif
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_on_reset
|
||||
|
||||
Reference in New Issue
Block a user