From c2113cdac885a28a0f23fee4a8fc85e0567c41a4 Mon Sep 17 00:00:00 2001 From: Eric Katzfey Date: Tue, 20 Feb 2024 15:59:07 -0800 Subject: [PATCH] Added special muorb startup ordering in px4_init for posix platform --- platforms/posix/src/px4/common/px4_init.cpp | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/platforms/posix/src/px4/common/px4_init.cpp b/platforms/posix/src/px4/common/px4_init.cpp index b9989a54e0..2398410192 100644 --- a/platforms/posix/src/px4/common/px4_init.cpp +++ b/platforms/posix/src/px4/common/px4_init.cpp @@ -40,15 +40,34 @@ #include #include +#if defined(CONFIG_MODULES_MUORB_APPS) +extern "C" { int muorb_init(); } +#endif + int px4_platform_init(void) { hrt_init(); px4::WorkQueueManagerStart(); +// MUORB has slightly different startup requirements +#if defined(CONFIG_MODULES_MUORB_APPS) + //Put sleeper in here to allow wq to finish initializing before param_init is called + usleep(10000); + + uorb_start(); + + muorb_init(); + + // Give muorb some time to setup the DSP + usleep(100000); + + param_init(); +#else param_init(); uorb_start(); +#endif px4_log_initialize();