diff --git a/conf/boards/elle0_1.0.makefile b/conf/boards/elle0_1.0.makefile index f94214355d..6694be1fa5 100644 --- a/conf/boards/elle0_1.0.makefile +++ b/conf/boards/elle0_1.0.makefile @@ -60,8 +60,10 @@ ifeq ($(RADIO_CONTROL_PPM_PIN),$(filter $(RADIO_CONTROL_PPM_PIN),PA_10 PA10 UART PPM_CONFIG=1 else ifeq ($(RADIO_CONTROL_PPM_PIN),$(filter $(RADIO_CONTROL_PPM_PIN),PA_01 PA01 PA1 SERVO6)) PPM_CONFIG=2 +else ifeq ($(RADIO_CONTROL_PPM_PIN),$(filter $(RADIO_CONTROL_PPM_PIN),PB_07 PB07 PB7 SERVO8)) + PPM_CONFIG=3 else -$(error Unknown RADIO_CONTROL_PPM_PIN, configure it to either PA01, PA10) +$(error Unknown RADIO_CONTROL_PPM_PIN, configure it to either PA01, PA10, PB07) endif diff --git a/conf/boards/elle0_1.2.makefile b/conf/boards/elle0_1.2.makefile index b78b144442..aa89d7e98d 100644 --- a/conf/boards/elle0_1.2.makefile +++ b/conf/boards/elle0_1.2.makefile @@ -60,8 +60,10 @@ ifeq ($(RADIO_CONTROL_PPM_PIN),$(filter $(RADIO_CONTROL_PPM_PIN),PA_10 PA10 UART PPM_CONFIG=1 else ifeq ($(RADIO_CONTROL_PPM_PIN),$(filter $(RADIO_CONTROL_PPM_PIN),PA_01 PA01 PA1 SERVO6)) PPM_CONFIG=2 +else ifeq ($(RADIO_CONTROL_PPM_PIN),$(filter $(RADIO_CONTROL_PPM_PIN),PB_07 PB07 PB7 SERVO8)) + PPM_CONFIG=3 else -$(error Unknown RADIO_CONTROL_PPM_PIN, configure it to either PA01, PA10) +$(error Unknown RADIO_CONTROL_PPM_PIN, configure it to either PA01, PA10, PB07) endif diff --git a/sw/airborne/boards/elle0_common.h b/sw/airborne/boards/elle0_common.h index da51b8f27a..80284081f5 100644 --- a/sw/airborne/boards/elle0_common.h +++ b/sw/airborne/boards/elle0_common.h @@ -187,6 +187,22 @@ #endif #define USE_AD_TIM1 1 +#elif PPM_CONFIG == 3 +#if USE_SERVOS_7AND8 +#error "You cannot USE_SERVOS_7AND8 and PPM input on PB07 (SERVO8) at the same time" +#endif +/* input on PB07 (Servo 8 pin) */ +#define USE_PPM_TIM4 1 +#define PPM_CHANNEL TIM_IC2 +#define PPM_TIMER_INPUT TIM_IC_IN_TI2 +#define PPM_IRQ NVIC_TIM4_IRQ +// Capture/Compare InteruptEnable and InterruptFlag +#define PPM_CC_IE TIM_DIER_CC2IE +#define PPM_CC_IF TIM_SR_CC2IF +#define PPM_GPIO_PORT GPIOB +#define PPM_GPIO_PIN GPIO7 +#define PPM_GPIO_AF GPIO_AF2 + #else #error "Unknown PPM config"