diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2015-01-30 09:59:50 +0100 |
---|---|---|
committer | David Sidrane <david_s5@nscdg.com> | 2015-04-07 07:18:45 -1000 |
commit | 9618a464f6f836ea3b0c2d1c2af416cb9bc8375b (patch) | |
tree | 9aa77d244218c6422f28056adf544cab4fb31d31 /src/drivers/boards/px4fmu-v1/px4fmu_init.c | |
parent | d7cdf089fa92ef140341811625e3504df4d1259d (diff) | |
download | px4-firmware-9618a464f6f836ea3b0c2d1c2af416cb9bc8375b.tar.gz px4-firmware-9618a464f6f836ea3b0c2d1c2af416cb9bc8375b.tar.bz2 px4-firmware-9618a464f6f836ea3b0c2d1c2af416cb9bc8375b.zip |
FMUv1: board init
Diffstat (limited to 'src/drivers/boards/px4fmu-v1/px4fmu_init.c')
-rw-r--r-- | src/drivers/boards/px4fmu-v1/px4fmu_init.c | 40 |
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 */ |