From 798248ef24259158853f64cdae5aa545775d9c0d Mon Sep 17 00:00:00 2001 From: Laurent Lalanne Date: Sun, 21 Aug 2016 04:57:15 +0200 Subject: [PATCH] LP-387 Analog port: Add DAC pin as input - Fix pin mapping. --- flight/targets/boards/sparky2/pios_board.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/flight/targets/boards/sparky2/pios_board.h b/flight/targets/boards/sparky2/pios_board.h index 26bbb7e53..63986b0fb 100644 --- a/flight/targets/boards/sparky2/pios_board.h +++ b/flight/targets/boards/sparky2/pios_board.h @@ -310,13 +310,14 @@ extern uint32_t pios_packet_handler; // ADC // PIOS_ADC_PinGet(0) = Current sensor // PIOS_ADC_PinGet(1) = Voltage sensor -// PIOS_ADC_PinGet(4) = VREF -// PIOS_ADC_PinGet(5) = Temperature sensor +// PIOS_ADC_PinGet(7) = VREF +// PIOS_ADC_PinGet(8) = Temperature sensor // ------------------------- #define PIOS_DMA_PIN_CONFIG \ { \ - { GPIOC, GPIO_Pin_3, ADC_Channel_13, false }, /* batt/sonar pin 3 */ \ - { GPIOC, GPIO_Pin_2, ADC_Channel_12, false }, /* batt/sonar pin 4 */ \ + { GPIOC, GPIO_Pin_2, ADC_Channel_12, false }, /* Analog port pin 3 */ \ + { GPIOC, GPIO_Pin_3, ADC_Channel_13, false }, /* Analog port pin 4 */ \ + { GPIOA, GPIO_Pin_4, ADC_Channel_4, false }, /* Analog port pin2 (DAC) */ \ { 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 */ \ @@ -328,12 +329,12 @@ extern uint32_t pios_packet_handler; /* we have to do all this to satisfy the PIOS_ADC_MAX_SAMPLES define in pios_adc.h */ /* which is annoying because this then determines the rate at which we generate buffer turnover events */ /* the objective here is to get enough buffer space to support 100Hz averaging rate */ -#define PIOS_ADC_NUM_CHANNELS 8 +#define PIOS_ADC_NUM_CHANNELS 9 #define PIOS_ADC_MAX_OVERSAMPLING 2 #define PIOS_ADC_USE_ADC2 0 #define PIOS_ADC_USE_TEMP_SENSOR -#define PIOS_ADC_TEMPERATURE_PIN 7 +#define PIOS_ADC_TEMPERATURE_PIN 8 // ------------------------- // USB