Skip to content
Snippets Groups Projects
Unverified Commit 81e8620a authored by CNLohr's avatar CNLohr Committed by GitHub
Browse files

Merge pull request #238 from eeucalyptus/fix_adc_trigger

fix the adc trigger settings
parents 85863e31 9ead3273
No related branches found
No related tags found
No related merge requests found
......@@ -68,8 +68,7 @@ void init_adc() {
RCC->CFGR0 |= RCC_ADCPRE_DIV2; // set it to 010xx for /2.
// Keep CALVOL register with initial value
ADC1->CTLR1 |= ADC_ExternalTrigConv_T1_TRGO;
ADC1->CTLR2 = ADC_ADON | ADC_DMA | ADC_EXTTRIG;
ADC1->CTLR2 = ADC_ADON | ADC_DMA | ADC_EXTTRIG | ADC_ExternalTrigConv_T1_TRGO;
// Possible times: 0->3,1->9,2->15,3->30,4->43,5->57,6->73,7->241 cycles
ADC1->SAMPTR2 = 0/*3 cycles*/ << (3/*offset per channel*/ * 2/*channel*/);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment