aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexey Luchko <luch@airdog.com>2014-11-28 20:45:23 +0200
committerAlexey Luchko <luch@airdog.com>2014-11-28 22:07:11 +0200
commit74e6b1c8bdc85d1630b8cb12417d81eee5c1aa31 (patch)
tree0173c4b05799c5c234e36419d47cea11c7b9f21e
parent54e7b569e7ed80e12042009494931d2ad7a5ccca (diff)
downloadpx4-firmware-74e6b1c8bdc85d1630b8cb12417d81eee5c1aa31.tar.gz
px4-firmware-74e6b1c8bdc85d1630b8cb12417d81eee5c1aa31.tar.bz2
px4-firmware-74e6b1c8bdc85d1630b8cb12417d81eee5c1aa31.zip
[AirDogIO] gpio changes.
-rwxr-xr-xnuttx-configs/AirDogIO/nsh/defconfig11
-rw-r--r--src/drivers/boards/AirDogIO/board_config.h9
-rw-r--r--src/drivers/boards/AirDogIO/px4iov2_init.c7
-rw-r--r--src/modules/px4iofirmware/dsm.c4
-rw-r--r--src/modules/px4iofirmware/px4io.h12
5 files changed, 15 insertions, 28 deletions
diff --git a/nuttx-configs/AirDogIO/nsh/defconfig b/nuttx-configs/AirDogIO/nsh/defconfig
index 02b51e3d7..10f9df981 100755
--- a/nuttx-configs/AirDogIO/nsh/defconfig
+++ b/nuttx-configs/AirDogIO/nsh/defconfig
@@ -74,8 +74,7 @@ CONFIG_ARCH_ARM=y
CONFIG_ARCH_CORTEXM3=y
CONFIG_ARCH_CHIP="stm32"
CONFIG_ARCH_CHIP_STM32F100C8=y
-CONFIG_ARCH_BOARD="px4io-v2"
-CONFIG_ARCH_BOARD_PX4IO_V2=y
+CONFIG_ARCH_BOARD="AirDogIO"
CONFIG_BOARD_LOOPSPERMSEC=2000
CONFIG_DRAM_SIZE=0x00002000
CONFIG_DRAM_START=0x20000000
@@ -110,7 +109,7 @@ CONFIG_STM32_JTAG_SW_ENABLE=y
#
# Individual subsystems can be enabled:
#
-# AHB:
+# AHB:
CONFIG_STM32_DMA1=y
CONFIG_STM32_DMA2=n
CONFIG_STM32_CRC=n
@@ -265,7 +264,7 @@ CONFIG_HAVE_LIBM=n
# CONFIG_RR_INTERVAL - The round robin timeslice will be set
# this number of milliseconds; Round robin scheduling can
# be disabled by setting this value to zero.
-# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
+# CONFIG_SCHED_INSTRUMENTATION - enables instrumentation in
# scheduler to monitor system performance
# CONFIG_TASK_NAME_SIZE - Spcifies that maximum size of a
# task name to save in the TCB. Useful if scheduler
@@ -286,11 +285,11 @@ CONFIG_HAVE_LIBM=n
# CONFIG_MUTEX_TYPES: Set to enable support for recursive and
# errorcheck mutexes. Enables pthread_mutexattr_settype().
# CONFIG_PRIORITY_INHERITANCE : Set to enable support for priority
-# inheritance on mutexes and semaphores.
+# inheritance on mutexes and semaphores.
# CONFIG_SEM_PREALLOCHOLDERS: This setting is only used if priority
# inheritance is enabled. It defines the maximum number of
# different threads (minus one) that can take counts on a
-# semaphore with priority inheritance support. This may be
+# semaphore with priority inheritance support. This may be
# set to zero if priority inheritance is disabled OR if you
# are only using semaphores as mutexes (only one holder) OR
# if no more than two threads participate using a counting
diff --git a/src/drivers/boards/AirDogIO/board_config.h b/src/drivers/boards/AirDogIO/board_config.h
index f4ab1eb2d..058089f7f 100644
--- a/src/drivers/boards/AirDogIO/board_config.h
+++ b/src/drivers/boards/AirDogIO/board_config.h
@@ -78,20 +78,11 @@
#define GPIO_LED2 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN15)
#define GPIO_LED3 (GPIO_OUTPUT|GPIO_CNF_OUTOD|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTB|GPIO_PIN13)
-/* Safety switch button *******************************************************/
-
-#define GPIO_BTN_SAFETY (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTB|GPIO_PIN5)
/* Power switch controls ******************************************************/
#define GPIO_SPEKTRUM_PWR_EN (GPIO_OUTPUT|GPIO_CNF_OUTPP|GPIO_MODE_50MHz|GPIO_OUTPUT_SET|GPIO_PORTC|GPIO_PIN13)
-#define GPIO_SERVO_FAULT_DETECT (GPIO_INPUT|GPIO_CNF_INPULLUP|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN15)
-
-/* Analog inputs **************************************************************/
-
-#define GPIO_ADC_VSERVO (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN4)
-
/* the same rssi signal goes to both an adc and a timer input */
#define GPIO_ADC_RSSI (GPIO_INPUT|GPIO_CNF_ANALOGIN|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN5)
#define GPIO_TIM_RSSI (GPIO_INPUT|GPIO_CNF_INFLOAT|GPIO_MODE_INPUT|GPIO_PORTA|GPIO_PIN12)
diff --git a/src/drivers/boards/AirDogIO/px4iov2_init.c b/src/drivers/boards/AirDogIO/px4iov2_init.c
index 46b6751eb..00e4f7e5d 100644
--- a/src/drivers/boards/AirDogIO/px4iov2_init.c
+++ b/src/drivers/boards/AirDogIO/px4iov2_init.c
@@ -109,20 +109,13 @@ __EXPORT void stm32_boardinitialize(void)
stm32_configgpio(GPIO_LED2);
stm32_configgpio(GPIO_LED3);
- stm32_configgpio(GPIO_BTN_SAFETY);
-
/* spektrum power enable is active high - enable it by default */
stm32_configgpio(GPIO_SPEKTRUM_PWR_EN);
- stm32_configgpio(GPIO_SERVO_FAULT_DETECT);
-
/* RSSI inputs */
stm32_configgpio(GPIO_TIM_RSSI); /* xxx alternate function */
stm32_configgpio(GPIO_ADC_RSSI);
- /* servo rail voltage */
- stm32_configgpio(GPIO_ADC_VSERVO);
-
stm32_configgpio(GPIO_SBUS_INPUT); /* xxx alternate function */
stm32_configgpio(GPIO_SBUS_OUTPUT);
diff --git a/src/modules/px4iofirmware/dsm.c b/src/modules/px4iofirmware/dsm.c
index 6e57c9ec7..75b125e9b 100644
--- a/src/modules/px4iofirmware/dsm.c
+++ b/src/modules/px4iofirmware/dsm.c
@@ -250,7 +250,9 @@ dsm_init(const char *device)
void
dsm_bind(uint16_t cmd, int pulses)
{
-#if !defined(CONFIG_ARCH_BOARD_PX4IO_V1) && !defined(CONFIG_ARCH_BOARD_PX4IO_V2)
+#if !defined(CONFIG_ARCH_BOARD_PX4IO_V1) \
+ && !defined(CONFIG_ARCH_BOARD_PX4IO_V2) \
+ && !defined(CONFIG_ARCH_BOARD_AIRDOG_IO)
#warning DSM BIND NOT IMPLEMENTED ON UNKNOWN PLATFORM
#else
const uint32_t usart1RxAsOutp =
diff --git a/src/modules/px4iofirmware/px4io.h b/src/modules/px4iofirmware/px4io.h
index 3b54a2e9e..24a675374 100644
--- a/src/modules/px4iofirmware/px4io.h
+++ b/src/modules/px4iofirmware/px4io.h
@@ -179,15 +179,17 @@ extern pwm_limit_t pwm_limit;
# define POWER_SPEKTRUM(_s) stm32_gpiowrite(GPIO_SPEKTRUM_PWR_EN, (_s))
# define ENABLE_SBUS_OUT(_s) stm32_gpiowrite(GPIO_SBUS_OENABLE, !(_s))
-# define VDD_SERVO_FAULT (!stm32_gpioread(GPIO_SERVO_FAULT_DETECT))
-
-# define PX4IO_ADC_CHANNEL_COUNT 2
-# define ADC_VSERVO 4
+# define PX4IO_ADC_CHANNEL_COUNT 1
# define ADC_RSSI 5
#endif
-#define BUTTON_SAFETY stm32_gpioread(GPIO_BTN_SAFETY)
+#ifdef CONFIG_ARCH_BOARD_AIRDOG_IO
+# /* We assume it is always unsafe, FMU should not check the flag. */
+# define BUTTON_SAFETY 0u
+#else
+# define BUTTON_SAFETY stm32_gpioread(GPIO_BTN_SAFETY)
+#endif
#define CONTROL_PAGE_INDEX(_group, _channel) (_group * PX4IO_CONTROL_CHANNELS + _channel)