From b4a6eb94276d0c39e71d3743ca51e5672b4ebb27 Mon Sep 17 00:00:00 2001 From: Felix Ruess Date: Tue, 22 Mar 2011 20:48:36 +0100 Subject: [PATCH] removed booz2_unsimulated_peripherals and updated nps makefile to use electrical and adc instead of battery and booz2_analog. --- .../subsystems/rotorcraft/fdm_nps.makefile | 12 ++++--- .../arch/sim/booz2_unsimulated_peripherals.c | 31 ------------------- sw/simulator/nps/nps_autopilot_booz.c | 6 ++-- 3 files changed, 10 insertions(+), 39 deletions(-) delete mode 100644 sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c diff --git a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile index 1cd8ef6246..5c0fe15c78 100644 --- a/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile +++ b/conf/autopilot/subsystems/rotorcraft/fdm_nps.makefile @@ -65,7 +65,6 @@ sim.srcs += math/pprz_trig_int.c \ sim.CFLAGS += -DBOARD_CONFIG=$(BOARD_CFG) -sim.srcs += $(SRC_BOOZ_SIM)/booz2_unsimulated_peripherals.c sim.srcs += firmwares/rotorcraft/main.c sim.srcs += mcu.c sim.srcs += $(SRC_ARCH)/mcu_arch.c @@ -90,13 +89,16 @@ sim.srcs += $(SRC_FIRMWARE)/datalink.c # -sim.CFLAGS += -DBOOZ2_ANALOG_BARO_LED=2 -DBOOZ2_ANALOG_BARO_PERIOD='SYS_TICS_OF_SEC((1./100.))' +sim.CFLAGS += -DROTORCRAFT_BARO_LED=2 sim.srcs += $(SRC_BOARD)/baro_board.c -sim.CFLAGS += -DBOOZ2_ANALOG_BATTERY_PERIOD='SYS_TICS_OF_SEC((1./10.))' -sim.srcs += $(SRC_FIRMWARE)/battery.c +sim.CFLAGS += -DUSE_ADC +sim.srcs += $(SRC_ARCH)/mcu_periph/adc_arch.c +sim.srcs += subsystems/electrical.c +# baro has variable offset amplifier on booz board +#sim.CFLAGS += -DUSE_DAC +#sim.srcs += $(SRC_ARCH)/mcu_periph/dac_arch.c -sim.srcs += $(SRC_BOOZ)/booz2_analog.c $(SRC_BOOZ_SIM)/booz2_analog_hw.c #sim.CFLAGS += -DIMU_TYPE_H=\"imu/imu_b2.h\" #sim.CFLAGS += -DIMU_B2_VERSION_1_1 diff --git a/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c b/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c deleted file mode 100644 index 5a86889e63..0000000000 --- a/sw/airborne/booz/arch/sim/booz2_unsimulated_peripherals.c +++ /dev/null @@ -1,31 +0,0 @@ -/* - * $Id$ - * - * Copyright (C) 2008-2009 Antoine Drouin - * - * This file is part of paparazzi. - * - * paparazzi is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2, or (at your option) - * any later version. - * - * paparazzi is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with paparazzi; see the file COPYING. If not, write to - * the Free Software Foundation, 59 Temple Place - Suite 330, - * Boston, MA 02111-1307, USA. - */ - -#include "mcu_periph/uart.h" -//#include "mcu_periph/i2c.h" - -void uart0_init( void ) {} -void uart1_init( void ) {} - -//void i2c0_hw_init( void ) {} -//void i2c1_hw_init( void ) {} diff --git a/sw/simulator/nps/nps_autopilot_booz.c b/sw/simulator/nps/nps_autopilot_booz.c index 80f3f0bbfd..c82a02c3bf 100644 --- a/sw/simulator/nps/nps_autopilot_booz.c +++ b/sw/simulator/nps/nps_autopilot_booz.c @@ -7,7 +7,7 @@ #include "subsystems/imu.h" #include "subsystems/sensors/baro.h" #include "baro_board.h" -#include "firmwares/rotorcraft/battery.h" +#include "subsystems/electrical.h" #include "actuators/supervision.h" @@ -25,9 +25,9 @@ void nps_autopilot_init(enum NpsRadioControlType type_rc, int num_rc_script, cha main_init(); #ifdef MAX_BAT_LEVEL - battery_voltage = MAX_BAT_LEVEL * 10; + electrical.vsupply = MAX_BAT_LEVEL * 10; #else - battery_voltage = 111; + electrical.vsupply = 111; #endif }