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:
rusEFI LLC 2024-04-22 10:57:14 -04:00
parent 362a64b7e8
commit ea7cb49777
1 changed files with 6 additions and 1 deletions

View File

@ -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;
}