aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/boards/px4fmu-v2
diff options
context:
space:
mode:
authorDavid Sidrane <david_s5@nscdg.com>2015-01-22 10:41:33 -1000
committerLorenz Meier <lm@inf.ethz.ch>2015-02-11 07:40:57 +0100
commit5f8c0ba2d5c44fccff091bcf1bc9d70730c6f166 (patch)
treee9c6e1e6ddd52398e2ff78863fa771015677489a /src/drivers/boards/px4fmu-v2
parentd18e1eabfba0efaa51fadcaa6a78c8eab3cdf173 (diff)
downloadpx4-firmware-5f8c0ba2d5c44fccff091bcf1bc9d70730c6f166.tar.gz
px4-firmware-5f8c0ba2d5c44fccff091bcf1bc9d70730c6f166.tar.bz2
px4-firmware-5f8c0ba2d5c44fccff091bcf1bc9d70730c6f166.zip
Added Support for C++ static initializers
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();