aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLorenz Meier <lm@inf.ethz.ch>2015-01-30 09:59:50 +0100
committerLorenz Meier <lm@inf.ethz.ch>2015-02-11 07:40:58 +0100
commit8a50be65526df782b266cb995b8df29241700789 (patch)
treebf819a79963f1048c5df2ebc0c7697289c26b7bf
parentab27cd9009015fca95597f8ca2c6d4718f27d0c0 (diff)
downloadpx4-firmware-8a50be65526df782b266cb995b8df29241700789.tar.gz
px4-firmware-8a50be65526df782b266cb995b8df29241700789.tar.bz2
px4-firmware-8a50be65526df782b266cb995b8df29241700789.zip
FMUv1: board init
-rw-r--r--src/drivers/boards/px4fmu-v1/px4fmu_init.c40
1 files changed, 22 insertions, 18 deletions
diff --git a/src/drivers/boards/px4fmu-v1/px4fmu_init.c b/src/drivers/boards/px4fmu-v1/px4fmu_init.c
index c9d4cce1e..cc8e6757e 100644
--- a/src/drivers/boards/px4fmu-v1/px4fmu_init.c
+++ b/src/drivers/boards/px4fmu-v1/px4fmu_init.c
@@ -1,6 +1,6 @@
/****************************************************************************
*
- * Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
+ * Copyright (c) 2012-2015 PX4 Development Team. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
@@ -91,6 +91,10 @@ __END_DECLS
* Public Functions
****************************************************************************/
+#if defined(CONFIG_HAVE_CXX) && defined(CONFIG_HAVE_CXXINITIALIZE)
+__EXPORT extern void up_cxxinitialize();
+#endif
+
/************************************************************************************
* Name: stm32_boardinitialize
*
@@ -216,23 +220,23 @@ __EXPORT int nsh_archinitialize(void)
* Keep the SPI2 init optional and conditionally initialize the ADC pins
*/
- #ifdef CONFIG_STM32_SPI2
- spi2 = up_spiinitialize(2);
- /* Default SPI2 to 1MHz and de-assert the known chip selects. */
- SPI_SETFREQUENCY(spi2, 10000000);
- SPI_SETBITS(spi2, 8);
- SPI_SETMODE(spi2, SPIDEV_MODE3);
- SPI_SELECT(spi2, PX4_SPIDEV_GYRO, false);
- SPI_SELECT(spi2, PX4_SPIDEV_ACCEL_MAG, false);
-
- syslog(LOG_INFO, "[boot] Initialized SPI port2 (ADC IN12/13 blocked)\n");
- #else
- spi2 = NULL;
- syslog(LOG_INFO, "[boot] Enabling IN12/13 instead of SPI2\n");
- /* no SPI2, use pins for ADC */
- stm32_configgpio(GPIO_ADC1_IN12);
- stm32_configgpio(GPIO_ADC1_IN13); // jumperable to MPU6000 DRDY on some boards
- #endif
+#ifdef CONFIG_STM32_SPI2
+ spi2 = up_spiinitialize(2);
+ /* Default SPI2 to 1MHz and de-assert the known chip selects. */
+ SPI_SETFREQUENCY(spi2, 10000000);
+ SPI_SETBITS(spi2, 8);
+ SPI_SETMODE(spi2, SPIDEV_MODE3);
+ SPI_SELECT(spi2, PX4_SPIDEV_GYRO, false);
+ SPI_SELECT(spi2, PX4_SPIDEV_ACCEL_MAG, false);
+
+ syslog(LOG_INFO, "[boot] Initialized SPI port2 (ADC IN12/13 blocked)\n");
+#else
+ spi2 = NULL;
+ syslog(LOG_INFO, "[boot] Enabling IN12/13 instead of SPI2\n");
+ /* no SPI2, use pins for ADC */
+ stm32_configgpio(GPIO_ADC1_IN12);
+ stm32_configgpio(GPIO_ADC1_IN13); // jumperable to MPU6000 DRDY on some boards
+#endif
/* Get the SPI port for the microSD slot */