made spi_init() called from mcu_init() when PERIPHERALS_AUTO_INIT is defined

This commit is contained in:
Antoine Drouin
2010-12-06 01:40:33 +01:00
parent eea4e8c6ea
commit 357a1eaa13
3 changed files with 8 additions and 18 deletions
@@ -59,17 +59,11 @@
#endif
#ifdef USE_SPI
#include "mcu_periph/spi.h"
#endif
#ifdef TRAFFIC_INFO
#include "subsystems/navigation/traffic_info.h"
#endif
#ifdef USE_USB_SERIAL
#include "usb_serial.h"
#endif
#if ! defined CATASTROPHIC_BAT_LEVEL && defined LOW_BATTERY
#warning "LOW_BATTERY deprecated. Renamed into CATASTROPHIC_BAT_LEVEL (in airframe file)"
@@ -492,9 +486,6 @@ void init_ap( void ) {
/************* Links initialization ***************/
#if defined USE_SPI
spi_init();
#endif
#if defined MCU_SPI_LINK
link_mcu_init();
#endif
@@ -35,12 +35,6 @@
#include "firmwares/fixedwing/main_fbw.h"
#include "mcu.h"
#include "led.h"
#include "mcu_periph/spi.h"
#include "mcu_periph/adc.h"
#include "sys_time.h"
#include "commands.h"
#include "firmwares/fixedwing/actuators.h"
@@ -82,7 +76,6 @@ void init_fbw( void ) {
inter_mcu_init();
#endif
#ifdef MCU_SPI_LINK
spi_init();
link_mcu_restart();
#endif
+8 -2
View File
@@ -45,6 +45,9 @@
#ifdef USE_USB_SERIAL
#include "mcu_periph/usb_serial.h"
#endif
#ifdef USE_SPI
#include "mcu_periph/spi.h"
#endif
#endif /* PERIPHERALS_AUTO_INIT */
void mcu_init(void) {
@@ -86,11 +89,14 @@ void mcu_init(void) {
#ifdef USE_I2C2
i2c2_init();
#endif
#ifdef USE_ADC
adc_init();
#endif
#ifdef USE_USB_SERIAL
VCOM_init();
#endif
#ifdef USE_ADC
adc_init();
#ifdef USE_SPI
spi_init();
#endif
#endif /* PERIPHERALS_AUTO_INIT */