mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-08 01:11:36 +08:00
Add a separate library for initializing px4 userspace in protected build
The px4_userspace_init function in this library is called from userspace entrypoint before starting NSH Signed-off-by: Jukka Laitinen <jukkax@ssrc.tii.ae>
This commit is contained in:
@@ -110,6 +110,13 @@ if (NOT DEFINED CONFIG_BUILD_FLAT AND "${PX4_PLATFORM}" MATCHES "nuttx")
|
||||
)
|
||||
|
||||
add_dependencies(px4_board_ctrl nuttx_context nuttx_kernel_builtin_list_target)
|
||||
|
||||
add_library(px4_userspace_init
|
||||
px4_userspace_init.cpp
|
||||
)
|
||||
|
||||
add_dependencies(px4_userspace_init nuttx_context)
|
||||
|
||||
add_dependencies(px4_kernel_layer prebuild_targets)
|
||||
else()
|
||||
list(APPEND LIBS
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
#include <drivers/drv_hrt.h>
|
||||
#include <lib/parameters/param.h>
|
||||
#include <px4_platform_common/px4_work_queue/WorkQueueManager.hpp>
|
||||
#include <uORB/uORB.h>
|
||||
#include <sys/boardctl.h>
|
||||
|
||||
extern "C" void px4_userspace_init(void)
|
||||
{
|
||||
hrt_init();
|
||||
|
||||
param_init();
|
||||
|
||||
px4::WorkQueueManagerStart();
|
||||
|
||||
uorb_start();
|
||||
}
|
||||
Reference in New Issue
Block a user