mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 00:05:33 +03:00
Fix powerAdcChannel on STM32F1.
Initialisation of ADC was incorrect.
This commit is contained in:
parent
4b58dc110d
commit
b957def2f3
3 changed files with 32 additions and 29 deletions
|
@ -10,25 +10,20 @@
|
|||
|
||||
adc_config_t adcConfig[ADC_CHANNEL_COUNT];
|
||||
volatile uint16_t adcValues[ADC_CHANNEL_COUNT];
|
||||
uint8_t adcChannelCount = 0;
|
||||
|
||||
extern int16_t debug[4];
|
||||
|
||||
uint16_t adcGetChannel(uint8_t channel)
|
||||
{
|
||||
#if 0
|
||||
switch (adcChannelCount) {
|
||||
case 3:
|
||||
debug[2] = adcValues[adcConfig[2].dmaIndex];
|
||||
/* no break */
|
||||
case 2:
|
||||
debug[1] = adcValues[adcConfig[1].dmaIndex];
|
||||
/* no break */
|
||||
case 1:
|
||||
debug[0] = adcValues[adcConfig[0].dmaIndex];
|
||||
/* no break */
|
||||
default:
|
||||
break;
|
||||
#if 1
|
||||
if (adcConfig[0].enabled) {
|
||||
debug[0] = adcValues[adcConfig[0].dmaIndex];
|
||||
}
|
||||
if (adcConfig[1].enabled) {
|
||||
debug[1] = adcValues[adcConfig[1].dmaIndex];
|
||||
}
|
||||
if (adcConfig[2].enabled) {
|
||||
debug[2] = adcValues[adcConfig[2].dmaIndex];
|
||||
}
|
||||
#endif
|
||||
return adcValues[adcConfig[channel].dmaIndex];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue