Skip to content

Commit

Permalink
fix the adc trigger settings
Browse files Browse the repository at this point in the history
  • Loading branch information
eeucalyptus committed Sep 15, 2023
1 parent 85863e3 commit 9ead327
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions examples/adc_fixed_fs/adc_fixed_fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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*/);
Expand Down

0 comments on commit 9ead327

Please sign in to comment.