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
|
# ANALOG
|
||||||
#
|
#
|
||||||
|
|
||||||
ns_CFLAGS += -DADC
|
ns_CFLAGS += -DUSE_ADC
|
||||||
#ifeq ($(ARCH), lpc21)
|
#ifeq ($(ARCH), lpc21)
|
||||||
ns_srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
|
ns_srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c
|
||||||
ifeq ($(ARCH), stm32)
|
ifeq ($(ARCH), stm32)
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ tunnel.srcs += $(SRC_ARCH)/uart_tunnel.c
|
|||||||
# A test program to monitor the ADC values
|
# A test program to monitor the ADC values
|
||||||
test_adcs.ARCHDIR = $(ARCH)
|
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.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
|
test_adcs.srcs += downlink.c $(SRC_ARCH)/uart_hw.c xbee.c
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,6 @@
|
|||||||
#include "firmwares/fixedwing/main_ap.h"
|
#include "firmwares/fixedwing/main_ap.h"
|
||||||
#include "mcu.h"
|
#include "mcu.h"
|
||||||
|
|
||||||
#include "mcu_periph/adc.h"
|
|
||||||
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
|
#include "firmwares/fixedwing/stabilization/stabilization_attitude.h"
|
||||||
#include "firmwares/fixedwing/guidance/guidance_v.h"
|
#include "firmwares/fixedwing/guidance/guidance_v.h"
|
||||||
#include "gps.h"
|
#include "gps.h"
|
||||||
@@ -474,11 +473,6 @@ void init_ap( void ) {
|
|||||||
#ifndef SINGLE_MCU /** init done in main_fbw in single MCU */
|
#ifndef SINGLE_MCU /** init done in main_fbw in single MCU */
|
||||||
mcu_init();
|
mcu_init();
|
||||||
sys_time_init();
|
sys_time_init();
|
||||||
|
|
||||||
|
|
||||||
#ifdef ADC
|
|
||||||
adc_init();
|
|
||||||
#endif
|
|
||||||
#endif /* SINGLE_MCU */
|
#endif /* SINGLE_MCU */
|
||||||
|
|
||||||
/************* Sensors initialization ***************/
|
/************* Sensors initialization ***************/
|
||||||
|
|||||||
@@ -40,9 +40,6 @@
|
|||||||
#include "mcu_periph/spi.h"
|
#include "mcu_periph/spi.h"
|
||||||
#include "mcu_periph/adc.h"
|
#include "mcu_periph/adc.h"
|
||||||
|
|
||||||
#ifdef USE_USB_SERIAL
|
|
||||||
#include "usb_serial.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include "sys_time.h"
|
#include "sys_time.h"
|
||||||
#include "commands.h"
|
#include "commands.h"
|
||||||
@@ -68,13 +65,10 @@ uint8_t fbw_mode;
|
|||||||
|
|
||||||
/********** INIT *************************************************************/
|
/********** INIT *************************************************************/
|
||||||
void init_fbw( void ) {
|
void init_fbw( void ) {
|
||||||
|
|
||||||
mcu_init();
|
mcu_init();
|
||||||
sys_time_init();
|
sys_time_init();
|
||||||
|
|
||||||
#ifdef ADC
|
|
||||||
adc_init();
|
|
||||||
electrical_init();
|
electrical_init();
|
||||||
#endif /* ADC */
|
|
||||||
|
|
||||||
#ifdef ACTUATORS
|
#ifdef ACTUATORS
|
||||||
actuators_init();
|
actuators_init();
|
||||||
|
|||||||
@@ -18,7 +18,6 @@
|
|||||||
|
|
||||||
#include "generated/settings.h"
|
#include "generated/settings.h"
|
||||||
|
|
||||||
#include "adc.h"
|
|
||||||
|
|
||||||
#include "mb_modes.h"
|
#include "mb_modes.h"
|
||||||
//#include "mb_static.h"
|
//#include "mb_static.h"
|
||||||
@@ -54,7 +53,6 @@ static inline void main_init( void ) {
|
|||||||
mb_servo_init();
|
mb_servo_init();
|
||||||
mb_servo_set_range( 1090000, 1910000 );
|
mb_servo_set_range( 1090000, 1910000 );
|
||||||
|
|
||||||
adc_init();
|
|
||||||
mb_current_init();
|
mb_current_init();
|
||||||
mb_scale_init();
|
mb_scale_init();
|
||||||
|
|
||||||
|
|||||||
@@ -111,7 +111,6 @@ static inline void main_init(void) {
|
|||||||
actuators_init();
|
actuators_init();
|
||||||
overo_link_init();
|
overo_link_init();
|
||||||
cscp_init();
|
cscp_init();
|
||||||
adc_init();
|
|
||||||
|
|
||||||
#ifdef PASSTHROUGH_CYGNUS
|
#ifdef PASSTHROUGH_CYGNUS
|
||||||
autopilot_init();
|
autopilot_init();
|
||||||
|
|||||||
@@ -39,6 +39,12 @@
|
|||||||
#if defined USE_I2C1 || defined USE_I2C2
|
#if defined USE_I2C1 || defined USE_I2C2
|
||||||
#include "mcu_periph/i2c.h"
|
#include "mcu_periph/i2c.h"
|
||||||
#endif
|
#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 */
|
#endif /* PERIPHERALS_AUTO_INIT */
|
||||||
|
|
||||||
void mcu_init(void) {
|
void mcu_init(void) {
|
||||||
@@ -83,6 +89,9 @@ void mcu_init(void) {
|
|||||||
#ifdef USE_USB_SERIAL
|
#ifdef USE_USB_SERIAL
|
||||||
VCOM_init();
|
VCOM_init();
|
||||||
#endif
|
#endif
|
||||||
|
#ifdef USE_ADC
|
||||||
|
adc_init();
|
||||||
|
#endif
|
||||||
#endif /* PERIPHERALS_AUTO_INIT */
|
#endif /* PERIPHERALS_AUTO_INIT */
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user