hellen on a bike: both TS and SD card logs report -32v on secondary TPS and secondary PPS #6376

only: more madness
This commit is contained in:
rusEFI LLC 2024-04-22 12:45:19 -04:00
parent 985cc353b8
commit 078376fe71
2 changed files with 6 additions and 2 deletions

View File

@ -385,5 +385,7 @@ float mapFast
uint16_t autoscale actualLastInjectionStage2;@@GAUGE_NAME_FUEL_LAST_INJECTION_STAGE_2@@;"ms",{1/@@PACK_MULT_MS@@}, 0, 0, 0, 3
uint8_t autoscale injectorDutyCycleStage2;@@GAUGE_NAME_FUEL_INJ_DUTY_STAGE_2@@;"%",{1/2}, 0, 0, 0, 0
uint8_t[88 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
uint8_t adc13bitCounter
uint8_t[76 iterate] unusedAtTheEnd;;"",1, 0, 0, 0, 0
end_struct

View File

@ -86,9 +86,11 @@ static adcsample_t getAvgAdcValue(int index, adcsample_t *samples, int bufDepth,
uint32_t result = 0;
for (int i = 0; i < bufDepth; i++) {
adcsample_t sample = samples[index];
if (sample > 0xFFF) {
if (sample > 0x1FFF) {
// 12bit ADC expected right now, make this configurable one day
criticalError("fast ADC unexpected sample %d", sample);
} else if (sample > 0xFFF) {
engine->outputChannels.adc13bitCounter++;
}
result += sample;
index += numChannels;