diff --git a/flight/pios/common/pios_servo.c b/flight/pios/common/pios_servo.c index 153cf181d..1fd3bc5d8 100644 --- a/flight/pios/common/pios_servo.c +++ b/flight/pios/common/pios_servo.c @@ -72,7 +72,7 @@ static uint32_t pios_dshot_t0h_raw; static uint32_t pios_dshot_t1h_raw; static uint32_t pios_dshot_t_raw; -static bool pios_servo_enabled = true; +static bool pios_servo_enabled = false; static uint32_t pios_servo_active = 0; // No active outputs by default #define PIOS_SERVO_TIMER_CLOCK 1000000 @@ -111,6 +111,10 @@ extern void PIOS_Servo_Disable() * if using inverted setup */ for (uint8_t i = 0; (i < servo_cfg->num_channels); i++) { + if (!(pios_servo_active & (1L << i))) { // This output is not active + continue; + } + const struct pios_tim_channel *chan = &servo_cfg->channels[i]; GPIO_InitTypeDef init = chan->pin.init; diff --git a/flight/targets/boards/revolution/pios_board.h b/flight/targets/boards/revolution/pios_board.h index aea74d9a8..811b8aad9 100644 --- a/flight/targets/boards/revolution/pios_board.h +++ b/flight/targets/boards/revolution/pios_board.h @@ -303,7 +303,7 @@ extern uint32_t pios_packet_handler; { GPIOA, GPIO_Pin_3, ADC_Channel_3, false }, /* Servo pin 3 */ \ { GPIOA, GPIO_Pin_2, ADC_Channel_2, false }, /* Servo pin 4 */ \ { GPIOA, GPIO_Pin_1, ADC_Channel_1, false }, /* Servo pin 5 */ \ - { GPIOA, GPIO_Pin_0, ADC_Channel_9, false }, /* Servo pin 6 */ \ + { GPIOA, GPIO_Pin_0, ADC_Channel_0, false }, /* Servo pin 6 */ \ { NULL, 0, ADC_Channel_Vrefint, false }, /* Voltage reference */ \ { NULL, 0, ADC_Channel_TempSensor, false }, /* Temperature sensor */ \ } diff --git a/flight/targets/boards/sparky2/pios_board.h b/flight/targets/boards/sparky2/pios_board.h index 6470336ac..825cf18d7 100644 --- a/flight/targets/boards/sparky2/pios_board.h +++ b/flight/targets/boards/sparky2/pios_board.h @@ -306,7 +306,7 @@ extern uint32_t pios_packet_handler; { GPIOA, GPIO_Pin_3, ADC_Channel_3, false }, /* Servo pin 3 */ \ { GPIOA, GPIO_Pin_2, ADC_Channel_2, false }, /* Servo pin 4 */ \ { GPIOA, GPIO_Pin_1, ADC_Channel_1, false }, /* Servo pin 5 */ \ - { GPIOA, GPIO_Pin_0, ADC_Channel_9, false }, /* Servo pin 6 */ \ + { GPIOA, GPIO_Pin_0, ADC_Channel_0, false }, /* Servo pin 6 */ \ { NULL, 0, ADC_Channel_Vrefint, false }, /* Voltage reference */ \ { NULL, 0, ADC_Channel_TempSensor, false }, /* Temperature sensor */ \ }