From 0846059646990fd4fbe4a884dbd1a8ff46d559c1 Mon Sep 17 00:00:00 2001 From: David Sidrane Date: Tue, 12 Feb 2019 04:05:23 -0800 Subject: [PATCH] fmuv5:Repurpose TIM5_SPARE_4 as nARMED nARMED is a Digital OUTPUT. GPIO will be set as input while not armed HW will have Pull UP. While armed it will be configured as a GPIO OUT set LOW. --- boards/px4/fmu-v5/src/board_config.h | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/boards/px4/fmu-v5/src/board_config.h b/boards/px4/fmu-v5/src/board_config.h index 481c789113..6ff1a56ea9 100644 --- a/boards/px4/fmu-v5/src/board_config.h +++ b/boards/px4/fmu-v5/src/board_config.h @@ -347,9 +347,14 @@ #define DIRECT_PWM_CAPTURE_CHANNELS 3 -/* TIM5_CH4 SPARE PIN */ -#define GPIO_TIM5_CH4IN /* PI0 T5C4 TIM5_SPARE_4 */ GPIO_TIM5_CH4IN_2 -#define GPIO_TIM5_CH4OUT /* PI0 T5C4 TIM5_SPARE_4 */ GPIO_TIM5_CH4OUT_2 +/* PI0 is nARMED + * The GPIO will be set as input while not armed HW will have external HW Pull UP. + * While armed it shall be configured at a GPIO OUT set LOW + */ +#define GPIO_nARMED_INIT /* PI0 */ (GPIO_INPUT|GPIO_PULLUP|GPIO_PORTI|GPIO_PIN1) +#define GPIO_nARMED /* PI0 */ (GPIO_OUTPUT|GPIO_PUSHPULL|GPIO_SPEED_2MHz|GPIO_OUTPUT_CLEAR|GPIO_PORTI|GPIO_PIN1) + +#define BOARD_INDICATE_ARMED_STATE(on_armed) px4_arch_configgpio((on_armed) ? GPIO_nARMED : GPIO_nARMED_INIT) /* PWM * @@ -662,7 +667,8 @@ GPIO_TONE_ALARM_IDLE, \ GPIO_RSSI_IN_INIT, \ GPIO_nSAFETY_SWITCH_LED_OUT_INIT, \ - GPIO_SAFETY_SWITCH_IN \ + GPIO_SAFETY_SWITCH_IN, \ + GPIO_nARMED_INIT \ } __BEGIN_DECLS