mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-30 04:06:33 +08:00
Merge branch 'public-export-build' into fmuv2_bringup
This commit is contained in:
@@ -38,7 +38,6 @@
|
|||||||
# Sub-directories
|
# Sub-directories
|
||||||
|
|
||||||
SUBDIRS = adc can cdcacm nsh
|
SUBDIRS = adc can cdcacm nsh
|
||||||
SUBDIRS += math_demo control_demo kalman_demo px4_deamon_app
|
|
||||||
|
|
||||||
#SUBDIRS = adc buttons can cdcacm composite cxxtest dhcpd discover elf ftpc
|
#SUBDIRS = adc buttons can cdcacm composite cxxtest dhcpd discover elf ftpc
|
||||||
#SUBDIRS += ftpd hello helloxx hidkbd igmp json keypadtest lcdrw mm modbus mount
|
#SUBDIRS += ftpd hello helloxx hidkbd igmp json keypadtest lcdrw mm modbus mount
|
||||||
|
|||||||
@@ -116,7 +116,5 @@ endef
|
|||||||
|
|
||||||
# command priority stack entrypoint
|
# command priority stack entrypoint
|
||||||
BUILTIN_COMMANDS := \
|
BUILTIN_COMMANDS := \
|
||||||
$(call _B, math_demo, , 8192, math_demo_main ) \
|
|
||||||
$(call _B, sercon, , 2048, sercon_main ) \
|
$(call _B, sercon, , 2048, sercon_main ) \
|
||||||
$(call _B, serdis, , 2048, serdis_main ) \
|
$(call _B, serdis, , 2048, serdis_main )
|
||||||
$(call _B, uorb, , 4096, uorb_main )
|
|
||||||
|
|||||||
@@ -59,9 +59,6 @@ export INCLUDE_DIRS := $(PX4_MODULE_SRC) \
|
|||||||
$(PX4_MODULE_SRC)/modules/ \
|
$(PX4_MODULE_SRC)/modules/ \
|
||||||
$(PX4_INCLUDE_DIR)
|
$(PX4_INCLUDE_DIR)
|
||||||
|
|
||||||
# Include from legacy app/library path
|
|
||||||
export INCLUDE_DIRS += $(NUTTX_APP_SRC)
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# Tools
|
# Tools
|
||||||
#
|
#
|
||||||
|
|||||||
@@ -100,12 +100,19 @@
|
|||||||
* Some of the USART pins are not available; override the GPIO
|
* Some of the USART pins are not available; override the GPIO
|
||||||
* definitions with an invalid pin configuration.
|
* definitions with an invalid pin configuration.
|
||||||
*/
|
*/
|
||||||
|
#undef GPIO_USART2_CTS
|
||||||
#define GPIO_USART2_CTS 0xffffffff
|
#define GPIO_USART2_CTS 0xffffffff
|
||||||
|
#undef GPIO_USART2_RTS
|
||||||
#define GPIO_USART2_RTS 0xffffffff
|
#define GPIO_USART2_RTS 0xffffffff
|
||||||
|
#undef GPIO_USART2_CK
|
||||||
#define GPIO_USART2_CK 0xffffffff
|
#define GPIO_USART2_CK 0xffffffff
|
||||||
|
#undef GPIO_USART3_TX
|
||||||
#define GPIO_USART3_TX 0xffffffff
|
#define GPIO_USART3_TX 0xffffffff
|
||||||
|
#undef GPIO_USART3_CK
|
||||||
#define GPIO_USART3_CK 0xffffffff
|
#define GPIO_USART3_CK 0xffffffff
|
||||||
|
#undef GPIO_USART3_CTS
|
||||||
#define GPIO_USART3_CTS 0xffffffff
|
#define GPIO_USART3_CTS 0xffffffff
|
||||||
|
#undef GPIO_USART3_RTS
|
||||||
#define GPIO_USART3_RTS 0xffffffff
|
#define GPIO_USART3_RTS 0xffffffff
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -157,5 +164,9 @@ extern "C" {
|
|||||||
|
|
||||||
EXTERN void stm32_boardinitialize(void);
|
EXTERN void stm32_boardinitialize(void);
|
||||||
|
|
||||||
|
#if defined(__cplusplus)
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif /* __ASSEMBLY__ */
|
#endif /* __ASSEMBLY__ */
|
||||||
#endif /* __ARCH_BOARD_BOARD_H */
|
#endif /* __ARCH_BOARD_BOARD_H */
|
||||||
|
|||||||
@@ -30,11 +30,3 @@
|
|||||||
# POSSIBILITY OF SUCH DAMAGE.
|
# POSSIBILITY OF SUCH DAMAGE.
|
||||||
#
|
#
|
||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
CONFIGURED_APPS += drivers/boards/px4io
|
|
||||||
CONFIGURED_APPS += drivers/stm32
|
|
||||||
|
|
||||||
CONFIGURED_APPS += px4io
|
|
||||||
|
|
||||||
# Mixer library from systemlib
|
|
||||||
CONFIGURED_APPS += systemlib/mixer
|
|
||||||
|
|||||||
@@ -86,9 +86,17 @@ __EXPORT void stm32_boardinitialize(void)
|
|||||||
stm32_configgpio(GPIO_SERVO_PWR_EN);
|
stm32_configgpio(GPIO_SERVO_PWR_EN);
|
||||||
stm32_configgpio(GPIO_RELAY1_EN);
|
stm32_configgpio(GPIO_RELAY1_EN);
|
||||||
stm32_configgpio(GPIO_RELAY2_EN);
|
stm32_configgpio(GPIO_RELAY2_EN);
|
||||||
|
|
||||||
|
/* turn off - all leds are active low */
|
||||||
|
stm32_gpiowrite(GPIO_LED1, true);
|
||||||
|
stm32_gpiowrite(GPIO_LED2, true);
|
||||||
|
stm32_gpiowrite(GPIO_LED3, true);
|
||||||
|
|
||||||
|
/* LED config */
|
||||||
stm32_configgpio(GPIO_LED1);
|
stm32_configgpio(GPIO_LED1);
|
||||||
stm32_configgpio(GPIO_LED2);
|
stm32_configgpio(GPIO_LED2);
|
||||||
stm32_configgpio(GPIO_LED3);
|
stm32_configgpio(GPIO_LED3);
|
||||||
|
|
||||||
stm32_configgpio(GPIO_ACC_OC_DETECT);
|
stm32_configgpio(GPIO_ACC_OC_DETECT);
|
||||||
stm32_configgpio(GPIO_SERVO_OC_DETECT);
|
stm32_configgpio(GPIO_SERVO_OC_DETECT);
|
||||||
stm32_configgpio(GPIO_BTN_SAFETY);
|
stm32_configgpio(GPIO_BTN_SAFETY);
|
||||||
|
|||||||
@@ -32,7 +32,9 @@
|
|||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @file PX4IO hardware definitions.
|
* @file px4io_internal.h
|
||||||
|
*
|
||||||
|
* PX4IO hardware definitions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
#
|
#
|
||||||
# Copyright (C) 2012 PX4 Development Team. All rights reserved.
|
# Copyright (c) 2012, 2013 PX4 Development Team. All rights reserved.
|
||||||
#
|
#
|
||||||
# Redistribution and use in source and binary forms, with or without
|
# Redistribution and use in source and binary forms, with or without
|
||||||
# modification, are permitted provided that the following conditions
|
# modification, are permitted provided that the following conditions
|
||||||
@@ -32,7 +32,7 @@
|
|||||||
############################################################################
|
############################################################################
|
||||||
|
|
||||||
#
|
#
|
||||||
# Makefile to build the LED driver.
|
# Build the LED driver.
|
||||||
#
|
#
|
||||||
|
|
||||||
include $(APPDIR)/mk/app.mk
|
SRCS = led.cpp
|
||||||
@@ -288,8 +288,8 @@ controls_tick() {
|
|||||||
r_status_flags |= PX4IO_P_STATUS_FLAGS_OVERRIDE;
|
r_status_flags |= PX4IO_P_STATUS_FLAGS_OVERRIDE;
|
||||||
|
|
||||||
/* mix new RC input control values to servos */
|
/* mix new RC input control values to servos */
|
||||||
if (dsm_updated || sbus_updated || ppm_updated)
|
//if (dsm_updated || sbus_updated || ppm_updated)
|
||||||
mixer_tick();
|
// mixer_tick();
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
r_status_flags &= ~PX4IO_P_STATUS_FLAGS_OVERRIDE;
|
r_status_flags &= ~PX4IO_P_STATUS_FLAGS_OVERRIDE;
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ SRCS = adc.c \
|
|||||||
registers.c \
|
registers.c \
|
||||||
safety.c \
|
safety.c \
|
||||||
sbus.c \
|
sbus.c \
|
||||||
mixer.cpp \
|
|
||||||
../systemlib/mixer/mixer.cpp \
|
|
||||||
../systemlib/mixer/mixer_group.cpp \
|
|
||||||
../systemlib/mixer/mixer_multirotor.cpp \
|
|
||||||
../systemlib/mixer/mixer_simple.cpp \
|
|
||||||
../systemlib/up_cxxinitialize.c \
|
../systemlib/up_cxxinitialize.c \
|
||||||
../systemlib/hx_stream.c \
|
../systemlib/hx_stream.c \
|
||||||
../systemlib/perf_counter.c
|
../systemlib/perf_counter.c
|
||||||
|
|
||||||
|
# mixer.cpp \
|
||||||
|
# ../systemlib/mixer/mixer.cpp \
|
||||||
|
# ../systemlib/mixer/mixer_group.cpp \
|
||||||
|
# ../systemlib/mixer/mixer_multirotor.cpp \
|
||||||
|
# ../systemlib/mixer/mixer_simple.cpp \
|
||||||
@@ -64,8 +64,10 @@ struct sys_state_s system_state;
|
|||||||
|
|
||||||
static struct hrt_call serial_dma_call;
|
static struct hrt_call serial_dma_call;
|
||||||
|
|
||||||
|
#ifdef CONFIG_STM32_I2C1
|
||||||
/* store i2c reset count XXX this should be a register, together with other error counters */
|
/* store i2c reset count XXX this should be a register, together with other error counters */
|
||||||
volatile uint32_t i2c_loop_resets = 0;
|
volatile uint32_t i2c_loop_resets = 0;
|
||||||
|
#endif
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* a set of debug buffers to allow us to send debug information from ISRs
|
* a set of debug buffers to allow us to send debug information from ISRs
|
||||||
@@ -133,7 +135,9 @@ user_start(int argc, char *argv[])
|
|||||||
* Poll at 1ms intervals for received bytes that have not triggered
|
* Poll at 1ms intervals for received bytes that have not triggered
|
||||||
* a DMA event.
|
* a DMA event.
|
||||||
*/
|
*/
|
||||||
|
#ifdef CONFIG_ARCH_DMA
|
||||||
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
hrt_call_every(&serial_dma_call, 1000, 1000, (hrt_callout)stm32_serial_dma_poll, NULL);
|
||||||
|
#endif
|
||||||
|
|
||||||
/* print some startup info */
|
/* print some startup info */
|
||||||
lowsyslog("\nPX4IO: starting\n");
|
lowsyslog("\nPX4IO: starting\n");
|
||||||
@@ -155,8 +159,10 @@ user_start(int argc, char *argv[])
|
|||||||
/* initialise the control inputs */
|
/* initialise the control inputs */
|
||||||
controls_init();
|
controls_init();
|
||||||
|
|
||||||
|
#ifdef CONFIG_STM32_I2C1
|
||||||
/* start the i2c handler */
|
/* start the i2c handler */
|
||||||
i2c_init();
|
i2c_init();
|
||||||
|
#endif
|
||||||
|
|
||||||
/* add a performance counter for mixing */
|
/* add a performance counter for mixing */
|
||||||
perf_counter_t mixer_perf = perf_alloc(PC_ELAPSED, "mix");
|
perf_counter_t mixer_perf = perf_alloc(PC_ELAPSED, "mix");
|
||||||
@@ -201,7 +207,7 @@ user_start(int argc, char *argv[])
|
|||||||
|
|
||||||
/* kick the mixer */
|
/* kick the mixer */
|
||||||
perf_begin(mixer_perf);
|
perf_begin(mixer_perf);
|
||||||
mixer_tick();
|
// mixer_tick();
|
||||||
perf_end(mixer_perf);
|
perf_end(mixer_perf);
|
||||||
|
|
||||||
/* kick the control inputs */
|
/* kick the control inputs */
|
||||||
|
|||||||
@@ -124,10 +124,18 @@ extern struct sys_state_s system_state;
|
|||||||
#define LED_SAFETY(_s) stm32_gpiowrite(GPIO_LED3, !(_s))
|
#define LED_SAFETY(_s) stm32_gpiowrite(GPIO_LED3, !(_s))
|
||||||
|
|
||||||
#define POWER_SERVO(_s) stm32_gpiowrite(GPIO_SERVO_PWR_EN, (_s))
|
#define POWER_SERVO(_s) stm32_gpiowrite(GPIO_SERVO_PWR_EN, (_s))
|
||||||
#define POWER_ACC1(_s) stm32_gpiowrite(GPIO_ACC1_PWR_EN, (_s))
|
#ifdef GPIO_ACC1_PWR_EN
|
||||||
#define POWER_ACC2(_s) stm32_gpiowrite(GPIO_ACC2_PWR_EN, (_s))
|
#define POWER_ACC1(_s) stm32_gpiowrite(GPIO_ACC1_PWR_EN, (_s))
|
||||||
#define POWER_RELAY1(_s) stm32_gpiowrite(GPIO_RELAY1_EN, (_s))
|
#endif
|
||||||
#define POWER_RELAY2(_s) stm32_gpiowrite(GPIO_RELAY2_EN, (_s))
|
#ifdef GPIO_ACC2_PWR_EN
|
||||||
|
#define POWER_ACC2(_s) stm32_gpiowrite(GPIO_ACC2_PWR_EN, (_s))
|
||||||
|
#endif
|
||||||
|
#ifdef GPIO_RELAY1_EN
|
||||||
|
#define POWER_RELAY1(_s) stm32_gpiowrite(GPIO_RELAY1_EN, (_s))
|
||||||
|
#endif
|
||||||
|
#ifdef GPIO_RELAY2_EN
|
||||||
|
#define POWER_RELAY2(_s) stm32_gpiowrite(GPIO_RELAY2_EN, (_s))
|
||||||
|
#endif
|
||||||
|
|
||||||
#define OVERCURRENT_ACC (!stm32_gpioread(GPIO_ACC_OC_DETECT))
|
#define OVERCURRENT_ACC (!stm32_gpioread(GPIO_ACC_OC_DETECT))
|
||||||
#define OVERCURRENT_SERVO (!stm32_gpioread(GPIO_SERVO_OC_DETECT))
|
#define OVERCURRENT_SERVO (!stm32_gpioread(GPIO_SERVO_OC_DETECT))
|
||||||
@@ -140,18 +148,20 @@ extern struct sys_state_s system_state;
|
|||||||
/*
|
/*
|
||||||
* Mixer
|
* Mixer
|
||||||
*/
|
*/
|
||||||
extern void mixer_tick(void);
|
//extern void mixer_tick(void);
|
||||||
extern void mixer_handle_text(const void *buffer, size_t length);
|
//extern void mixer_handle_text(const void *buffer, size_t length);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Safety switch/LED.
|
* Safety switch/LED.
|
||||||
*/
|
*/
|
||||||
extern void safety_init(void);
|
extern void safety_init(void);
|
||||||
|
|
||||||
|
#ifdef CONFIG_STM32_I2C1
|
||||||
/**
|
/**
|
||||||
* FMU communications
|
* FMU communications
|
||||||
*/
|
*/
|
||||||
extern void i2c_init(void);
|
extern void i2c_init(void);
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Register space
|
* Register space
|
||||||
@@ -183,6 +193,7 @@ extern volatile uint8_t debug_level;
|
|||||||
/* send a debug message to the console */
|
/* send a debug message to the console */
|
||||||
extern void isr_debug(uint8_t level, const char *fmt, ...);
|
extern void isr_debug(uint8_t level, const char *fmt, ...);
|
||||||
|
|
||||||
|
#ifdef CONFIG_STM32_I2C1
|
||||||
void i2c_dump(void);
|
void i2c_dump(void);
|
||||||
void i2c_reset(void);
|
void i2c_reset(void);
|
||||||
|
#endif
|
||||||
|
|||||||
@@ -245,7 +245,7 @@ registers_set(uint8_t page, uint8_t offset, const uint16_t *values, unsigned num
|
|||||||
|
|
||||||
/* handle text going to the mixer parser */
|
/* handle text going to the mixer parser */
|
||||||
case PX4IO_PAGE_MIXERLOAD:
|
case PX4IO_PAGE_MIXERLOAD:
|
||||||
mixer_handle_text(values, num_values * sizeof(*values));
|
//mixer_handle_text(values, num_values * sizeof(*values));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
|
|||||||
Reference in New Issue
Block a user