hellen on a bike: both TS and SD card logs report -32v on secondary TPS and secondary PPS #6376
only: let's not trust anyone
This commit is contained in:
parent
362a64b7e8
commit
ea7cb49777
|
@ -85,7 +85,12 @@ static int adcDebugReporting = false;
|
|||
static adcsample_t getAvgAdcValue(int index, adcsample_t *samples, int bufDepth, int numChannels) {
|
||||
uint32_t result = 0;
|
||||
for (int i = 0; i < bufDepth; i++) {
|
||||
result += samples[index];
|
||||
adcsample_t sample = samples[index];
|
||||
if (sample > 0xFFF) {
|
||||
// 12bit ADC expected right now, make this configurable one day
|
||||
criticalError("fast ADC unexpected sample %d", sample);
|
||||
}
|
||||
result += sample;
|
||||
index += numChannels;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue