mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-16 03:43:33 +08:00
Pull v2 pieces up to build with the merge
This commit is contained in:
@@ -15,10 +15,10 @@ SRCS = adc.c \
|
||||
../systemlib/mixer/mixer_multirotor.cpp \
|
||||
../systemlib/mixer/mixer_simple.cpp \
|
||||
|
||||
ifeq ($(BOARD),px4io)
|
||||
ifeq ($(BOARD),px4io-v1)
|
||||
SRCS += i2c.c
|
||||
endif
|
||||
ifeq ($(BOARD),px4iov2)
|
||||
ifeq ($(BOARD),px4io-v2)
|
||||
SRCS += serial.c \
|
||||
../systemlib/hx_stream.c
|
||||
endif
|
||||
|
||||
@@ -42,10 +42,10 @@
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IO
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IO_V1
|
||||
# include <drivers/boards/px4io/px4io_internal.h>
|
||||
#endif
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IOV2
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IO_V2
|
||||
# include <drivers/boards/px4iov2/px4iov2_internal.h>
|
||||
#endif
|
||||
|
||||
@@ -129,18 +129,7 @@ extern struct sys_state_s system_state;
|
||||
#define LED_AMBER(_s) stm32_gpiowrite(GPIO_LED2, !(_s))
|
||||
#define LED_SAFETY(_s) stm32_gpiowrite(GPIO_LED3, !(_s))
|
||||
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IOV2
|
||||
|
||||
# define PX4IO_RELAY_CHANNELS 0
|
||||
# define POWER_SPEKTRUM(_s) stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_s))
|
||||
|
||||
# define VDD_SERVO_FAULT (!stm32_gpioread(GPIO_SERVO_FAULT_DETECT))
|
||||
|
||||
# define PX4IO_ADC_CHANNEL_COUNT 2
|
||||
# define ADC_VSERVO 4
|
||||
# define ADC_RSSI 5
|
||||
|
||||
#else /* CONFIG_ARCH_BOARD_PX4IOV1 */
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IO_V1
|
||||
|
||||
# define PX4IO_RELAY_CHANNELS 4
|
||||
# define POWER_SERVO(_s) stm32_gpiowrite(GPIO_SERVO_PWR_EN, (_s))
|
||||
@@ -158,6 +147,19 @@ extern struct sys_state_s system_state;
|
||||
|
||||
#endif
|
||||
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IO_V2
|
||||
|
||||
# define PX4IO_RELAY_CHANNELS 0
|
||||
# define POWER_SPEKTRUM(_s) stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_s))
|
||||
|
||||
# define VDD_SERVO_FAULT (!stm32_gpioread(GPIO_SERVO_FAULT_DETECT))
|
||||
|
||||
# define PX4IO_ADC_CHANNEL_COUNT 2
|
||||
# define ADC_VSERVO 4
|
||||
# define ADC_RSSI 5
|
||||
|
||||
#endif
|
||||
|
||||
#define BUTTON_SAFETY stm32_gpioread(GPIO_BTN_SAFETY)
|
||||
|
||||
/*
|
||||
|
||||
@@ -59,7 +59,7 @@ static void pwm_configure_rates(uint16_t map, uint16_t defaultrate, uint16_t alt
|
||||
*/
|
||||
static const uint16_t r_page_config[] = {
|
||||
[PX4IO_P_CONFIG_PROTOCOL_VERSION] = PX4IO_PROTOCOL_VERSION,
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IOV2
|
||||
#ifdef CONFIG_ARCH_BOARD_PX4IO_V2
|
||||
[PX4IO_P_CONFIG_HARDWARE_VERSION] = 2,
|
||||
#else
|
||||
[PX4IO_P_CONFIG_HARDWARE_VERSION] = 1,
|
||||
|
||||
@@ -50,7 +50,7 @@
|
||||
#include <chip.h>
|
||||
#include <up_internal.h>
|
||||
#include <up_arch.h>
|
||||
#include <stm32_internal.h>
|
||||
#include <stm32.h>
|
||||
#include <systemlib/perf_counter.h>
|
||||
|
||||
//#define DEBUG
|
||||
|
||||
Reference in New Issue
Block a user