[Horus] Mouse analogs hex values now OK

This commit is contained in:
Bertrand Songis
2016-06-25 08:36:51 +02:00
parent f69295b8f9
commit 6861d6c8a4
3 changed files with 4 additions and 3 deletions
+2 -2
View File
@@ -119,8 +119,8 @@ void adcInit()
ADC3->SQR2 = 0;
ADC3->SQR3 = ADC_IN_MOUSE1 + (ADC_IN_MOUSE2<<5);
ADC3->SMPR1 = 0;
ADC3->SMPR2 = 3 + (3<<3); // TODO SAMPTIME constant
ADC->CCR = 0; // ADC_CCR_ADCPRE_0; Clock div 2
ADC3->SMPR2 = (ADC_SAMPTIME<<(3*ADC_IN_MOUSE1)) + (ADC_SAMPTIME<<(3*ADC_IN_MOUSE2));
ADC->CCR = 0;
// Enable the DMA channel here, DMA2 stream 1, channel 2
ADC_DMA_Stream->CR = DMA_SxCR_PL | DMA_SxCR_CHSEL_1 | DMA_SxCR_MSIZE_0 | DMA_SxCR_PSIZE_0 | DMA_SxCR_MINC;
+1
View File
@@ -130,6 +130,7 @@
#define ADC_IN_MOUSE2 7
#define ADC_DMA DMA2
#define ADC_DMA_Stream DMA2_Stream0
#define ADC_SAMPTIME 3
// Power
#define PWR_RCC_AHB1Periph RCC_AHB1Periph_GPIOJ