mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-30 11:37:06 +08:00
made adc_init called by mcu_init when PERIPHERALS_AUTO_INIT is defined
This commit is contained in:
@@ -136,7 +136,7 @@ ns_srcs += $(SRC_ARCH)/mcu_periph/uart_arch.c
|
||||
# ANALOG
|
||||
#
|
||||
|
||||
ns_CFLAGS += -DADC
|
||||
ns_CFLAGS += -DUSE_ADC
|
||||
#ifeq ($(ARCH), lpc21)
|
||||
ns_srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
|
||||
ifeq ($(ARCH), stm32)
|
||||
|
||||
@@ -17,7 +17,7 @@ tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c
|
||||
# A test program to monitor the ADC values
|
||||
test_adcs.ARCHDIR = $(ARCH)
|
||||
|
||||
test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7
|
||||
test_adcs.CFLAGS += -DBOARD_CONFIG=$(CONFIG) -DLED -DTIME_LED=1 -DUSE_ADC -DUSE_ADC_0 -DUSE_ADC_1 -DUSE_ADC_2 -DUSE_ADC_3 -DUSE_ADC_4 -DUSE_ADC_5 -DUSE_ADC_6 -DUSE_ADC_7
|
||||
test_adcs.CFLAGS += -DDOWNLINK -DUSE_UART0 -DDOWNLINK_TRANSPORT=XBeeTransport -DDOWNLINK_FBW_DEVICE=Uart0 -DDOWNLINK_AP_DEVICE=Uart0 -DXBEE_UART=Uart0 -DDATALINK=XBEE -DUART0_BAUD=B9600
|
||||
test_adcs.srcs += downlink.c $(SRC_ARCH)/uart_hw.c xbee.c
|
||||
|
||||
|
||||
@@ -36,7 +36,6 @@
|
||||
#include "firmwares/fixedwing/main_ap.h"
|
||||
#include "mcu.h"
|
||||
|
||||
#include "mcu_periph/adc.h"
|
||||
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
|
||||
#include "firmwares/fixedwing/guidance/guidance_v.h"
|
||||
#include "gps.h"
|
||||
@@ -474,11 +473,6 @@ void init_ap( void ) {
|
||||
#ifndef SINGLE_MCU /** init done in main_fbw in single MCU */
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
|
||||
|
||||
#ifdef ADC
|
||||
adc_init();
|
||||
#endif
|
||||
#endif /* SINGLE_MCU */
|
||||
|
||||
/************* Sensors initialization ***************/
|
||||
|
||||
@@ -40,9 +40,6 @@
|
||||
#include "mcu_periph/spi.h"
|
||||
#include "mcu_periph/adc.h"
|
||||
|
||||
#ifdef USE_USB_SERIAL
|
||||
#include "usb_serial.h"
|
||||
#endif
|
||||
|
||||
#include "sys_time.h"
|
||||
#include "commands.h"
|
||||
@@ -68,13 +65,10 @@ uint8_t fbw_mode;
|
||||
|
||||
/********** INIT *************************************************************/
|
||||
void init_fbw( void ) {
|
||||
|
||||
mcu_init();
|
||||
sys_time_init();
|
||||
|
||||
#ifdef ADC
|
||||
adc_init();
|
||||
electrical_init();
|
||||
#endif /* ADC */
|
||||
|
||||
#ifdef ACTUATORS
|
||||
actuators_init();
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "generated/settings.h"
|
||||
|
||||
#include "adc.h"
|
||||
|
||||
#include "mb_modes.h"
|
||||
//#include "mb_static.h"
|
||||
@@ -54,7 +53,6 @@ static inline void main_init( void ) {
|
||||
mb_servo_init();
|
||||
mb_servo_set_range( 1090000, 1910000 );
|
||||
|
||||
adc_init();
|
||||
mb_current_init();
|
||||
mb_scale_init();
|
||||
|
||||
|
||||
@@ -111,7 +111,6 @@ static inline void main_init(void) {
|
||||
actuators_init();
|
||||
overo_link_init();
|
||||
cscp_init();
|
||||
adc_init();
|
||||
|
||||
#ifdef PASSTHROUGH_CYGNUS
|
||||
autopilot_init();
|
||||
|
||||
@@ -39,6 +39,12 @@
|
||||
#if defined USE_I2C1 || defined USE_I2C2
|
||||
#include "mcu_periph/i2c.h"
|
||||
#endif
|
||||
#if defined USE_ADC
|
||||
#include "mcu_periph/adc.h"
|
||||
#endif
|
||||
#ifdef USE_USB_SERIAL
|
||||
#include "mcu_periph/usb_serial.h"
|
||||
#endif
|
||||
#endif /* PERIPHERALS_AUTO_INIT */
|
||||
|
||||
void mcu_init(void) {
|
||||
@@ -83,6 +89,9 @@ void mcu_init(void) {
|
||||
#ifdef USE_USB_SERIAL
|
||||
VCOM_init();
|
||||
#endif
|
||||
#ifdef USE_ADC
|
||||
adc_init();
|
||||
#endif
|
||||
#endif /* PERIPHERALS_AUTO_INIT */
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user