mirror of
https://bitbucket.org/librepilot/librepilot.git
synced 2025-02-20 10:54:14 +01:00
Merged in mindnever/librepilot/LP-584_Fix_ADC_on_servo_outputs (pull request #500)
LP-584 Fix ADC on servo outputs Approved-by: Lalanne Laurent <f5soh@free.fr> Approved-by: Vladimir Zidar <mr_w@mindnever.org> Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
This commit is contained in:
commit
b8239e3cf8
@ -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;
|
||||
|
@ -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 */ \
|
||||
}
|
||||
|
@ -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 */ \
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user