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:
Ville Juven
2022-09-05 07:37:28 +02:00
committed by Beat Küng
parent a56f654651
commit 9ed35debec
10 changed files with 357 additions and 180 deletions
@@ -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