aboutsummaryrefslogtreecommitdiff
path: root/src/drivers/boards/aerocore/aerocore_init.c
diff options
context:
space:
mode:
authorThomas Gubler <thomasgubler@gmail.com>2015-01-26 13:47:24 +0100
committerThomas Gubler <thomasgubler@gmail.com>2015-01-26 13:47:24 +0100
commitd381a5e82bcdd601ef7b361b7038bc5862840312 (patch)
treec4de6814f44ab68b28d807e230a867a07ca407b4 /src/drivers/boards/aerocore/aerocore_init.c
parenta6e15f771edc648ecf9437d9ccde986e773f15cb (diff)
parentb1b1ad9393add9294d800e533b0b6201c3b70aa5 (diff)
downloadpx4-firmware-d381a5e82bcdd601ef7b361b7038bc5862840312.tar.gz
px4-firmware-d381a5e82bcdd601ef7b361b7038bc5862840312.tar.bz2
px4-firmware-d381a5e82bcdd601ef7b361b7038bc5862840312.zip
Merge remote-tracking branch 'upstream/nuttx_bringup' into ros_messagelayer_merge_attctl_functionptr_nuttx_bringup
Conflicts: NuttX makefiles/config_px4fmu-v2_default.mk
Diffstat (limited to 'src/drivers/boards/aerocore/aerocore_init.c')
-rw-r--r--src/drivers/boards/aerocore/aerocore_init.c25
1 files changed, 20 insertions, 5 deletions
diff --git a/src/drivers/boards/aerocore/aerocore_init.c b/src/drivers/boards/aerocore/aerocore_init.c
index 1ce235da8..91dbe4b81 100644
--- a/src/drivers/boards/aerocore/aerocore_init.c
+++ b/src/drivers/boards/aerocore/aerocore_init.c
@@ -53,11 +53,11 @@
#include <errno.h>
#include <nuttx/arch.h>
-#include <nuttx/spi.h>
+#include <nuttx/spi/spi.h>
#include <nuttx/i2c.h>
#include <nuttx/mmcsd.h>
#include <nuttx/analog/adc.h>
-#include <nuttx/gran.h>
+#include <nuttx/mm/gran.h>
#include <stm32.h>
#include "board_config.h"
@@ -191,7 +191,7 @@ stm32_boardinitialize(void)
stm32_spiinitialize();
/* configure LEDs */
- up_ledinit();
+ board_led_initialize();
}
/****************************************************************************
@@ -228,6 +228,21 @@ __EXPORT int nsh_archinitialize(void)
stm32_configgpio(GPIO_ADC1_IN12); /* J1 breakout */
stm32_configgpio(GPIO_ADC1_IN13); /* J1 breakout */
+#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
+
+ /* run C++ ctors before we go any further */
+
+ up_cxxinitialize();
+
+# if defined(CONFIG_EXAMPLES_NSH_CXXINITIALIZE)
+# error CONFIG_EXAMPLES_NSH_CXXINITIALIZE Must not be defined! Use CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE.
+# endif
+
+#else
+# error platform is dependent on c++ both CONFIG_HAVE_CXX and CONFIG_HAVE_CXXINITIALIZE must be defined.
+#endif
+
+
/* configure the high-resolution time/callout interface */
hrt_init();
@@ -264,7 +279,7 @@ __EXPORT int nsh_archinitialize(void)
spi3 = up_spiinitialize(3);
if (!spi3) {
message("[boot] FAILED to initialize SPI port 3\n");
- up_ledon(LED_AMBER);
+ board_led_on(LED_AMBER);
return -ENODEV;
}
/* Default: 1MHz, 8 bits, Mode 3 */
@@ -281,7 +296,7 @@ __EXPORT int nsh_archinitialize(void)
spi4 = up_spiinitialize(4);
if (!spi4) {
message("[boot] FAILED to initialize SPI port 4\n");
- up_ledon(LED_AMBER);
+ board_led_on(LED_AMBER);
return -ENODEV;
}
/* Default: ~10MHz, 8 bits, Mode 3 */