X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fstm32f1%2Fao_adc_stm.c;h=d7fac0d7c150f44bfd2959f66730f0420dc86f5f;hb=37de458faea5f67870b80e3549e37130bf43b11b;hp=f552d67ddf46ba3794c87764e9a32a08624bc9d3;hpb=1760bec9ed19c64f35ea28904cea433d39dead07;p=fw%2Faltos diff --git a/src/stm32f1/ao_adc_stm.c b/src/stm32f1/ao_adc_stm.c index f552d67d..d7fac0d7 100644 --- a/src/stm32f1/ao_adc_stm.c +++ b/src/stm32f1/ao_adc_stm.c @@ -160,7 +160,7 @@ ao_adc_dump(void) #ifdef AO_ADC_SQ1_NAME if (ao_adc_name[i]) printf (" %s: %5d", ao_adc_name[i], d[i]); - else + else #endif printf (" %2d: %5d", i, d[i]); } @@ -337,6 +337,13 @@ ao_adc_init(void) #error "too many ADC channels" #endif +#ifndef HAS_ADC_TEMP +#error Please define HAS_ADC_TEMP +#endif +#if HAS_ADC_TEMP + stm_adc.cr2 |= ((1 << STM_ADC_CR2_TSVREFE)); +#endif + /* Clear any stale status bits */ stm_adc.sr = 0;