aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/boards/px4fmu-v2
diff options
context:
space:
mode:
Diffstat (limited to 'src/drivers/boards/px4fmu-v2')
-rw-r--r--src/drivers/boards/px4fmu-v2/module.mk7
-rw-r--r--src/drivers/boards/px4fmu-v2/px4fmu2_init.c8
2 files changed, 15 insertions, 0 deletions
diff --git a/src/drivers/boards/px4fmu-v2/module.mk b/src/drivers/boards/px4fmu-v2/module.mk
index 103232b0c..e62e48e99 100644
--- a/src/drivers/boards/px4fmu-v2/module.mk
+++ b/src/drivers/boards/px4fmu-v2/module.mk
@@ -9,4 +9,11 @@ SRCS = px4fmu_can.c \
px4fmu_usb.c \
px4fmu2_led.c
+
+ENABLE_CXXINITIALIZE=$(call check_nuttx_config ,"CONFIG_HAVE_CXX 1", $(NUTTX_CONFIG_H))
+ENABLE_CXXINITIALIZE+=$(call check_nuttx_config ,"CONFIG_HAVE_CXXINITIALIZE 1", $(NUTTX_CONFIG_H))
+ifeq ("$(ENABLE_CXXINITIALIZE)",$(nuttx_config_2true))
+SRCS += ../../../modules/systemlib/up_cxxinitialize.c
+endif
+
MAXOPTIMIZATION = -Os
diff --git a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c
index 36ef53e2a..7fc1cd1df 100644
--- a/src/drivers/boards/px4fmu-v2/px4fmu2_init.c
+++ b/src/drivers/boards/px4fmu-v2/px4fmu2_init.c
@@ -239,6 +239,14 @@ __EXPORT int nsh_archinitialize(void)
stm32_configgpio(GPIO_VDD_5V_HIPOWER_OC);
stm32_configgpio(GPIO_VDD_5V_PERIPH_OC);
+#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
+
+ /* run C++ ctors before we go any further */
+
+ up_cxxinitialize();
+
+#endif
+
/* configure the high-resolution time/callout interface */
hrt_init();