aerofc: Fixes for init

This commit is contained in:
James Goppert 2016-09-12 17:10:55 -07:00 committed by Lorenz Meier
parent 15c75ebb40
commit 893714dc6a
8 changed files with 103 additions and 16 deletions

View File

@ -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"

View File

@ -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

View File

@ -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

View File

@ -40,6 +40,7 @@ px4_add_module(
aerofc_spi.c
aerofc_usb.c
aerofc_led.c
aerofc_timer_config.c
DEPENDS
platforms__common
)

View File

@ -0,0 +1,65 @@
/****************************************************************************
*
* Copyright (c) 2012-2016 PX4 Development Team. All rights reserved.
* Author: David Sidrane <david_s5@nscdg.com>
*
* 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 <stdint.h>
#include <stm32.h>
#include <stm32_gpio.h>
#include <stm32_tim.h>
#include <drivers/drv_pwm_output.h>
#include <drivers/stm32/drv_io_timer.h>
#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] = { };

View File

@ -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
*

View File

@ -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;

View File

@ -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;
*/