diff --git a/ROMFS/px4fmu_common/init.d/4070_aerofc b/ROMFS/px4fmu_common/init.d/4070_aerofc index 47f0cbd76d..01b140b807 100644 --- a/ROMFS/px4fmu_common/init.d/4070_aerofc +++ b/ROMFS/px4fmu_common/init.d/4070_aerofc @@ -9,5 +9,6 @@ sh /etc/init.d/rc.mc_defaults tap_esc start -d /dev/ttyS0 -n 4 set OUTPUT_DEV /dev/tap_esc set MIXER quad_x +set USE_IO no set MAVLINK_F "-r 1200 -d /dev/ttyS2" diff --git a/ROMFS/px4fmu_common/init.d/rc.sensors b/ROMFS/px4fmu_common/init.d/rc.sensors index 97b5374ada..dfb783420f 100644 --- a/ROMFS/px4fmu_common/init.d/rc.sensors +++ b/ROMFS/px4fmu_common/init.d/rc.sensors @@ -253,6 +253,21 @@ then fi fi +if ver hwcmp AEROFC_V1 +then + if ms5611 start + then + fi + + if mpu6500 start + then + fi + + if hmc5883 start + then + fi +fi + if meas_airspeed start then else diff --git a/cmake/configs/nuttx_aerofc-v1_default.cmake b/cmake/configs/nuttx_aerofc-v1_default.cmake index 5ca424679b..9ac4a1cdc8 100644 --- a/cmake/configs/nuttx_aerofc-v1_default.cmake +++ b/cmake/configs/nuttx_aerofc-v1_default.cmake @@ -10,7 +10,7 @@ set(config_module_list drivers/stm32 drivers/stm32/adc drivers/led - #drivers/px4fmu + drivers/px4fmu drivers/boards/aerofc-v1 drivers/tap_esc drivers/mpu6500 @@ -18,6 +18,8 @@ set(config_module_list drivers/hmc5883 drivers/gps modules/sensors + # dummy tone alarm + modules/dummy # # System commands @@ -49,6 +51,9 @@ set(config_module_list # # Estimation modules (EKF/ SO3 / other filters) # + modules/attitude_estimator_q + modules/position_estimator_inav + modules/local_position_estimator modules/ekf2 # @@ -90,6 +95,7 @@ set(config_module_list lib/runway_takeoff lib/tailsitter_recovery lib/DriverFramework/framework + lib/rc platforms/nuttx # had to add for cmake, not sure why wasn't in original config diff --git a/src/drivers/boards/aerofc-v1/CMakeLists.txt b/src/drivers/boards/aerofc-v1/CMakeLists.txt index a257fa3ccc..de093bbe97 100644 --- a/src/drivers/boards/aerofc-v1/CMakeLists.txt +++ b/src/drivers/boards/aerofc-v1/CMakeLists.txt @@ -40,6 +40,7 @@ px4_add_module( aerofc_spi.c aerofc_usb.c aerofc_led.c + aerofc_timer_config.c DEPENDS platforms__common ) diff --git a/src/drivers/boards/aerofc-v1/aerofc_timer_config.c b/src/drivers/boards/aerofc-v1/aerofc_timer_config.c new file mode 100644 index 0000000000..9506f8cf03 --- /dev/null +++ b/src/drivers/boards/aerofc-v1/aerofc_timer_config.c @@ -0,0 +1,65 @@ +/**************************************************************************** + * + * Copyright (c) 2012-2016 PX4 Development Team. All rights reserved. + * Author: David Sidrane + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * 3. Neither the name PX4 nor the names of its contributors may be + * used to endorse or promote products derived from this software + * without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, + * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS + * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED + * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN + * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGE. + * + ****************************************************************************/ + +/* + * @file tap-v1_timer_config.c + * + * Configuration data for the stm32 pwm_servo, input capture and pwm input driver. + * + * Note that these arrays must always be fully-sized. + */ + +#include + +#include +#include +#include + +#include +#include + +#include "board_config.h" + + +// Invalidate all timers (base == 0): we don't have any +__EXPORT const io_timers_t io_timers[MAX_IO_TIMERS] = { }; + +// Invalidate all channels (timer_channel == 0): we don't have any +__EXPORT const timer_io_channels_t timer_io_channels[MAX_TIMER_IO_CHANNELS] = { }; + +// Invalidate all timers (base == 0): we don't have any +__EXPORT const struct io_timers_t led_pwm_timers[1] = { }; + +// Invalidate all channels (timer_channel == 0): we don't have any +__EXPORT const struct timer_io_channels_t led_pwm_channels[3] = { }; diff --git a/src/drivers/boards/aerofc-v1/board_config.h b/src/drivers/boards/aerofc-v1/board_config.h index a215deda3d..9f7a3e04c4 100644 --- a/src/drivers/boards/aerofc-v1/board_config.h +++ b/src/drivers/boards/aerofc-v1/board_config.h @@ -107,21 +107,10 @@ #define ADC_BATTERY_VOLTAGE_CHANNEL 0 #define ADC_BATTERY_CURRENT_CHANNEL ((uint8_t)(-1)) -/* - * PWM - * - * Four PWM outputs can be configured on pins - * - * - * Peripheral Port Signal Name CONN - * TIM3_CH1 PA6 LED_R JP2-23,24 - * TIM3_CH2 PA7 LED_G JP2-25,26 - * TIM3_CH3 PB0 LED_B JP2-27,28 - * TIM3_CH4 PB1 nPWM_1 AUX1(Landing Gear) JP1-21,22 - * - */ -#define DIRECT_PWM_OUTPUT_CHANNELS 0 -#define BOARD_HAS_PWM DIRECT_PWM_OUTPUT_CHANNELS +#define DIRECT_PWM_OUTPUT_CHANNELS 1 +#define BOARD_HAS_PWM 0 + +#define BOARD_FMU_GPIO_TAB {{0, 0, 0}} /* USB OTG FS * diff --git a/src/drivers/px4fmu/fmu.cpp b/src/drivers/px4fmu/fmu.cpp index b0d68380d9..ed82756f5b 100644 --- a/src/drivers/px4fmu/fmu.cpp +++ b/src/drivers/px4fmu/fmu.cpp @@ -2255,6 +2255,10 @@ PX4FMU::write(file *filp, const char *buffer, size_t len) unsigned count = len / 2; uint16_t values[8]; +#if BOARD_HAS_PWM == 0 + return 0; +#endif + if (count > BOARD_HAS_PWM) { // we have at most BOARD_HAS_PWM outputs count = BOARD_HAS_PWM; diff --git a/src/drivers/tap_esc/tap_esc.cpp b/src/drivers/tap_esc/tap_esc.cpp index 661251a629..54c244b2fa 100644 --- a/src/drivers/tap_esc/tap_esc.cpp +++ b/src/drivers/tap_esc/tap_esc.cpp @@ -262,6 +262,9 @@ TAP_ESC::init() return ret; } +#ifdef CONFIG_ARCH_BOARD_AEROFC_V1 +#else + /* Verify All ESC got the config */ for (uint8_t cid = 0; cid < _channels_count; cid++) { @@ -304,8 +307,11 @@ TAP_ESC::init() if (!valid) { return -EIO; } + } +#endif + /* To Unlock the ESC from the Power up state we need to issue 10 * ESCBUS_MSG_ID_RUN request with all the values 0; */